/* ============================================================
   Vision Bleu LED — Form Design System
   ============================================================ */

/* --- Custom Properties --- */
:root {
  --primary: #1B3A5C;
  --accent: #00A3FF;
  --accent-hover: #33B5FF;
  --bg-dark: #0D1B2A;
  --card-bg: #152238;
  --text-primary: #FFFFFF;
  --text-secondary: #B0C4D8;
  --success: #00C853;
  --warm: #FFB74D;
  --error: #FF6B6B;
  --input-bg: #1C2D42;
  --input-border: #2A3F5A;
  --radius: 8px;
  --font-body: 'DM Sans', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Sora', -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* --- Reset & Global --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-dark);
  font-family: var(--font-body);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Page Wrapper --- */
.page-wrapper {
  min-height: 100vh;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* --- Form Card --- */
.form-card {
  position: relative;
  width: 100%;
  max-width: 600px;
  background-color: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 24px 16px 24px;
  margin: 0 auto;
}

/* LED glow band — top edge only */
.form-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  box-shadow:
    0 0 8px rgba(0, 163, 255, 0.6),
    0 0 20px rgba(0, 163, 255, 0.3);
  border-radius: 12px 12px 0 0;
  z-index: 1;
}

/* --- Language Toggle --- */
.lang-toggle {
  position: absolute;
  top: 12px;
  right: 16px;
  display: flex;
  gap: 4px;
  z-index: 2;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  padding: 10px 14px;
  min-height: 44px;
  cursor: pointer;
  transition: color 200ms ease;
}

.lang-btn:hover {
  color: var(--text-primary);
}

.lang-btn.active {
  color: var(--accent);
  font-weight: 600;
}

/* --- Logo --- */
.logo-container {
  position: absolute;
  top: 12px;
  left: 16px;
  z-index: 2;
  margin: 0;
  padding: 0;
}

.logo-img {
  display: block;
  height: 28px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

.logo-img + .logo-fallback {
  display: none;
}

.logo-placeholder {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1.5px;
}

/* --- Header Text --- */
.header-text {
  text-align: center;
  margin-top: 44px;
  margin-bottom: 12px;
}

.header-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.03em;
  margin: 0 0 8px;
  line-height: 1.3;
}

.header-title .accent-word {
  color: #00D4FF;
  text-shadow:
    0 0 7px rgba(0, 212, 255, 0.7),
    0 0 20px rgba(0, 212, 255, 0.5),
    0 0 40px rgba(0, 163, 255, 0.3);
  letter-spacing: 0.03em;
}

@media (prefers-reduced-motion: no-preference) {
  .header-title .accent-word {
    animation: neon-pulse 2s ease-in-out infinite alternate;
  }
}

.header-subtitle {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 300;
  color: var(--text-secondary);
  margin: 0 0 16px;
  line-height: 1.4;
}

/* --- Mini Contest Rules (floating text, no container) --- */
.mini-rules {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--input-border);
  background-image: linear-gradient(to right, transparent, rgba(0, 163, 255, 0.15), transparent);
  background-size: 100% 1px;
  background-position: bottom;
  background-repeat: no-repeat;
}

.rules-preview {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 4px;
  line-height: 1.4;
}

.rules-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-family: var(--font-body);
  color: var(--text-secondary);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 20px;
  text-decoration: none;
  cursor: pointer;
  padding: 6px 16px;
  min-height: 36px;
  margin-top: 6px;
  transition: border-color 0.2s, color 0.2s;
}

.rules-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.rules-full {
  max-height: 0;
  overflow: hidden;
  transition: max-height 400ms ease;
}

.rules-full.expanded {
  max-height: 500px;
}

.rules-full p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 8px 0 0;
  text-align: left;
}

.rules-link {
  color: var(--accent);
  text-decoration: underline;
}

.rules-link:hover {
  color: var(--accent-hover);
}

/* --- Progress Bar --- */
.progress-bar {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-bottom: 24px;
  height: 60px;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  flex-shrink: 0;
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--input-border);
  background: transparent;
  transition: all 300ms ease;
}

.step-number {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.step-check {
  font-size: 16px;
  color: var(--text-primary);
}

/* Active step */
.progress-step.active .step-circle {
  background-color: var(--accent);
  border-color: var(--accent);
}

.progress-step.active .step-number {
  color: var(--text-primary);
}

.progress-step.active .step-label {
  color: var(--text-primary);
}

/* Completed step */
.progress-step.completed .step-circle {
  background-color: var(--success);
  border-color: var(--success);
}

.progress-step.completed .step-number {
  display: none;
}

.progress-step.completed .step-check {
  display: inline !important;
}

.step-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
}

/* Progress connector line */
.progress-connector {
  flex-grow: 1;
  height: 2px;
  background-color: var(--input-border);
  align-self: center;
  margin-top: -14px;
  min-width: 20px;
  transition: background-color 300ms ease;
}

.progress-connector.completed {
  background-color: var(--success);
}

/* --- Form Steps --- */
.form-steps {
  position: relative;
  /* overflow set to hidden dynamically during slide transitions via JS,
     visible otherwise so btn-submit glow renders on all sides */
}

.form-step {
  display: none;
}

.form-step.active {
  display: block;
}

/* (Slide transition classes removed — single-page form) */

/* --- Step Headings --- */
.step-heading {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin: 0 0 16px;
  line-height: 1.3;
}

/* --- Navigation Buttons --- */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  gap: 16px;
}

.nav-buttons--end {
  justify-content: flex-end;
}

/* Primary button (Next / Submit) */
.btn-primary {
  background-color: var(--accent);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  height: 48px;
  padding: 0 32px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow:
    0 0 12px rgba(0, 163, 255, 0.5),
    0 0 24px rgba(0, 163, 255, 0.25);
  transition: all 200ms ease;
}

/* Full-width when alone (Step 1) */
.nav-buttons--end .btn-primary {
  width: 100%;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  box-shadow:
    0 0 16px rgba(0, 163, 255, 0.7),
    0 0 32px rgba(0, 163, 255, 0.35);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.4;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-primary:disabled:hover {
  background-color: var(--accent);
  box-shadow: none;
}

/* Secondary button (Back) */
.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  height: 48px;
  padding: 0 16px;
  border: none;
  cursor: pointer;
  transition: color 200ms ease;
  white-space: nowrap;
}

.btn-secondary:hover {
  color: var(--text-primary);
}

/* --- Input Styles (pre-built for Phase 2) --- */
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-helper {
  font-size: 13px;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.form-helper.warning {
  color: #FF8A8A;
  font-style: normal;
  font-weight: 600;
}

.form-helper.warning .warning-cta {
  color: #FFFFFF;
  font-weight: 400;
}

.form-input,
.form-select {
  width: 100%;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 16px;
  font-family: var(--font-body);
  color: var(--text-primary);
  transition: border-color 200ms ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-input:focus,
.form-select:focus {
  border-color: var(--accent);
}

/* Error state */
.form-input.input-error,
.form-select.input-error {
  border-color: var(--error);
  animation: shake 200ms ease;
}

.error-message {
  font-size: 13px;
  color: var(--error);
  margin-top: 4px;
  animation: fadeIn 150ms ease;
}

/* Email domain quick-tap buttons */
.email-domain-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.email-domain-btn {
  background: var(--input-bg);
  border: 1px solid rgba(0, 163, 255, 0.3);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 15px;
  font-family: var(--font-body);
  padding: 10px 8px;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
  box-shadow: 0 0 8px rgba(0, 163, 255, 0.15), inset 0 0 4px rgba(0, 163, 255, 0.05);
}

.email-domain-btn:hover,
.email-domain-btn:active {
  background: var(--primary);
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 12px rgba(0, 163, 255, 0.35), inset 0 0 6px rgba(0, 163, 255, 0.1);
}

.email-domain-buttons.hidden {
  display: none;
}

/* Field group spacing (tighter for simplified single-step form) */
.field-group {
  margin-bottom: 16px;
}

/* Question group spacing */
.question-group {
  margin-bottom: 20px;
}

.question-group:last-child {
  margin-bottom: 0;
}

/* --- Single-select Cards (Phase 2 pre-built) --- */
.select-grid {
  display: grid;
  gap: 10px;
}

.select-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.select-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.select-card {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 8px;
  min-height: 44px;
  background: transparent;
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 200ms ease;
}

.select-card:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.select-card.selected {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 8px rgba(0, 163, 255, 0.4);
}

/* Multi-select card (property type -- can select multiple) */
.select-card--multi.selected {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 8px rgba(0, 163, 255, 0.4);
}

/* --- Multi-select Pills (Phase 2 pre-built) --- */
.pill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pill-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 10px 8px;
  min-height: 44px;
  background: transparent;
  border: 1px solid var(--input-border);
  border-radius: 24px;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 200ms ease;
}

.pill-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.pill-btn .pill-check {
  display: none;
  font-size: 12px;
}

.pill-btn.selected {
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 8px rgba(0, 163, 255, 0.4);
}

.pill-btn.selected .pill-check {
  display: inline;
}

.pill-btn .pill-text {
  white-space: normal;
  word-break: break-word;
}

/* --- Checkbox Styling (Phase 2 pre-built) --- */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 8px 0;
  min-height: 44px;
}

.checkbox-row:active {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.checkbox-row + .checkbox-row {
  margin-top: 16px;
}

.checkbox-box {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: 2px solid rgba(0, 163, 255, 0.4);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms ease;
  margin-top: 2px;
  box-shadow: 0 0 6px rgba(0, 163, 255, 0.15);
  background: rgba(0, 163, 255, 0.05);
}

.checkbox-box .check-icon {
  display: none;
  color: var(--text-primary);
  font-size: 18px;
}

.checkbox-row.checked .checkbox-box {
  background-color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(0, 163, 255, 0.4);
}

.checkbox-row.checked .checkbox-box .check-icon {
  display: block;
}

.checkbox-text {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.5;
}

.checkbox-text a {
  color: var(--accent);
  text-decoration: underline;
  pointer-events: auto;
}

.checkbox-text a:hover {
  color: var(--accent-hover);
}

/* --- Internal Notes Toggle (phone only) --- */
.internal-notes-group {
  margin-top: 20px;
}

.internal-notes-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  transition: all 200ms ease;
}

.internal-notes-toggle:active {
  background: rgba(255, 255, 255, 0.1);
}

.internal-notes-toggle-icon {
  font-size: 16px;
}

.internal-notes-chevron {
  margin-left: auto;
  font-size: 10px;
  transition: transform 200ms ease;
}

.internal-notes-chevron.open {
  transform: rotate(180deg);
}

.internal-notes-content {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 300ms ease, opacity 200ms ease, margin 200ms ease;
  margin-top: 0;
}

.internal-notes-content.visible {
  max-height: 200px;
  opacity: 1;
  margin-top: 10px;
}

.internal-notes-textarea {
  resize: vertical;
  min-height: 60px;
  font-size: 14px;
  line-height: 1.5;
}

/* --- Submit Hint (disabled submit feedback) --- */
.submit-hint {
  text-align: center;
  font-size: 13px;
  color: var(--error);
  margin-top: 8px;
  animation: fadeIn 150ms ease;
}

.btn-submit.shake {
  animation: shake 200ms ease;
}

/* --- Submit Button Loading State --- */
.btn-submit--loading {
  opacity: 0.7;
  pointer-events: none;
}

/* --- Submit Error Banner (phone mode retry) --- */
.submit-error-text {
  font-size: 13px;
  color: var(--error);
  margin: 0 0 8px;
  text-align: center;
  animation: fadeIn 150ms ease;
}

/* Submit button error/retry state — replaces separate btn-retry */
.btn-submit--error {
  background: transparent;
  border: 1px solid var(--error);
  color: var(--error);
  box-shadow: none;
  animation: fadeIn 150ms ease;
}

.btn-submit--error:hover {
  background-color: var(--error);
  color: var(--text-primary);
}

/* --- Skip / Toggle Links (Phase 2 pre-built) --- */
.toggle-link {
  display: block;
  font-size: 13px;
  color: var(--accent);
  text-decoration: underline;
  text-align: right;
  cursor: pointer;
  padding: 8px 0;
  min-height: 44px;
  line-height: 28px;
}

.toggle-link:hover {
  color: var(--accent-hover);
}

/* --- Address Mode Toggle Buttons --- */
.address-toggle-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.address-toggle-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--text-secondary);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  min-height: 44px;
  transition: border-color 0.2s, color 0.2s;
}

.address-toggle-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.address-toggle-btn--full {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
}

/* --- Loading Spinner (Phase 4 pre-built) --- */
.btn-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

.form-loading {
  pointer-events: none;
  opacity: 0.7;
}

/* --- Google Autocomplete Dropdown (Phase 2 pre-built) --- */
.pac-container {
  background-color: var(--card-bg) !important;
  border: 1px solid var(--input-border) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
  margin-top: 4px !important;
  font-family: var(--font-body) !important;
}

/* Hide pac-container when offline (prevents invisible overlay blocking clicks) */
.pac-container.pac-hidden-offline {
  display: none !important;
  pointer-events: none !important;
}

.pac-item {
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
  padding: 12px !important;
  color: var(--text-secondary) !important;
  cursor: pointer !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
}

.pac-item:first-child {
  border-top: none !important;
}

.pac-item:hover,
.pac-item-selected {
  background-color: var(--input-bg) !important;
}

.pac-item-query {
  color: var(--text-primary) !important;
  font-weight: 500 !important;
}

.pac-matched {
  color: var(--accent) !important;
}

.pac-icon {
  display: none !important;
}

/* --- Confirmation Screen --- */

.confirmation-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 300px;
  padding: 48px 24px 32px;
  opacity: 0;
  transition: opacity 200ms ease;
}

.confirmation-screen.visible {
  opacity: 1;
}

/* Loading spinner */
.confirmation-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
}

.confirmation-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--accent);
  animation: spin 600ms linear infinite;
}

/* Confirmation content */
.confirmation-content {
  text-align: center;
  max-width: 500px;
  width: 100%;
  opacity: 0;
  transition: opacity 200ms ease;
}

.confirmation-content.visible {
  opacity: 1;
}

/* Emoji */
.confirmation-emoji {
  font-size: 40px;
  margin-bottom: 12px;
  line-height: 1;
}

/* Heading */
.confirmation-heading {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}

/* Body */
.confirmation-body {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 16px;
}

/* Neon glow on FREE / GRATUITE */
.neon-free {
  color: #00D4FF;
  font-weight: 700;
  text-shadow:
    0 0 7px rgba(0, 212, 255, 0.7),
    0 0 20px rgba(0, 212, 255, 0.5),
    0 0 40px rgba(0, 163, 255, 0.3);
  letter-spacing: 0.05em;
}

@media (prefers-reduced-motion: no-preference) {
  .neon-free {
    animation: neon-pulse 2s ease-in-out infinite alternate;
  }
}

@keyframes neon-pulse {
  from { text-shadow: 0 0 7px rgba(0, 212, 255, 0.7), 0 0 20px rgba(0, 212, 255, 0.5), 0 0 40px rgba(0, 163, 255, 0.3); }
  to   { text-shadow: 0 0 10px rgba(0, 212, 255, 0.9), 0 0 30px rgba(0, 212, 255, 0.7), 0 0 60px rgba(0, 163, 255, 0.5); }
}

/* Divider between confirmation text and booking section */
.confirmation-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 20px 0;
}

/* Qualified state — green radial background */
.confirmation-screen.qualified {
  background: radial-gradient(ellipse at center, rgba(0, 200, 83, 0.12) 0%, transparent 70%);
}

/* Bounce animation on qualified emoji */
@keyframes gentleBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.confirmation-screen.qualified .confirmation-emoji {
  animation: gentleBounce 2s ease-in-out infinite;
}

/* Green glow on form card when qualified */
.form-card--qualified::before {
  background: var(--success);
  box-shadow: 0 0 12px rgba(0, 200, 83, 0.7), 0 0 30px rgba(0, 200, 83, 0.4);
}

.form-card--qualified {
  border-color: rgba(0, 200, 83, 0.2);
  box-shadow: 0 0 40px rgba(0, 200, 83, 0.15);
}

/* Not-qualified state — amber radial background */
.confirmation-screen.not-qualified {
  background: radial-gradient(ellipse at center, rgba(255, 183, 77, 0.10) 0%, transparent 70%);
}

/* Amber glow on form card when not-qualified */
.form-card--not-qualified::before {
  background: var(--warm);
  box-shadow: 0 0 12px rgba(255, 183, 77, 0.7), 0 0 30px rgba(255, 183, 77, 0.4);
}

.form-card--not-qualified {
  border-color: rgba(255, 183, 77, 0.2);
  box-shadow: 0 0 40px rgba(255, 183, 77, 0.12);
}

/* Card expansion classes (for Plan 02 animation) */
.form-card--expanded {
  max-width: 100%;
  min-height: auto;
  transition: box-shadow 400ms ease, border-color 400ms ease;
}

@media (max-width: 639px) {
  .form-card--expanded {
    min-height: auto;
  }
}

/* Progress bar check pulse animation */
@keyframes checkPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.progress-step.just-completed .step-circle {
  animation: checkPulse 400ms ease;
}

/* Form content fade-out for submit transition (kept for confirmation transition) */
.form-step--fade-out {
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}

/* --- Tablet Countdown Button (Phase 5 Plan 02) --- */
.countdown-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 300px;
  height: 52px;
  margin-top: 24px;
  background: transparent;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  z-index: 1;
}

.countdown-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  background: var(--accent);
  z-index: -1;
  transition: width 30s linear;
}

.countdown-btn.draining::before {
  width: 0%;
}

.countdown-btn:active {
  opacity: 0.8;
  transform: scale(0.98);
}

/* --- Tablet Reset Button (always visible on confirmation screen) --- */
.tablet-reset-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 200ms ease, transform 100ms ease;
}
.tablet-reset-btn:active {
  background: var(--accent);
  color: #fff;
  transform: scale(0.96);
}

/* Form card reset fade transition */
.form-card--resetting {
  opacity: 0;
  transition: opacity 200ms ease;
}

/* --- Status Indicator Pill (Phase 5 Plan 02) --- */
.status-indicator {
  position: fixed;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(21, 34, 56, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  z-index: 100;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot--online {
  background-color: var(--success);
}

.status-dot--queued {
  background-color: var(--warm);
}

.status-text {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-body);
  white-space: nowrap;
}

.status-indicator--synced {
  animation: syncPulse 600ms ease;
}

@keyframes syncPulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 8px rgba(0, 200, 83, 0.5); }
}

/* Body lock for modals */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* --- Legal Modal (Phase 5 Plan 02) --- */
.legal-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 150ms ease;
}

.legal-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
}

.legal-modal-card {
  position: relative;
  width: 90vw;
  height: 80vh;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 1;
}

.legal-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.legal-modal-close:hover {
  background: rgba(0, 0, 0, 0.5);
}

.legal-modal-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* --- Utility Classes --- */
.hidden {
  display: none !important;
}

/* --- Animations --- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Responsive --- */
@media (min-width: 640px) {
  .page-wrapper {
    padding: 32px 16px;
    align-items: flex-start;
  }

  .form-card {
    max-width: 600px;
    padding: 32px;
    margin: 0 auto;
  }

  .header-title {
    font-size: 28px;
  }

  .header-subtitle {
    font-size: 16px;
    margin-bottom: 16px;
  }

  .logo-container {
    top: 16px;
    left: 24px;
  }

  .logo-img {
    height: 32px;
    max-width: 140px;
  }

  .lang-toggle {
    top: 16px;
    right: 24px;
  }
}

/* Ensure tap targets on mobile */
@media (max-width: 639px) {
  .form-card {
    border-radius: 12px;
  }

  .pill-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Photo Upload ────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.optional-tag {
  font-weight: 400;
  color: #B0C4D8;
  font-size: 0.85em;
}

.upload-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  border: 2px dashed #2A3F5A;
  border-radius: 8px;
  background: transparent;
  color: #B0C4D8;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.upload-trigger:hover,
.upload-trigger:focus-visible {
  border-color: #00A3FF;
  color: #FFFFFF;
}

.upload-trigger-icon {
  font-size: 20px;
}

/* Thumbnail grid */
.upload-thumbnails {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 380px) {
  .upload-thumbnails {
    grid-template-columns: repeat(2, 1fr);
  }
}

.upload-thumb {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  background: #1C2D42;
}

.upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* HEIC fallback placeholder */
.upload-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 13px;
  color: #B0C4D8;
  text-align: center;
  padding: 8px;
}

/* Success badge (green checkmark) */
.upload-thumb-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #00C853;
  color: #FFFFFF;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.upload-thumb--done .upload-thumb-badge {
  opacity: 1;
}

/* Remove button (x) */
.upload-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #FFFFFF;
  border: none;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.upload-thumb-remove:hover {
  background: #FF5252;
}

/* Progress bar overlay */
.upload-thumb-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.4);
}

.upload-thumb-progress-bar {
  height: 100%;
  background: #00A3FF;
  width: 0%;
  transition: width 0.15s ease;
}

.upload-thumb--done .upload-thumb-progress {
  display: none;
}

/* Error state on thumbnail */
.upload-thumb--error {
  border: 2px solid #FF5252;
}

.upload-thumb-retry {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: #FF5252;
  color: #FFFFFF;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  padding: 3px 10px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}

.upload-thumb-retry:hover {
  background: #E04848;
}

/* Counter and add-more */
.upload-counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 13px;
  color: #B0C4D8;
}

.upload-add-more {
  background: none;
  border: 1px solid #2A3F5A;
  color: #00A3FF;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 13px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s;
}

.upload-add-more:hover {
  border-color: #00A3FF;
}

/* Pending message */
.upload-pending-msg {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(255, 183, 77, 0.12);
  border: 1px solid rgba(255, 183, 77, 0.3);
  border-radius: 6px;
  color: #FFB74D;
  font-size: 13px;
  text-align: center;
}

/* ── Booking Elements (inside confirmation) ─────────────── */

.booking-subheading {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 20px;
}

/* Closer selector -- top of form, internal tracking */
.closer-selector-group {
  margin-bottom: 20px;
}

.closer-selector-grid {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.closer-selector-grid--compact {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  justify-content: center;
}

.closer-selector-btn {
  flex: 1;
  padding: 12px 8px;
  background: var(--input-bg);
  border: 2px solid var(--input-border);
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease, transform 100ms ease;
  -webkit-tap-highlight-color: transparent;
}

.closer-selector-grid--compact .closer-selector-btn {
  padding: 8px 4px;
  font-size: 13px;
  min-width: 0;
}

.closer-selector-btn.selected {
  border-color: var(--accent);
  background: rgba(0, 102, 255, 0.08);
}

.closer-selector-btn:active {
  transform: scale(0.97);
}

/* Closer cards -- horizontal scroll row */
.closer-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 4px;
  -webkit-overflow-scrolling: touch;
  justify-content: center;
  flex-wrap: wrap;
}

.closer-card {
  flex: 0 0 auto;
  width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: var(--input-bg);
  border: 2px solid var(--input-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 200ms ease, transform 100ms ease;
  -webkit-tap-highlight-color: transparent;
}

.closer-card.selected {
  border-color: var(--accent);
}

.closer-card:active {
  transform: scale(0.97);
}

.closer-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--input-border);
}

/* Placeholder silhouette for missing photos */
.closer-photo-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--input-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--text-secondary);
}

.closer-name {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.2;
}

.closer-title {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.3;
}

/* Appointment type toggle */
.booking-type-label {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin: 20px 0 12px;
}

.appointment-type-toggle {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.type-pill {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--input-bg);
  border: 2px solid var(--input-border);
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  transition: border-color 200ms ease, color 200ms ease, background-color 200ms ease;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.type-pill.selected {
  border-color: var(--accent);
  color: var(--text-primary);
  background: rgba(0, 163, 255, 0.1);
}

.type-pill:active {
  transform: scale(0.97);
}

/* Booking hint above calendar */
.booking-hint {
  text-align: center;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--accent);
  margin: 12px 0 8px;
  letter-spacing: 0.02em;
}

/* Calendar embed container */
.calendar-container {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background-color: var(--card-bg);
  border: 1px solid var(--input-border);
  margin: 20px 0 16px;
  position: relative;
  min-height: 550px;
}

.booking-iframe {
  width: 100%;
  height: 650px;
  border: none;
  display: block;
}

/* Loading overlay inside calendar container */
.calendar-loading {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  z-index: 2;
}

.calendar-loading.hidden {
  display: none;
}

/* Done button -- ghost/secondary style to not compete with iframe CTA */
.booking-done {
  display: block;
  width: 100%;
  padding: 14px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: rgba(76, 175, 130, 0.25);
  border: 1px solid rgba(76, 175, 130, 0.5);
  border-radius: var(--radius);
  cursor: pointer;
  margin-top: 16px;
  transition: background 0.2s, border-color 0.2s, transform 100ms ease;
}

.booking-done:hover {
  background: rgba(76, 175, 130, 0.35);
  border-color: rgba(76, 175, 130, 0.7);
}

.booking-done:active {
  transform: scale(0.98);
}

/* Skip link — subtle fallback below Continue */
.booking-skip {
  display: block;
  text-align: right;
  font-family: var(--font-body);
  font-size: 12px;
  color: #6B7A8D;
  text-decoration: none;
  margin-top: 8px;
  padding-right: 4px;
  transition: color 0.2s;
}
.booking-skip:hover {
  color: var(--text-secondary);
}

/* Offline message on booking section */
.booking-offline-msg {
  text-align: center;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--warm);
  padding: 20px;
}

/* Thank you state (after booking is done) */
.booking-thank-you {
  text-align: center;
  padding: 24px 0;
  animation: fadeIn 300ms ease;
}

.booking-thank-you h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.booking-thank-you p {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Mobile adjustments */
@media (max-width: 639px) {
  .booking-iframe {
    height: 700px; /* Taller on mobile for GHL widget content */
  }
  .closer-card {
    width: 100px;
  }
  .closer-photo,
  .closer-photo-placeholder {
    width: 56px;
    height: 56px;
  }
  .closer-name {
    font-size: 13px;
  }
}
