* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: hidden;
}

body {
  font-family: Arial, sans-serif;
  background: #081b27;
}

.signup-page {
  position: absolute;
  inset: 0;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  background: #081b27;
}

.page-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.22);
}

.signup-center {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
}

.back-button {
  position: absolute;
  top: 30px;
  left: 40px;
  padding: 8px 18px;
  border-radius: 12px;
  font-size: 13px;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.signup-card {
  display: flex;
  flex-wrap: wrap;
  width: min(1100px, calc(100vw - 40px));
  max-width: 95%;
  max-height: calc(100vh - 80px);
  min-height: 600px;
  padding: 50px 50px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.25);
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  box-sizing: border-box;
}

.card-header {
  text-align: center;
  margin-bottom: 16px;
}

.card-header h1 {
  font-size: 26px;
  color: #145267;
  margin-bottom: 8px;
  line-height: 1.1;
}

.card-header p {
  max-width: 700px;
  margin: 0 auto;
  font-size: 14px;
  color: #4f5b66;
  line-height: 1.75;
}

.signup-card form {
  flex: 1 1 auto;
  min-height: 0;
  padding-right: 4px;
}

.form-grid {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.form-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-group,
.form-input {
  min-width: 0;
}

.form-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-one {
  grid-template-columns: 1fr;
}

.form-grid-custom {
  grid-template-columns: 1.2fr 1.8fr 1fr;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.referral-section {
  gap: 12px;
  margin-top: 0;
  align-items: flex-start;
}

.referral-toggle {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 100px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: -20px;
  font-size: 14px;
  color: #253444;
  font-weight: 600;
  padding-top: 2px;
}

.checkbox-label input[type="checkbox"],
.checkbox-group input[type="checkbox"] {
  margin-top: 0;
  width: 16px;
  height: 16px;
}

.referral-field {
  display: none;
  flex-direction: column;
  margin-top: -10px;
  width: 100%;
}

.referral-field.active {
  display: flex;
}

.referral-inline {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
}

.referral-helper {
  font-size: 12px;
  color: #4f5b66;
  line-height: 1.2;
  max-width: 180px;
  margin-top: -10px;
  margin-left: 30px;
}

.referral-input-group {
  width: 100%;
}

.referral-field .input-group {
  width: 100%;
}

.referral-field .form-input {
  width: 100%;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: #5a6a78;
  margin-bottom: 6px;
  display: block;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 42%;
  transform: translateY(-50%);
  color: #a0a9b3;
  font-size: 16px;
  pointer-events: none;
  z-index: 1;
}

.toggle-password {
  position: absolute;
  right: 14px;
  top: 42%;
  transform: translateY(-50%);
  color: #a0a9b3;
  font-size: 16px;
  cursor: pointer;
  z-index: 1;
  transition: color 0.2s ease;
}

.toggle-password:hover {
  color: #145267;
}

.form-input {
  width: 100%;
  padding: 14px 45px 14px 45px;
  margin-top: 0;
  margin-bottom: 0;
  border-radius: 12px;
  border: 1px solid #e3e6ea;
  background: #f7f9fc;
  font-size: 14px;
  color: #253444;
}

.form-input:focus {
  outline: none;
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 186, 203, 0.1);
}

.field-error .form-input {
  border: 2px solid #ef4444;
  background: #fff7f7;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.field-error .form-input:focus {
  border: 2px solid #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.checkbox-group {
  margin: 0px;
}

.checkbox-group label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #253444;
  font-weight: 600;
  line-height: 1.4;
}

.checkbox-group input[type="checkbox"] {
  margin-top: 0;
  width: 16px;
  height: 16px;
}

.checkbox-group a {
  color: #145267;
  text-decoration: none;
}

.btn-signup {
  width: 100%;
  min-width: 200px;
  max-width: 100%;
  padding: 16px 32px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #145267 0%, #10bacb 100%);
  color: white;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(16, 186, 203, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 10px;
  height: 50px;
  min-height: 50px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-signup:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(16, 186, 203, 0.24);
}

.form-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: #5a6a78;
}

.login-link {
  text-align: center;
  margin-top: 15px;
  font-size: 14px;
  color: #145267;
  text-decoration: none;
  font-weight: 600;
}

.login-link a {
  color: #145267;
  text-decoration: none;
  font-weight: 600;
}

.login-link a:hover {
  text-decoration: underline;
  transition: text-decoration 0.2s ease;
}

.form-footer a {
  color: #145267;
  text-decoration: none;
  font-weight: 600;
}

.feature-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.feature-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 14px;
  background: rgba(16, 186, 203, 0.08);
}

.feature-card i {
  font-size: 16px;
  color: #145267;
  margin-top: 4px;
}

.feature-card strong {
  display: block;
  color: #145267;
  margin-bottom: 4px;
}

.feature-card p {
  margin: 0;
  font-size: 12px;
  color: #4f5b66;
  line-height: 1.5;
}

/* ================= ERROR STATES ================= */
.field-error {
    display: block;
    margin-top: 4px;
    margin-bottom: 0;
    padding: 2px 0 0 0;
    font-size: 11px;
    color: #dc2626;
    font-weight: 500;
    line-height: 1.3;
}

/* Import standardized form input styles */
@import url('../../css/components/form-inputs.css');

.field-error-message {
  display: block;
  margin-top: 4px;
  margin-bottom: 0;
  padding: 2px 0 0 0;
  font-size: 11px;
  color: #dc2626;
  font-weight: 500;
  line-height: 1.3;
  animation: slideDown 0.2s ease;
  letter-spacing: -0.01em;
}

.field-hint {
  display: block;
  margin-top: 2px;
  margin-bottom: 0;
  padding: 2px 0 0 0;
  font-size: 11px;
  color: #6b7280;
  line-height: 1.3;
  letter-spacing: -0.01em;
}


@media (max-width: 1000px) {
  .signup-card {
    padding: 32px 28px 30px;
  }

  .form-grid-two,
  .form-grid-three {
    grid-template-columns: 1fr;
  }

  .feature-row {
    grid-template-columns: 1fr;
  }

  .floating-error-alert {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 450px;
    width: min(450px, calc(100vw - 40px));
  }

  .error-alert-content {
    padding: 16px 20px;
    gap: 12px;
  }

  .error-alert-icon {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .error-alert-title {
    font-size: 13px;
  }

  .error-alert-message {
    font-size: 12px;
  }
}

@media (max-width: 620px) {
  .back-button {
    left: 16px;
    top: 18px;
    padding: 8px 16px;
  }

  .signup-card {
    padding: 26px 20px 24px;
  }

  .card-header h1 {
    font-size: 28px;
  }

  .input-icon,
  .toggle-password {
    font-size: 15px;
  }

  .floating-error-alert {
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 400px;
    width: min(400px, calc(100vw - 30px));
  }

  .error-alert-content {
    grid-template-columns: auto 1fr;
    padding: 14px 16px;
  }

  .error-alert-close {
    display: none;
  }

  .error-alert-title {
    font-size: 12px;
  }

  .error-alert-message {
    font-size: 11px;
  }
}

/* ================= LOADING OVERLAY ================= */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 27, 39, 0.95);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease forwards;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.loading-spinner i {
  font-size: 28px;
  color: #10bacb;
  animation: spin 1s linear infinite;
}

.loading-text {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  opacity: 0.9;
  transition: all 0.3s ease;
}

/* ================= BUTTON LOADING STATES ================= */
.btn-signup {
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
}

.btn-signup .btn-text,
.btn-signup .btn-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.btn-signup:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-signup:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-text {
  display: inline-block;
  transition: opacity 0.2s ease;
}

.btn-loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.btn-loading i {
  font-size: 16px;
  animation: spin 1s linear infinite;
}

/* ================= ANIMATIONS ================= */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
