/* ==========================================================================
   GXpress — Beta Testing Onboarding Stylesheet (Dark & Light Theme)
   ========================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Sora', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;

  /* Theme: Dark (Default) */
  --bg-base: #0a0a0c;
  --bg-surface: #121216;
  --bg-surface-2: #191920;
  --bg-surface-3: #22222c;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-glow: rgba(255, 106, 26, 0.4);

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-faint: #6b7280;

  --accent: #ff6a1a;
  --accent-glow: rgba(255, 106, 26, 0.25);
  --accent-hover: #ff7d3b;

  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.15);
  --whatsapp: #25d366;
  --whatsapp-hover: #20bd5a;
  --danger: #ef4444;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-card: 0 16px 40px -10px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 40px -8px rgba(255, 106, 26, 0.35);
}

[data-theme="light"], .light-theme {
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-2: #f1f5f9;
  --bg-surface-3: #e2e8f0;

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.15);
  --border-glow: rgba(255, 106, 26, 0.3);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-faint: #94a3b8;

  --shadow-card: 0 16px 40px -10px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 35px -8px rgba(255, 106, 26, 0.2);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (display-mode: standalone) {
  body {
    padding-top: max(env(safe-area-inset-top, 0px), 60px);
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 20px);
  }
}

/* Ambient glow background orbs */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.22;
}

.orb-orange {
  width: 480px;
  height: 480px;
  background: var(--accent);
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
}

.orb-blue {
  width: 400px;
  height: 400px;
  background: #3b82f6;
  bottom: -100px;
  right: -80px;
  opacity: 0.12;
}

/* Navigation Header */
.beta-nav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px max(28px, env(safe-area-inset-right, 0px)) 20px max(28px, env(safe-area-inset-left, 0px));
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.nav-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(255, 106, 26, 0.25);
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-title span.accent {
  color: var(--accent);
}

.brand-copy {
  min-width: 0;
}

.nav-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(255, 106, 26, 0.3);
  margin-left: 6px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle-btn {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.theme-toggle-btn:hover {
  background: var(--bg-surface-3);
  border-color: var(--border-strong);
}

.link-sign-in {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: color 0.15s;
}

.link-sign-in:hover {
  color: var(--text-main);
}

.link-sign-in {
  white-space: nowrap;
}

/* Container */
.beta-container {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 10px auto 60px;
  padding: 0 20px;
  width: 100%;
}

/* Hero Header */
.beta-hero {
  text-align: center;
  margin-bottom: 36px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.pill-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.beta-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 10px;
}

.beta-hero p.subtitle {
  font-size: clamp(14px, 1.8vw, 16px);
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto;
}

/* ───────────────────────────────────────────────────────────────
   STEP 1: ROLE SELECTOR CARDS
   ─────────────────────────────────────────────────────────────── */
.role-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  margin-top: 10px;
}

@media (max-width: 768px) {
  .role-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.role-card {
  position: relative;
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.role-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.role-card-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 18px;
}

.role-card-badge.badge-trial {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.role-card-badge.badge-vetting {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(255, 106, 26, 0.3);
}

.role-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border: 1px solid var(--border-subtle);
  color: var(--accent);
}

.role-card-icon svg {
  width: 28px;
  height: 28px;
}

.role-card h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.role-card p.role-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.perks-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.perks-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.perks-list svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
  flex-shrink: 0;
}

.btn-role-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-role-action.btn-orange {
  background: linear-gradient(135deg, var(--accent), #ff8a3d);
  color: #ffffff;
  box-shadow: 0 4px 14px -2px rgba(255, 106, 26, 0.5);
}

.btn-role-action.btn-orange:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-role-action.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-strong);
}

.btn-role-action.btn-outline:hover {
  background: var(--bg-surface-2);
  border-color: var(--accent);
  color: var(--accent);
}

/* ───────────────────────────────────────────────────────────────
   STEP 2: FORMS CONTAINER
   ─────────────────────────────────────────────────────────────── */
.form-panel {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  max-width: 640px;
  margin: 0 auto;
  box-shadow: var(--shadow-card);
  animation: slideInUp 0.3s ease-out both;
  scroll-margin-top: 24px;
}

.form-panel.active {
  display: block;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-back-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin-bottom: 20px;
  padding: 4px 0;
  transition: color 0.15s;
}

.panel-back-btn:hover {
  color: var(--accent);
}

.form-panel-header {
  margin-bottom: 24px;
}

.form-panel-header h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.form-panel-header p {
  font-size: 13.5px;
  color: var(--text-muted);
}

/* Form Elements */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 580px) {
  .field-grid {
    grid-template-columns: 1fr;
  }
  .form-panel {
    padding: 24px 18px;
  }
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field-group.full {
  grid-column: 1 / -1;
}

.field-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.field-label span.req {
  color: var(--accent);
  margin-left: 2px;
}

.field-input, .field-select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field-input::placeholder {
  color: var(--text-faint);
}

.field-input:focus, .field-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-surface);
}

.input-relative {
  position: relative;
}

.input-icon-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-icon-btn:hover {
  color: var(--text-main);
}

/* Info & Voucher Callout Banner */
.callout-box {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
}

.callout-box.trial {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--text-main);
}

.callout-box.trial .voucher-code-chip {
  font-family: var(--font-mono);
  font-weight: 800;
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.callout-box.vetting {
  background: var(--accent-glow);
  border: 1px solid rgba(255, 106, 26, 0.25);
  color: var(--text-main);
}

.callout-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Zone confirmed pill */
.zone-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
  background: var(--bg-surface-3);
  border: 1px solid var(--border-glow);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

.fleet-base-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--bg-surface-3), var(--bg-surface-2));
}

.fleet-base-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-glow);
  font-size: 18px;
}

.fleet-base-note > div {
  flex: 1;
  min-width: 0;
}

.fleet-base-note strong {
  display: block;
  color: var(--text-main);
  font-size: 14px;
}

.fleet-base-note p {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.fleet-base-tag {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

/* Submit Buttons */
.btn-submit-main {
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font-display);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), #ff8a3d);
  color: #ffffff;
  box-shadow: 0 4px 16px -2px rgba(255, 106, 26, 0.5);
  margin-top: 12px;
}

.btn-submit-main:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-submit-main:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ───────────────────────────────────────────────────────────────
   VERIFICATION POPUP MODAL (Fleet Path)
   ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 8, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.verification-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 32px 28px;
  text-align: center;
  box-shadow: var(--shadow-card);
  position: relative;
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUp {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.check-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.15);
  border: 2px solid var(--whatsapp);
  color: var(--whatsapp);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.check-circle svg {
  width: 36px;
  height: 36px;
}

.verification-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}

.verification-card p.v-sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.req-items-box {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
  margin-bottom: 22px;
}

.req-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-main);
  padding: 6px 0;
}

.req-item:not(:last-child) {
  border-bottom: 1px solid var(--border-subtle);
}

.req-badge {
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
}

.btn-whatsapp {
  width: 100%;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 800;
  border: none;
  background: var(--whatsapp);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 16px -2px rgba(37, 211, 102, 0.45);
  transition: all 0.15s ease;
}

.btn-whatsapp:hover {
  background: var(--whatsapp-hover);
  transform: translateY(-1px);
}

.app-ref-text {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 14px;
  font-family: var(--font-mono);
}

/* Toast Stack */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-surface-3);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.25s ease-out;
}

.toast.danger {
  border-color: var(--danger);
  background: #2b1212;
  color: #fca5a5;
}

.toast.success {
  border-color: var(--success);
  background: #0f241a;
  color: #6ee7b7;
}

@keyframes slideInRight {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   BETA CAPACITY BOARD
   ========================================================================== */

.capacity-board {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg, 16px);
  padding: 20px 24px 18px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.capacity-board::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,106,26,0.04) 0%, transparent 60%);
  pointer-events: none;
}

.capacity-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.capacity-board-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cap-pulse {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: capPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes capPulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(255,106,26,0.5); }
  50% { opacity: 0.8; transform: scale(1.15); box-shadow: 0 0 0 5px rgba(255,106,26,0); }
}

.capacity-board-sub {
  font-size: 11.5px;
  color: var(--text-faint);
  font-style: italic;
}

/* Row */
.cap-row {
  margin-bottom: 16px;
}
.cap-row:last-child {
  margin-bottom: 0;
}

.cap-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.cap-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.cap-count {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

#capMerchantCount {
  color: var(--success, #10b981);
}

#capFleetCount {
  color: var(--accent, #ff6a1a);
}

/* Track */
.cap-track {
  width: 100%;
  height: 10px;
  background: var(--bg-surface-3, rgba(255,255,255,0.07));
  border-radius: 999px;
  overflow: hidden;
}

/* Fill bars (Green for Online Shop / Merchant, Orange for Fleet Operator) */
.cap-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.cap-fill-merchant {
  background: linear-gradient(90deg, #10b981, #34d399);
  box-shadow: 0 0 8px rgba(16,185,129,0.35);
}

.cap-fill-fleet {
  background: linear-gradient(90deg, #ff6a1a, #ff8c4a);
  box-shadow: 0 0 8px rgba(255,106,26,0.4);
}

/* Footer row */
.cap-row-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.cap-info {
  font-size: 11px;
  color: var(--text-faint);
}

.cap-left {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--success, #10b981);
  background: var(--success-soft, rgba(16,185,129,0.12));
  padding: 2px 8px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#capFleetLeft {
  color: var(--accent, #ff6a1a);
  background: var(--accent-glow, rgba(255,106,26,0.15));
}

/* Near-full warning: turn cap-left orange when ≤5 slots left */
.cap-left.cap-urgent {
  color: var(--accent);
  background: var(--accent-glow);
}

/* Light theme overrides */
[data-theme="light"] .capacity-board {
  background: #fff;
  border-color: rgba(0,0,0,0.09);
}
[data-theme="light"] .capacity-board::before {
  background: linear-gradient(135deg, rgba(255,106,26,0.04) 0%, transparent 60%);
}
[data-theme="light"] .cap-track {
  background: rgba(0,0,0,0.07);
}

@media (max-width: 580px) {
  .capacity-board {
    padding: 16px;
    margin-bottom: 22px;
  }
  .cap-row-foot {
    flex-wrap: wrap;
    gap: 6px;
  }
}

/* ==========================================================================
   RESPONSIVE POLISH & ACCESSIBILITY
   ========================================================================== */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.beta-nav {
  gap: 18px;
}

.role-card,
.capacity-board,
.form-panel {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.role-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow), var(--shadow-card);
}

.field-input,
.field-select {
  min-height: 46px;
}

@media (max-width: 640px) {
  .beta-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px 10px;
    padding: 14px max(18px, env(safe-area-inset-right, 0px)) 10px max(18px, env(safe-area-inset-left, 0px));
  }

  .nav-brand {
    gap: 10px;
  }

  .nav-logo {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
  }

  .brand-title {
    font-size: clamp(18px, 5vw, 21px);
    white-space: nowrap;
  }

  .nav-badge {
    display: table;
    margin: 5px 0 0;
    font-size: 9px;
  }

  .nav-actions {
    gap: 8px;
  }

  .theme-toggle-btn {
    padding: 8px 10px;
    white-space: nowrap;
  }

  .link-sign-in {
    padding: 8px 2px;
    font-size: 12.5px;
  }

  .beta-container {
    margin: 18px auto 40px;
    padding: 0 16px;
  }

  .beta-hero {
    margin-bottom: 24px;
  }

  .hero-pill {
    max-width: 100%;
    font-size: 11px;
    line-height: 1.4;
    text-align: left;
  }

  .beta-hero h1 {
    font-size: clamp(26px, 8vw, 34px);
  }

  .beta-hero p.subtitle {
    font-size: 14px;
    line-height: 1.6;
  }

  .capacity-board {
    padding: 17px 16px;
    margin-bottom: 20px;
  }

  .capacity-board-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 15px;
  }

  .capacity-board-title {
    font-size: 11px;
    letter-spacing: 0.055em;
  }

  .capacity-board-sub {
    padding-left: 15px;
    font-size: 11px;
  }

  .cap-row-top {
    align-items: flex-start;
    gap: 8px;
  }

  .cap-label,
  .cap-count {
    font-size: 11.5px;
  }

  .cap-row-foot {
    align-items: flex-start;
  }

  .cap-info {
    flex: 1 1 200px;
    font-size: 10.5px;
    line-height: 1.45;
  }

  .role-grid {
    gap: 14px;
  }

  .role-card {
    padding: 21px 18px;
    border-radius: 18px;
  }

  .role-card-badge {
    max-width: 100%;
    font-size: 9.5px;
    line-height: 1.4;
  }

  .role-card h2 {
    font-size: 20px;
  }

  .role-card p.role-desc {
    font-size: 13px;
  }

  .perks-list {
    gap: 10px;
    font-size: 12px;
  }

  .perks-list li {
    align-items: flex-start;
    line-height: 1.5;
  }

  .perks-list svg {
    margin-top: 2px;
  }

  .form-panel {
    padding: 23px 17px;
    border-radius: 18px;
  }

  .form-panel-header h2 {
    font-size: 21px;
  }

  .form-panel-header p {
    line-height: 1.6;
  }

  .fleet-base-note {
    flex-wrap: wrap;
    padding: 13px;
  }

  .fleet-base-note > div {
    flex-basis: calc(100% - 54px);
  }

  .fleet-base-tag {
    margin-left: 50px;
  }

  .toast-stack {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .toast {
    font-size: 12.5px;
  }
}

@media (max-width: 380px) {
  .beta-nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .nav-actions {
    justify-content: flex-end;
  }

  .nav-logo {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .capacity-board {
    padding-inline: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
