/* ============================================
   CSS VARIABLES & THEME
   ============================================ */
:root {
  /* Colors - Modern Indigo/Slate */
  --primary: #4F46E5;
  --primary-light: #818CF8;
  --primary-dark: #3730A3;
  --primary-bg: #EEF2FF;

  /* Neutrals - Slate tones */
  --white: #FFFFFF;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;

  /* Semantic */
  --success: #059669;
  --success-bg: #ECFDF5;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --error: #EF4444;
  --error-bg: #FEF2F2;
  --info: #3B82F6;
  --info-bg: #EFF6FF;

  /* Vipps - darkened for WCAG AA contrast with white text */
  --vipps: #FF5B24;
  --vipps-dark: #E84D1A;

  /* Layout */
  --max-width: 520px;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;

  /* Shadows - Sharper */
  --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 6px -1px rgba(15,23,42,0.08), 0 2px 4px -1px rgba(15,23,42,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15,23,42,0.08), 0 4px 6px -2px rgba(15,23,42,0.04);
  --shadow-focus: 0 0 0 3px rgba(79, 70, 229, 0.15);

  /* Transitions */
  --transition-fast: 0.12s ease;
  --transition-normal: 0.2s ease;
  --transition-slow: 0.3s ease;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Dark mode */
[data-theme="dark"] {
  --primary-bg: #1E1B4B;
  --white: #0F172A;
  --gray-50: #1E293B;
  --gray-100: #1E293B;
  --gray-200: #334155;
  --gray-300: #475569;
  --gray-400: #64748B;
  --gray-500: #94A3B8;
  --gray-600: #CBD5E1;
  --gray-700: #E2E8F0;
  --gray-800: #F1F5F9;
  --gray-900: #F8FAFC;
  --success-bg: #064E3B;
  --warning-bg: #451A03;
  --error-bg: #450A0A;
  --info-bg: #1E3A8A;
}

/* ============================================
   BASE RESET
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
}

/* ============================================
   LAYOUT
   ============================================ */
.booking-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.booking-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 0.75rem;
  padding-bottom: 100px;
}

/* ============================================
   HEADER
   ============================================ */
.booking-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0.875rem 1rem;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin: -0.5rem;
  min-height: 44px; /* WCAG touch target */
  background: none;
  border: none;
  color: var(--gray-600);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.back-btn:hover {
  color: var(--gray-900);
  background: var(--gray-100);
}

.back-btn svg {
  width: 20px;
  height: 20px;
}

.logo {
  background: #000;
  border-radius: var(--radius-xs);
  padding: 4px 8px;
  display: flex;
  align-items: center;
}
.logo img {
  height: 28px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
}

.help-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  margin: -0.5rem;
  min-height: 44px; /* WCAG touch target */
  color: var(--gray-600); /* WCAG AA: improved from gray-500 */
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.help-link:hover {
  color: var(--gray-700);
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-wrapper {
  padding: 1rem;
  background: var(--white);
}

.progress-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.progress-bar {
  display: flex;
  gap: 4px;
}

.progress-segment {
  flex: 1;
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  transition: background var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.progress-segment.completed {
  background: var(--primary);
}

.progress-segment.active {
  background: var(--primary-light);
  animation: progressPulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(79, 70, 229, 0.4);
}

@keyframes progressPulse {
  0%, 100% {
    opacity: 1;
    transform: scaleY(1);
  }
  50% {
    opacity: 0.7;
    transform: scaleY(1.3);
  }
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.progress-label {
  font-size: 0.75rem; /* 12px - improved from 11px for better readability */
  color: var(--gray-500); /* WCAG AA: improved from gray-400 */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  transition: color var(--transition-fast), font-weight var(--transition-fast);
}

.progress-label.active {
  color: var(--primary);
  font-weight: 700;
}

.progress-label.completed {
  color: var(--primary-dark);
  font-weight: 600;
}

/* ============================================
   STEP SECTIONS
   ============================================ */
.step-section {
  display: none;
  padding-top: 1.5rem;
  position: relative;
}

#step1LoadingOverlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  min-height: 200px;
}

.data-change-notification {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--warning-bg, #FEF3C7);
  border: 1px solid var(--warning, #F59E0B);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  max-width: 90%;
  width: 400px;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.data-change-title { font-weight: 600; margin-bottom: 0.5rem; }
.data-change-title i { color: var(--warning, #F59E0B); }
.data-change-list { margin: 0; padding-left: 1.25rem; font-size: 0.875rem; line-height: 1.6; }
.data-change-notification .btn { margin-top: 0.75rem; }

.step-section.active {
  display: block;
  animation: fadeSlideIn 0.4s ease;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  margin-bottom: 0.375rem;
  text-align: center;
}

.section-subtitle {
  font-size: 0.9375rem;
  color: #5a6779; /* WCAG AA: 5.0:1 contrast on gray-50 */
  margin-bottom: 1.25rem;
  text-align: center;
}

.subsection-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

.subsection-title:first-child {
  margin-top: 0;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
  border-color: var(--gray-300);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.card-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-bg);
  border-radius: var(--radius-sm);
  font-size: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
}

.card-description {
  font-size: 0.875rem;
  color: var(--gray-500);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group {
  margin-bottom: 1rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.375rem;
}

.form-label .required {
  color: var(--error);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--gray-900);
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
}

.form-input[type="date"] {
  -webkit-appearance: auto;
  appearance: auto;
}

.form-input:hover {
  border-color: var(--gray-400);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

.form-input.field-error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.field-error-msg {
  color: var(--error);
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.vipps-locked-wrapper {
  position: relative;
}
.vipps-locked-wrapper .form-input {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}
.vipps-locked-wrapper .vipps-unlock {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
}
.vipps-locked-wrapper .vipps-unlock:hover {
  text-decoration: underline;
}

/* WCAG 2.1: Focus visible styles for keyboard navigation */
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.toggle-btn:focus-visible,
.category-card:focus-visible,
.unit-card:focus-visible,
.addon-card:focus-visible,
.checkbox-wrapper:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.form-input::placeholder {
  color: var(--gray-500); /* WCAG AA: 4.54:1 contrast */
}

.form-input:disabled {
  background: var(--gray-100);
  color: var(--gray-500);
  cursor: not-allowed;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-top: 0.375rem;
}

.form-error {
  font-size: 0.8125rem;
  color: var(--error);
  margin-top: 0.375rem;
}

/* Input with icon */
.input-wrapper {
  position: relative;
}

.input-wrapper .form-input {
  padding-right: 2.75rem;
}

.input-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500); /* WCAG AA: improved contrast */
}
button.input-icon {
  pointer-events: auto;
  z-index: 1;
}

/* Phone input */
.phone-input-wrapper {
  display: flex;
}

.phone-prefix {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.875rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--gray-600);
  font-size: 0.9375rem;
  font-weight: 500;
}

.phone-input-wrapper .form-input {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  flex: 1;
}

/* Form rows */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-row.full {
  grid-template-columns: 1fr;
}

.form-row.postal-city {
  grid-template-columns: 1fr 2fr;
}

/* Select */
.form-select {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--gray-900);
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 1rem center;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-appearance: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-select:hover {
  border-color: var(--gray-400);
}

.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

/* Toggle buttons */
.toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toggle-btn:hover {
  border-color: var(--gray-300);
  background: var(--gray-50);
}

.toggle-btn.active {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
}

.toggle-btn i {
  font-size: 1rem;
}

/* Checkbox */
.checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.checkbox-wrapper:hover {
  border-color: var(--gray-300);
}

.checkbox-wrapper.checked {
  background: var(--primary-bg);
  border-color: var(--primary);
}

.checkbox-wrapper input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-wrapper .checkbox-label {
  font-size: 0.9375rem;
  color: var(--gray-700);
  line-height: 1.4;
}

.checkbox-wrapper .checkbox-label a {
  color: var(--primary);
  text-decoration: underline;
}

/* ============================================
   STEP 1 LAYOUT
   ============================================ */
.step1-header {
  margin-bottom: 1rem;
}

.step1-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.coupon-input-wrapper {
  display: flex;
  gap: 0.5rem;
}

.coupon-input-wrapper .form-input {
  flex: 1;
}

.step1-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step1-categories {
  order: 1;
}

.step1-units {
  order: 2;
}

.step1-panel {
  background: transparent;
  border-radius: var(--radius-md);
  padding: 0;
}

.step1-panel .subsection-title {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.step1-footer {
  text-align: center;
  margin-top: 1rem;
}

/* ============================================
   CATEGORY LIST (Step 1)
   ============================================ */
.category-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.category-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.category-card:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-sm);
}

.category-card.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.category-card.unavailable {
  opacity: 0.6;
  cursor: pointer;
}

.category-status {
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.category-status.status-limited {
  color: #B45309;
}

.category-status.status-waitlist {
  color: var(--primary-dark);
  font-weight: 600;
  background: var(--primary-bg);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
}

.category-info {
  flex: 1;
}
.category-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.category-info h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-900);
}
.category-price {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}
.category-details-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.125rem;
}
.category-size {
  font-size: 0.8125rem;
  color: var(--gray-600);
  font-weight: 500;
}

/* ============================================
   WAITLIST MODAL
   ============================================ */
.waitlist-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.waitlist-overlay.active { display: flex; }
.waitlist-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 90%;
  max-width: 400px;
}
.waitlist-modal h3 { margin-bottom: 1rem; }
.waitlist-modal label {
  display: block;
  font-size: 0.8125rem;
  color: var(--gray-700);
  margin-bottom: 0.25rem;
}
.waitlist-modal input {
  width: 100%;
  padding: 0.625rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  box-sizing: border-box;
}
.waitlist-modal .btn-row {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* ============================================
   HELP MODAL
   ============================================ */
.help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.help-overlay.active { display: flex; }
.help-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.help-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.help-modal-header h3 { margin: 0; }
.help-modal-header button {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--gray-500);
  padding: 0.25rem;
}
#helpContent {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--gray-600);
}

/* ============================================
   OFFLINE MODAL
   ============================================ */
.offline-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.offline-overlay.active { display: flex; }
.offline-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

/* ============================================
   UNIT LIST (Step 1)
   ============================================ */
.unit-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.unit-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.unit-card:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-sm);
}

.unit-card.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.unit-card.unavailable {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.unit-info {
  flex: 1;
  min-width: 0;
}

.unit-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.unit-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-900);
}

.unit-price {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

.unit-price .original {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-decoration: line-through;
  margin-left: 0.375rem;
}

.unit-details-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.125rem;
}

.unit-details {
  font-size: 0.8125rem;
  color: var(--gray-600);
  font-weight: 500;
  margin-top: 0.25rem;
}

.unit-checkbox {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  border-radius: var(--radius-xs);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.unit-card.selected .unit-checkbox {
  opacity: 1;
}

.unit-checkbox svg {
  width: 14px;
  height: 14px;
  stroke: var(--white);
  stroke-width: 3;
}

/* ============================================
   DATE & PERIOD (Step 1)
   ============================================ */
.date-period-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.input-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.input-box:hover {
  border-color: var(--gray-400);
}

.input-box .value {
  font-weight: 500;
  color: var(--gray-900);
}

.input-box .icon {
  color: var(--gray-400);
}

/* Coupon input */
.coupon-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.coupon-row .form-input {
  flex: 1;
}

.coupon-btn {
  padding: 0 1rem;
  background: var(--gray-900);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.25rem;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.coupon-btn:hover {
  background: var(--gray-800);
}

/* ============================================
   MINI SUMMARY (Steps 2-5)
   ============================================ */
.mini-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.mini-summary-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-bg);
  border-radius: var(--radius-sm);
  font-size: 1.375rem;
}

.mini-summary-info {
  flex: 1;
  min-width: 0;
}

.mini-summary-info strong {
  display: block;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--gray-900);
}

.mini-summary-info span {
  font-size: 0.875rem;
  color: var(--gray-500);
}

.mini-summary-price {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

/* ============================================
   VIPPS SECTION
   ============================================ */
.vipps-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--gray-200);
}

.vipps-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem;
  background: var(--vipps);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.vipps-btn:hover {
  background: var(--vipps-dark);
  transform: translateY(-1px);
}

.vipps-btn img {
  height: 32px;
}

.vipps-helper {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-top: 0.5rem;
}

.manual-verify-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background var(--transition-fast);
}

.manual-verify-btn:hover {
  background: var(--gray-200);
}

/* Email verification section */
.verification-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
  color: var(--gray-400);
  font-size: 0.875rem;
}

.verification-divider::before,
.verification-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.email-verify-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  min-height: 48px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9375rem;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.email-verify-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.email-verify-btn:disabled {
  background: var(--gray-300);
  cursor: not-allowed;
  transform: none;
}

.email-verify-btn i {
  font-size: 1rem;
}

.email-verify-status {
  display: none;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-top: 0.75rem;
}

.email-verify-status.pending {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--info-bg);
  color: var(--info);
}

.email-verify-status.success {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--success-bg);
  color: var(--success);
}

.email-verify-status.error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--error-bg);
  color: var(--error);
}

.email-verify-timer {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-top: 0.5rem;
  text-align: center;
}

.verification-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 1rem;
}

.verification-status.success {
  background: var(--success-bg);
  color: var(--success);
}

.verification-status.pending {
  background: var(--warning-bg);
  color: var(--warning);
}

.verification-status.error {
  background: var(--error-bg);
  color: var(--error);
}

/* ============================================
   ADDON CARDS (Step 3)
   ============================================ */
.addon-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-bottom: 0.75rem;
  transition: all var(--transition-fast);
}

.addon-card:hover {
  border-color: var(--gray-300);
}

.addon-card.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.addon-checkbox {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-xs);
  flex-shrink: 0;
  transition: all var(--transition-fast);
  font-size: 0.8rem;
  color: transparent;
}

.addon-card.selected .addon-checkbox {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.addon-info {
  flex: 1;
  min-width: 0;
}

.addon-info h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.125rem;
}

.addon-info p {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.addon-badge {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  background: var(--success-bg);
  color: #047857; /* WCAG AA: darker green for contrast */
  font-size: 0.75rem; /* 12px - improved from 11px for better readability */
  font-weight: 600;
  border-radius: 3px;
  margin-left: 0.375rem;
  text-transform: uppercase;
}

.addon-price {
  font-weight: 600;
  color: var(--gray-700);
  white-space: nowrap;
  font-size: 0.9375rem;
}

/* ============================================
   SUMMARY CARD (Step 4-5)
   ============================================ */
.summary-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.summary-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 1rem;
}

.summary-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  font-size: 1.375rem;
}

.summary-title h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--gray-900);
}

.summary-title p {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.summary-section {
  margin-bottom: 0.875rem;
}

.summary-section:last-child {
  margin-bottom: 0;
}

.summary-section h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
  padding: 0.375rem 0.5rem;
  background: var(--gray-100);
  border-radius: 6px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.375rem 0;
  font-size: 0.9375rem;
}

.summary-row .label {
  color: var(--gray-600);
}

.summary-row .value {
  font-weight: 500;
  color: var(--gray-900);
}

.summary-row.total {
  border-top: 2px solid var(--gray-200);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.summary-row.total .label {
  color: var(--gray-900);
}

.summary-row.total .value {
  color: var(--gray-900);
}

/* ============================================
   AGREEMENT (Step 4)
   ============================================ */
.agreement-box-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

.agreement-box {
  max-height: 200px;
  overflow-y: auto;
  padding: 1rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--gray-600);
  line-height: 1.7;
}

.agreement-scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem;
  background: linear-gradient(to top, var(--gray-100) 60%, transparent);
  color: var(--gray-500);
  font-size: 0.75rem;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  pointer-events: none;
  transition: opacity 0.3s;
}

.agreement-scroll-hint.hidden {
  opacity: 0;
}

.agreement-box h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 0.75rem;
}

.agreement-box h5 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-top: 1rem;
  margin-bottom: 0.375rem;
}

.agreement-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.btn-download:hover {
  background: var(--gray-200);
}

/* Signature pad */
.signature-section {
  margin-top: 1.25rem;
  padding: 1rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
}

.signature-section h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.375rem;
}

.signature-section p {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-bottom: 0.75rem;
}

.signature-pad {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.signature-pad canvas {
  display: block;
  width: 100%;
  height: 150px;
  cursor: crosshair;
}

.signature-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
}

.btn-clear {
  padding: 0.375rem 0.75rem;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-xs);
  font-size: 0.8125rem;
  color: var(--gray-600);
  cursor: pointer;
}

.btn-clear:hover {
  background: var(--gray-100);
}

/* ============================================
   PAYMENT (Step 5)
   ============================================ */
.payment-notice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--info-bg);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.payment-notice i {
  color: var(--info);
  font-size: 1.25rem;
}

.payment-notice span {
  font-size: 0.9375rem;
  color: var(--gray-800);
}

.payment-notice strong {
  font-weight: 600;
}

.stripe-element {
  padding: 0.75rem 1rem;
  min-height: 48px;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.stripe-element:focus-within {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

.stripe-errors {
  font-size: 0.8125rem;
  color: var(--error);
  margin-top: 0.375rem;
}

.stripe-attribution {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--gray-200);
  margin-top: 1rem;
}

.stripe-attribution span {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.payment-hint {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin: 0.5rem 0 0;
}

.terms-check {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 1rem 0;
  margin-top: 1rem;
  cursor: pointer;
}

.terms-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.terms-text {
  font-size: 0.8125rem;
  color: var(--gray-600);
  line-height: 1.4;
}

.terms-text a {
  color: var(--primary);
  text-decoration: underline;
}

.payment-total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  margin-top: 0.5rem;
  border-top: 1px solid var(--gray-200);
  font-size: 1rem;
  color: var(--gray-700);
}

.payment-total-line strong {
  font-size: 1.125rem;
  color: var(--gray-900);
}


/* ============================================
   CONFIRMATION (Step 6)
   ============================================ */
.processing-state {
  text-align: center;
  padding: 3rem 1rem;
}

.processing-spinner {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.5rem;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.processing-state h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.processing-state p {
  color: var(--gray-500);
  font-size: 0.9375rem;
}

.confirmation {
  text-align: center;
  padding: 2rem 0;
}

.confirmation-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  border-radius: 50%;
  font-size: 2.5rem;
  color: var(--white);
  animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popIn {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.confirmation h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.confirmation > p {
  color: var(--gray-500);
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
}

.confirmation-details {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: left;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row span {
  color: var(--gray-500);
  font-size: 0.875rem;
}

.detail-row strong {
  color: var(--gray-900);
  font-size: 0.875rem;
  font-weight: 600;
}

/* ============================================
   STICKY CTA
   ============================================ */
.cta-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, var(--white) 70%, transparent);
  padding: 1.5rem 1rem 1rem;
  z-index: 90;
}

.cta-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.cta-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: var(--gray-200);
  color: var(--gray-600); /* WCAG AA: 4.57:1 contrast */
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-md);
}

.cta-btn.active {
  background: var(--primary);
  color: var(--white);
}

.cta-btn.active:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.cta-btn.success {
  background: var(--success);
  color: var(--white);
  cursor: pointer;
}

.cta-arrow svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading-spinner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-500);
}

.loading-spinner i {
  animation: spin 1s linear infinite;
}

.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ============================================
   RESPONSIVE - MOBILE FIRST
   ============================================ */

/* Extra small phones */
@media (max-width: 359px) {
  .booking-container {
    padding: 0 0.75rem;
  }

  .section-title {
    font-size: 1.25rem;
  }

  .category-list {
    grid-template-columns: 1fr;
  }

  .step1-controls {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .unit-card {
    gap: 0.5rem;
  }
}

/* Standard phones */
@media (min-width: 360px) and (max-width: 479px) {
  .category-list {
    grid-template-columns: 1fr;
  }

  .step1-controls {
    grid-template-columns: 1fr;
  }

  .form-row:not(.postal-city) {
    grid-template-columns: 1fr;
  }

  .unit-card {
    gap: 0.75rem;
  }
}

/* Medium phones */
@media (min-width: 480px) and (max-width: 599px) {
  .unit-card {
    gap: 0.75rem;
  }
}

/* Large phones */
@media (min-width: 480px) {
  .booking-container {
    padding: 0 1.25rem;
  }

  .category-list {
    grid-template-columns: 1fr 1fr;
  }

  .step1-controls {
    grid-template-columns: 1fr 1fr;
  }
}

/* Tablets */
@media (min-width: 600px) {
  .booking-container {
    padding: 0 1.5rem;
    padding-bottom: 120px;
  }

  .section-title {
    font-size: 1.625rem;
  }

  .card {
    padding: 1.5rem;
  }

  .unit-card {
    padding: 1.25rem;
  }

  .cta-btn {
    padding: 1.375rem 1.75rem;
    font-size: 1.0625rem;
  }
}

/* Desktop */
@media (min-width: 900px) {
  body {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background: var(--gray-100);
  }

  .booking-app {
    width: 100%;
    max-width: 960px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
  }

  .booking-header {
    position: relative;
  }

  .progress-wrapper {
    background: var(--gray-50);
  }

  .booking-container {
    max-width: 100%;
    padding: 0 2rem;
    padding-bottom: 0;
  }

  /* Step 1 Desktop Layout */
  .step1-controls {
    gap: 1rem;
  }

  .step1-main {
    flex-direction: row;
    gap: 1.5rem;
    align-items: stretch;
  }

  .step1-categories {
    flex: 0 0 240px;
    order: 1;
    display: flex;
    flex-direction: column;
  }

  .step1-panel {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    padding: 1.25rem;
  }

  .step1-categories .step1-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .step1-categories .category-list {
    flex: 1;
  }

  .step1-units {
    flex: 1;
    order: 2;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  .step1-units .step1-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .step1-units .unit-list {
    flex: 1;
  }

  .category-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
  }

  .category-card,
  .unit-card {
    height: 72px;
    box-sizing: border-box;
  }

  .category-card {
    flex-direction: row;
    padding: 0 1rem;
    border-width: 1px;
  }

  .unit-card {
    padding: 0 1rem;
  }

  .category-card .category-status {
    font-size: 10px;
  }

  .category-card .category-icon {
    width: 32px;
    height: 32px;
  }

  .category-card .category-icon svg {
    width: 24px;
    height: 24px;
  }

  .category-info h3 {
    font-size: 0.875rem;
  }

  .category-info p {
    font-size: 0.75rem;
  }

  .cta-container {
    position: relative;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 1.5rem 2rem;
  }

  .unit-card:hover {
    transform: translateY(-2px);
  }

  .category-card:hover {
    transform: translateY(-2px);
  }
}

/* Large desktop */
@media (min-width: 1200px) {
  .booking-app {
    max-width: 1080px;
  }

  .step1-categories {
    flex: 0 0 280px;
  }
}

/* Touch devices */
@media (hover: none) and (pointer: coarse) {
  .cta-btn,
  .toggle-btn,
  .unit-card,
  .category-card,
  .addon-card,
  .form-input,
  .form-select {
    min-height: 48px;
  }

  .form-input,
  .form-select {
    font-size: 16px; /* Prevents iOS zoom */
  }

  /* Remove hover effects */
  .unit-card:hover,
  .category-card:hover {
    transform: none;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print */
@media print {
  .booking-header,
  .progress-wrapper,
  .cta-container {
    display: none !important;
  }

  .booking-container {
    max-width: 100%;
    padding: 0;
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
