/* ============ SIGN UP (BACKGROUND IMAGE + OVERLAY PANEL) ============ */
#sign-up {
  position: relative;
  padding: 4.5rem 0;
  background-image: url('/assets/img/background-1.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

/* Overlay tint (light shade of dark-blue) */
#sign-up::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(9, 29, 49, 0.35); /* --dark-blue with alpha */
  pointer-events: none;
}

/* Ensure content sits above overlay */
#sign-up .container {
  position: relative;
  z-index: 1;
}

/* Smaller inner card so bg is visible */
#sign-up .sign-up-panel {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  background: rgba(200, 16, 46, 0.78); /* --red with alpha */
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Title */
#sign-up .sign-up-title {
  margin: 0 0 1.25rem;
  text-align: center;
  color: var(--white);
  font-family: var(--font-heading-2);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  line-height: 1.05;
}

/* Form layout */
#sign-up-form.sign-up-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  margin-top: 0.75rem;
  font-family: var(--font-heading-2);
}

#sign-up-form .input-group {
  display: flex;
  flex-direction: column;
}

#sign-up-form .span-2 {
  grid-column: span 2;
}

/* Make message span full width on 2-col layout */
#sign-up-form.sign-up-form-grid .message-group {
  grid-column: span 2;
}

/* ============ Inputs + textarea (base) ============ */
#sign-up-form input,
#sign-up-form textarea {
  width: 100%;
  padding: 0.95rem 1rem;
  font-size: 1.05rem;
  font-family: var(--font-body);
  color: #1b1b1b;
  background-color: var(--white);
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 0;
  transition:
    border-color 0.12s ease-out,
    box-shadow 0.12s ease-out,
    transform 0.12s ease-out;
}

#sign-up-form textarea {
  resize: vertical;
  min-height: 5.5rem;
  line-height: 1.45;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

#sign-up-form input::placeholder,
#sign-up-form textarea::placeholder {
  color: rgba(0, 0, 0, 0.55);
}

#sign-up-form input:focus,
#sign-up-form textarea:focus {
  outline: none;
  border-color: rgba(0, 0, 0, 0.25);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

/* ============ Composite Name Field (First + Last inside ONE field) ============ */
#sign-up-form .name-combo-shell {
  width: 100%;
  min-height: 3.2rem; /* matches other inputs visually */
  background-color: var(--white);
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 0;

  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  overflow: hidden;

  transition:
    border-color 0.12s ease-out,
    box-shadow 0.12s ease-out,
    transform 0.12s ease-out;
}

/* Inner inputs should NOT look like inputs (no border, no bg, no shadow) */
#sign-up-form .name-combo-shell input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  outline: none;

  padding: 0.95rem 1rem; /* same as other inputs */
  font-size: 1.05rem;
  font-family: var(--font-body);
  color: #1b1b1b;

  width: 100%;
  min-width: 0;
}

/* Divider inside the name field */
#sign-up-form .name-combo-divider {
  width: 1px;
  height: 55%;
  background: rgba(0, 0, 0, 0.18);
}

/* Focus the whole shell when either first/last is focused */
#sign-up-form .name-combo-shell:focus-within {
  border-color: rgba(0, 0, 0, 0.25);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

/* Placeholder tone consistency */
#sign-up-form .name-combo-shell input::placeholder {
  color: rgba(0, 0, 0, 0.55);
}

/* ============ Accessibility helper ============ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============ Actions ============ */
#sign-up-form .form-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

/* Button uses CTA colors */
#sign-up-form .sign-up-form-btn {
  width: min(420px, 100%);
  height: 3.2rem;
  border-radius: 0;
  border: 2px solid #c7a869;

  background: linear-gradient(135deg, #e8d6a0, #c7a869 45%, #9a814a 100%);
  color: var(--blue);

  cursor: pointer;
  font-family: var(--font-heading-2);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;

  display: flex;
  justify-content: center;
  align-items: center;

  transition:
    transform 0.2s ease-out,
    box-shadow 0.2s ease-out,
    filter 0.2s ease-out;
}

#sign-up-form .sign-up-form-btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.18);
}

#sign-up-form .sign-up-form-btn:disabled {
  cursor: not-allowed;
  opacity: 0.8;
  transform: none;
  box-shadow: none;
}

/* Status */
.sign-up-status {
  min-height: 1.2em;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.95);
}

.sign-up-status--pending,
.sign-up-status--success,
.sign-up-status--error {
  color: rgba(255, 255, 255, 0.98);
}

/* Footnotes */
#sign-up .sign-up-footnotes {
  margin-top: 1.25rem;
}

.sign-up-note {
  font-size: 0.98rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.95);
}

.sign-up-note + .sign-up-note {
  margin-top: 0.9rem;
}

/* ✅ Stack earlier */
@media (max-width: 980px) {
  #sign-up-form.sign-up-form-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  #sign-up-form .span-2 {
    grid-column: auto;
  }

  #sign-up .sign-up-panel {
    width: min(760px, 100%);
  }

  #sign-up-form.sign-up-form-grid .message-group {
    grid-column: auto;
  }
}

/* Mobile: keep full width within container */
@media (max-width: 767px) {
  #sign-up {
    padding: 2.5rem 0;
  }

  #sign-up .sign-up-panel {
    width: 100%;
  }

  /* On mobile, make composite name behave like normal (no cramped split) */
  #sign-up-form .name-combo-shell {
    grid-template-columns: 1fr;
  }

  #sign-up-form .name-combo-divider {
    display: none;
  }

  #sign-up-form .name-combo-shell input {
    padding: 0.95rem 1rem;
  }

  /* Turn the composite container into a transparent wrapper */
  #sign-up-form .name-combo-shell {
    display: contents;
    border: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
  }

  /* Remove the divider entirely */
  #sign-up-form .name-combo-divider {
    display: none;
  }

  /* Restore normal input styling for first & last name */
  #sign-up-form .name-combo-shell input {
    border: 2px solid rgba(0, 0, 0, 0.12) !important;
    background-color: var(--white) !important;
    box-shadow: none !important;
    transform: none !important;
    margin: 0;
  }

  /* Spacing between First + Last on mobile (bulletproof) */
  #sign-up-form #last-name {
    margin-top: 0.9rem;
  }
}
