/* ============================================================
   APEX HUB — ONBOARDING FORM
   Design tokens mirror apexhubfulfillment.com exactly.
   ============================================================ */

/* === TOKENS === */
:root {
  --brand-blue:   #04B8F4;
  --white:        #FFFFFF;
  --dark:         #020710;
  --bg:           #080E17;

  --a06: rgba(255, 255, 255, 0.06);
  --a10: rgba(255, 255, 255, 0.10);
  --a20: rgba(255, 255, 255, 0.20);
  --a30: rgba(255, 255, 255, 0.30);
  --a60: rgba(255, 255, 255, 0.60);

  --gr-btn:  linear-gradient(93deg, #52C6EC -5.47%, #04B8F4 103.17%);
  --gr-blue: linear-gradient(93deg, #82D5F1 -5.47%, #52C6EC 48.85%, #04B8F4 103.17%);

  --sh-btn:   0 0 25px 0 rgba(255,255,255,0.03) inset, 0 0 4px 0 rgba(255,255,255,0.05) inset;
  --sh-glass: 0 0 12px 0 rgba(255,255,255,0.04) inset;
  --sh-blue:  0 4px 20px 0 rgba(4,184,244,0.08), 0 0 24px 0 rgba(4,184,244,0.04) inset;

  --r-btn:   1em;
  --r-card:  1.25rem;
  --r-input: 0.625rem;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-s: 0.2s;
  --dur-m: 0.35s;

  --font-mono: 'Geist Mono', 'Courier New', monospace;
  --font-body: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === BACKGROUND === */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 1;
}
.bg-grid::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 90% 55% at 50% -5%, rgba(4,184,244,0.09) 0%, transparent 65%);
  pointer-events: none;
}

/* === HEADER === */
.header {
  position: relative;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.055);
}
.logo-link { display: flex; align-items: center; text-decoration: none; }
.logo { height: 2rem; width: auto; }
.back-link {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--a60);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color var(--dur-s) ease;
}
.back-link:hover { color: var(--white); }

/* === MAIN === */
.main {
  position: relative;
  z-index: 20;
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1.25rem 5rem;
}

/* === CARD === */
.form-card {
  width: 100%;
  max-width: 560px;
  background: rgba(255,255,255,0.018);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-card);
  padding: 2.5rem;
  box-shadow: var(--sh-glass), 0 0 80px rgba(4,184,244,0.025);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* === PROGRESS === */
.progress-wrap { margin-bottom: 2.25rem; }

.step-counter {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--a60);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.625rem;
}
.progress-bar {
  height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gr-btn);
  border-radius: 2px;
  width: 25%;
  transition: width 0.45s var(--ease);
}

/* === STEP === */
.form-step { display: none; }
.form-step.active {
  display: block;
  animation: fadeSlide 0.3s var(--ease) both;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* === HEADINGS === */
.step-title {
  font-family: var(--font-mono);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.02em;
  margin-bottom: 0.375rem;
  line-height: 1.25;
}
.step-sub {
  font-size: 0.9375rem;
  color: var(--a60);
  margin-bottom: 2rem;
  line-height: 1.55;
}

/* === FIELDS === */
.field-group { display: flex; flex-direction: column; gap: 1.25rem; }
.field { display: flex; flex-direction: column; }

.label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--a60);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

/* === INPUTS === */
.input {
  background: rgba(255,255,255,0.028);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--r-input);
  padding: 0.8125rem 1rem;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  outline: none;
  width: 100%;
  transition: border-color var(--dur-s) ease, box-shadow var(--dur-s) ease;
}
.input::placeholder { color: rgba(255,255,255,0.22); }
.input:focus {
  border-color: rgba(4,184,244,0.5);
  box-shadow: 0 0 0 3px rgba(4,184,244,0.09);
}
.input.error {
  border-color: rgba(239,68,68,0.55);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.07);
}
.textarea { resize: vertical; min-height: 7rem; line-height: 1.6; }

/* === FIELD ERROR === */
.field-error {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: rgba(239,68,68,0.85);
  margin-top: 0.375rem;
  min-height: 1.1em;
  letter-spacing: 0.02em;
}

/* === CHECKBOX CARDS === */
.checkbox-group { display: flex; flex-direction: column; gap: 0.5rem; }

.checkbox-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8125rem 1rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-input);
  cursor: pointer;
  user-select: none;
  transition: border-color var(--dur-s) ease, background var(--dur-s) ease, color var(--dur-s) ease;
  font-size: 0.9375rem;
  color: var(--a60);
}
.checkbox-card:hover {
  border-color: rgba(4,184,244,0.28);
  background: rgba(4,184,244,0.035);
  color: var(--white);
}
.checkbox-card.selected {
  border-color: rgba(4,184,244,0.5);
  background: rgba(4,184,244,0.07);
  color: var(--white);
}
.checkbox-card input[type="checkbox"] { display: none; }

.check-icon {
  width: 1.125rem;
  height: 1.125rem;
  min-width: 1.125rem;
  border: 1.5px solid rgba(255,255,255,0.22);
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-s) ease;
  flex-shrink: 0;
}
.checkbox-card.selected .check-icon {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}
.checkbox-card.selected .check-icon::after {
  content: '';
  display: block;
  width: 0.33rem;
  height: 0.53rem;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-0.5px, -1.5px);
}

/* === RADIO CARDS === */
.radio-group { display: flex; flex-direction: column; gap: 0.5rem; }

.radio-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.9375rem 1rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-input);
  cursor: pointer;
  user-select: none;
  transition: border-color var(--dur-s) ease, background var(--dur-s) ease;
}
.radio-card:hover {
  border-color: rgba(4,184,244,0.28);
  background: rgba(4,184,244,0.035);
}
.radio-card.selected {
  border-color: rgba(4,184,244,0.5);
  background: rgba(4,184,244,0.07);
}
.radio-card input[type="radio"] { display: none; }

.radio-icon {
  width: 1.125rem;
  height: 1.125rem;
  min-width: 1.125rem;
  border: 1.5px solid rgba(255,255,255,0.22);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-s) ease;
  flex-shrink: 0;
}
.radio-card.selected .radio-icon { border-color: var(--brand-blue); }
.radio-card.selected .radio-icon::after {
  content: '';
  display: block;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--brand-blue);
  border-radius: 50%;
}
.radio-label {
  display: block;
  font-size: 0.9375rem;
  color: var(--a60);
  transition: color var(--dur-s) ease;
}
.radio-sub {
  display: block;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  font-family: var(--font-mono);
  margin-top: 0.125rem;
  letter-spacing: 0.03em;
}
.radio-card.selected .radio-label { color: var(--white); }

/* === PILLS === */
.pills-group { display: flex; flex-wrap: wrap; gap: 0.625rem; }

.pill-option {
  display: inline-flex;
  align-items: center;
  padding: 0.5625rem 1.25rem;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 2rem;
  font-size: 0.875rem;
  cursor: pointer;
  user-select: none;
  color: var(--a60);
  transition: all var(--dur-s) ease;
}
.pill-option:hover {
  border-color: rgba(4,184,244,0.4);
  color: var(--white);
}
.pill-option.selected {
  border-color: var(--brand-blue);
  background: rgba(4,184,244,0.1);
  color: var(--brand-blue);
}
.pill-option input[type="checkbox"] { display: none; }

/* === NAVIGATION === */
.form-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* === BUTTONS === */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gr-btn);
  color: var(--white);
  border: none;
  border-radius: var(--r-btn);
  padding: 0.8125rem 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity var(--dur-s) ease, transform var(--dur-s) ease;
  box-shadow: var(--sh-btn);
  text-decoration: none;
  white-space: nowrap;
  margin-left: auto;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-back {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--a60);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-btn);
  padding: 0.8125rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all var(--dur-s) ease;
  white-space: nowrap;
}
.btn-back:hover { color: var(--white); border-color: rgba(255,255,255,0.22); }

/* === GLOBAL ERROR === */
.global-error {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(239,68,68,0.85);
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(239,68,68,0.07);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--r-input);
  letter-spacing: 0.02em;
}

/* === UTILITIES === */
.hidden { display: none !important; }

/* === THANK YOU === */
.thank-you-card {
  text-align: center;
  padding: 3.5rem 2.5rem;
  max-width: 480px;
}
.ty-icon {
  width: 3.75rem;
  height: 3.75rem;
  background: var(--gr-btn);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  margin: 0 auto 1.625rem;
  box-shadow: 0 0 28px rgba(4,184,244,0.35);
}
.ty-title {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.ty-title span { background: var(--gr-blue); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.ty-text {
  font-size: 0.9375rem;
  color: var(--a60);
  line-height: 1.65;
  max-width: 360px;
  margin: 0 auto 2.25rem;
}
.ty-btn { margin: 0 auto; }

/* === RESPONSIVE === */
@media (max-width: 600px) {
  .header { padding: 1rem 1.25rem; }
  .logo { height: 1.625rem; }
  .main { padding: 1.75rem 0.875rem 3.5rem; }
  .form-card { padding: 1.75rem 1.25rem; }
  .step-title { font-size: 1.1875rem; }
  .btn-primary { padding: 0.75rem 1.25rem; font-size: 0.8125rem; }
  .btn-back { padding: 0.75rem 1rem; font-size: 0.75rem; }
  .thank-you-card { padding: 2.5rem 1.25rem; }
}
