:root {
  /* Original brand colors */
  --primary: #14b8a6;
  --primary-dark: #0d9488;
  --primary-light: #ccfbf1;
  --accent: #3b82f6;

  /* Background system */
  --bg: #f8fafc;
  --bg-secondary: #f1f5f9;
  --card: #ffffff;

  /* Text colors */
  --text: #1e293b;
  --text-light: #64748b;
  --text-lighter: #94a3b8;

  /* Step-specific colors */
  --step-1-from: #10b981;
  --step-1-to: #059669;
  --step-2-from: #3b82f6;
  --step-2-to: #2563eb;
  --step-3-from: #0891b2;
  --step-3-to: #0e7490;
  --step-4-from: #f59e0b;
  --step-4-to: #d97706;
  --step-5-from: #16a34a;
  --step-5-to: #15803d;

  /* Semantic colors */
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --success: #16a34a;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  /* Border radius */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  overflow-x: hidden;
  width: 100%;
  height: 100%;
  /* iOS Safari full-screen support */
  height: -webkit-fill-available;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  position: relative;

  /* Full viewport height for mobile */
  min-height: 100vh;
  min-height: -webkit-fill-available;

  /* Prevent overscroll bounce on iOS */
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.hidden {
  display: none !important;
}

.resume-banner {
  background: linear-gradient(135deg, rgba(22, 165, 150, 0.12), rgba(59, 130, 246, 0.12));
  border: 1px solid rgba(22, 165, 150, 0.3);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.resume-banner__content {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
  font-size: 15px;
}

.resume-banner__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Wizard Header - Base */
.wizard-header {
  background: linear-gradient(135deg, var(--step-1-from) 0%, var(--step-1-to) 100%);
  padding: 28px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
  transition: background var(--transition-slow);
}

.wizard-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
  background-size: 40px 40px;
  opacity: 0.3;
  pointer-events: none;
}

/* Step 1: Welcome - Emerald Green */
.wizard-header.step-1-active {
  background: linear-gradient(135deg, var(--step-1-from) 0%, var(--step-1-to) 100%);
}

/* Step 2: Pain Map - Bright Blue */
.wizard-header.step-2-active {
  background: linear-gradient(135deg, var(--step-2-from) 0%, var(--step-2-to) 100%);
}

/* Step 3: Medical History - Purple */
.wizard-header.step-3-active {
  background: linear-gradient(135deg, var(--step-3-from) 0%, var(--step-3-to) 100%);
}

/* Step 4: Goals - Amber */
.wizard-header.step-4-active {
  background: linear-gradient(135deg, var(--step-4-from) 0%, var(--step-4-to) 100%);
}

/* Step 5: Review - Success Green */
.wizard-header.step-5-active {
  background: linear-gradient(135deg, var(--step-5-from) 0%, var(--step-5-to) 100%);
}

.wizard-steps {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.wizard-steps::before {
  content: '';
  position: absolute;
  top: 24px;
  left: 10%;
  right: 10%;
  height: 3px;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0.2) 100%);
  border-radius: 2px;
  z-index: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
  opacity: 0.5;
  transition: all 0.3s ease;
}

.step.active,
.step.completed {
  opacity: 1;
}

.step-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
}

.step.active .step-circle {
  background: white;
  color: var(--primary);
  transform: scale(1.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 0 0 4px rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(22, 165, 150, 0.3);
}

.step.completed .step-circle {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.step.completed .step-circle::after {
  content: '✓';
  position: absolute;
  font-size: 14px;
  font-weight: 900;
  color: white;
}

/* Make completed and active steps clickable */
.step.completed:hover .step-circle,
.step.active:hover .step-circle {
  transform: scale(1.18);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 0 0 4px rgba(255, 255, 255, 0.4);
  cursor: pointer;
}

.step.completed:hover,
.step.active:hover {
  cursor: pointer;
  opacity: 1;
}

.step.completed .step-circle {
  font-size: 0;
}

.step-label {
  font-size: 13px;
  color: white;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.3px;
}

/* Wizard Container */
.wizard-container {
  max-width: 1600px;
  margin: 40px auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 40px;
  min-height: calc(100vh - 200px);
}

/* Progress Sidebar - Glassmorphism */
.progress-sidebar {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--glass-shadow);
  height: fit-content;
  position: sticky;
  top: 32px;
  transition: all var(--transition-base);
}

.progress-sidebar:hover {
  box-shadow: var(--shadow-xl);
  border-color: rgba(20, 184, 166, 0.3);
}

.progress-circle {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 24px;
}

.progress-circle svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.progress-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.progress-bar {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 0.5s ease;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
}

.sidebar-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-step {
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--text-light);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
  cursor: default;
}

.sidebar-step.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-step.completed {
  color: var(--success);
}

/* Wizard Content */
/* Wizard Content - Glassmorphism */
.wizard-content {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--glass-shadow);
  transition: all var(--transition-base);
}

.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

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

.step-content h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.step-description {
  color: var(--text-light);
  margin-bottom: 40px;
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: -0.1px;
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 40px;
}

.hero-icon {
  width: 48px;
  height: 48px;
  display: block;
  margin: 0 auto 24px;
  color: #10b981;
}

.hero-section h1 {
  font-size: 42px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -1px;
  line-height: 1.1;
}

.subtitle {
  font-size: 19px;
  color: var(--text-light);
  line-height: 1.6;
  font-weight: 400;
}

.info-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-top: 48px;
  margin-bottom: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
}

.info-icon {
  width: 16px;
  height: 16px;
  color: #10b981;
  flex-shrink: 0;
}

.info-item span {
  line-height: 1.4;
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label,
.form-section h3 {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.form-section {
  margin-bottom: 32px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  transition: all var(--transition-base);
}

.form-section:hover {
  background: rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow-md);
}

.form-section h3 {
  font-size: 16px;
  margin-bottom: 16px;
}

.warning-text {
  color: var(--danger);
  font-size: 14px;
  margin-bottom: 16px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: all var(--transition-base);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(5px);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.1);
  background: white;
  transform: scale(1.01);
}

/* Checkbox enhancement */
.checkbox-grid label {
  transition: all var(--transition-fast);
}

.checkbox-grid label:hover {
  transform: translateX(4px);
  color: var(--primary);
}

select.full-width {
  width: 100%;
}

/* Pain Map Section */
.pain-map-section {
  display: grid;
  gap: 32px;
}

.body-map-container {
  background: var(--bg);
  padding: 24px;
  border-radius: var(--radius);
}

.view-toggle {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  justify-content: center;
}

.view-btn {
  padding: 10px 24px;
  border: 2px solid var(--border);
  background: white;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.view-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.selected-areas-display {
  background: white;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.selected-areas-display strong {
  color: var(--text);
  display: block;
  margin-bottom: 12px;
}

.pain-points-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pain-points-list .no-pain-points {
  color: var(--text-light);
  font-style: italic;
  padding: 8px 0;
}

.pain-point-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.pain-point-item:hover {
  background: #f0f9f8;
  border-color: var(--primary);
  box-shadow: 0 2px 4px rgba(22, 165, 150, 0.1);
}

.pain-point-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.pain-point-name {
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
}

.pain-point-intensity {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: white;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
}

.pain-point-intensity.low {
  color: #0ea5e9;
  border-color: #bae6fd;
  background: #f0f9ff;
}

.pain-point-intensity.medium {
  color: #f59e0b;
  border-color: #fde68a;
  background: #fffbeb;
}

.pain-point-intensity.high {
  color: #ef4444;
  border-color: #fecaca;
  background: #fef2f2;
}

.pain-point-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-light);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.pain-point-remove:hover {
  background: #fee2e2;
  color: #dc2626;
  transform: scale(1.1);
}

.pain-point-remove:active {
  transform: scale(0.95);
}

.body-diagram {
  display: none;
  max-width: 420px;
  margin: 0 auto 24px;
}

.body-diagram.active {
  display: block;
}

.body-map-wrapper {
  position: relative;
  width: 100%;
  margin: 0 auto;
  filter: drop-shadow(0 18px 35px rgba(15, 23, 42, 0.18));
}

.body-map-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.85), rgba(255, 255, 255, 0.85));
}

.hotspot-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pain-marker {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.4);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.pain-marker:hover {
  transform: translate(-50%, -50%) scale(1.18);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.45);
}

.pain-marker[data-intensity="low"] {
  background: rgba(59, 130, 246, 0.85);
}

.pain-marker[data-intensity="medium"] {
  background: rgba(251, 191, 36, 0.95);
}

.pain-marker[data-intensity="high"] {
  background: rgba(239, 68, 68, 0.95);
}

/* ===================================
   PAIN INTENSITY MODAL
   =================================== */

/* Modal Container */
.pain-intensity-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.pain-intensity-modal[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

/* Glassmorphism Backdrop */
.pain-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity var(--transition-base);
}

/* Modal Content Card */
.pain-modal-content {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 480px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--glass-shadow), 0 20px 60px rgba(15, 23, 42, 0.3);
  overflow: hidden;
  transform: scale(0.95) translateY(20px);
  transition: transform var(--transition-base);
}

.pain-intensity-modal[aria-hidden="false"] .pain-modal-content {
  transform: scale(1) translateY(0);
}

/* Modal Header */
.pain-modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.3));
}

.pain-modal-header h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.pain-modal-location {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pain-modal-location::before {
  content: '📍';
  font-size: 14px;
}

/* Modal Body */
.pain-modal-body {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Pain Scale Section */
.pain-scale-section {
  display: none;
}

.pain-scale-labels-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pain-label-start {
  color: #3b82f6;
}

.pain-label-end {
  color: #ef4444;
}

/* Slider Wrapper */
.pain-scale-slider-wrapper {
  position: relative;
  padding: 12px 0;
}

.pain-scale-track-bg {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 8px;
  transform: translateY(-50%);
  background: linear-gradient(90deg,
    #3b82f6 0%,
    #3b82f6 30%,
    #fbbf24 50%,
    #f59e0b 70%,
    #ef4444 100%
  );
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.3;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Custom Range Slider */
.pain-scale-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: transparent;
  border-radius: 999px;
  outline: none;
  position: relative;
  z-index: 2;
  cursor: pointer;
}

/* Slider Thumb - WebKit (Chrome, Safari, Edge) */
.pain-scale-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: white;
  border: 3px solid var(--primary);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2), 0 2px 4px rgba(15, 23, 42, 0.1);
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.pain-scale-slider:active::-webkit-slider-thumb {
  cursor: grabbing;
  transform: scale(1.15);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.3), 0 3px 8px rgba(15, 23, 42, 0.15);
}

/* Slider Thumb - Firefox */
.pain-scale-slider::-moz-range-thumb {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: white;
  border: 3px solid var(--primary);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2), 0 2px 4px rgba(15, 23, 42, 0.1);
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.pain-scale-slider:active::-moz-range-thumb {
  cursor: grabbing;
  transform: scale(1.15);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.3), 0 3px 8px rgba(15, 23, 42, 0.15);
}

/* Dynamic thumb color based on value */
.pain-scale-slider[data-intensity="low"]::-webkit-slider-thumb {
  border-color: #3b82f6;
}

.pain-scale-slider[data-intensity="medium"]::-webkit-slider-thumb {
  border-color: #f59e0b;
}

.pain-scale-slider[data-intensity="high"]::-webkit-slider-thumb {
  border-color: #ef4444;
}

.pain-scale-slider[data-intensity="low"]::-moz-range-thumb {
  border-color: #3b82f6;
}

.pain-scale-slider[data-intensity="medium"]::-moz-range-thumb {
  border-color: #f59e0b;
}

.pain-scale-slider[data-intensity="high"]::-moz-range-thumb {
  border-color: #ef4444;
}

/* Scale Markers */
.pain-scale-markers {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  pointer-events: none;
}

.scale-marker {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  opacity: 0.6;
  transition: opacity 0.2s ease, color 0.2s ease, transform 0.2s ease;
  user-select: none;
}

.scale-marker.active {
  opacity: 1;
  color: var(--primary);
  transform: scale(1.3);
  font-weight: 700;
}

/* Value Display */
.pain-scale-value-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(241, 245, 249, 0.8));
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.pain-value-number {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s ease;
}

.pain-value-number[data-intensity="low"] {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pain-value-number[data-intensity="medium"] {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pain-value-number[data-intensity="high"] {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pain-value-description {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

/* Quick Select Section */
.pain-quick-select {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quick-select-label {
  display: none;
}

.quick-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.quick-select-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 8px;
  background: white;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 70px;
  position: relative;
  overflow: hidden;
}

.quick-select-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.quick-select-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.2);
}

.quick-select-btn:active {
  transform: translateY(0);
}

.quick-select-btn.selected {
  border-color: var(--primary);
  border-width: 3px;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.15), rgba(20, 184, 166, 0.08));
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.15), 0 4px 12px rgba(20, 184, 166, 0.25);
  transform: translateY(-2px);
}

.quick-btn-number {
  position: relative;
  z-index: 1;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  transition: color 0.2s ease;
}

.quick-btn-label {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.quick-select-btn:hover .quick-btn-number,
.quick-select-btn:hover .quick-btn-label,
.quick-select-btn.selected .quick-btn-number,
.quick-select-btn.selected .quick-btn-label {
  color: var(--primary);
}

/* Color coding for quick buttons */
.quick-select-btn[data-intensity="0"],
.quick-select-btn[data-intensity="2"] {
  border-color: rgba(59, 130, 246, 0.3);
}

.quick-select-btn[data-intensity="0"]:hover,
.quick-select-btn[data-intensity="2"]:hover,
.quick-select-btn[data-intensity="0"].selected,
.quick-select-btn[data-intensity="2"].selected {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.quick-select-btn[data-intensity="4"],
.quick-select-btn[data-intensity="6"] {
  border-color: rgba(245, 158, 11, 0.3);
}

.quick-select-btn[data-intensity="4"]:hover,
.quick-select-btn[data-intensity="6"]:hover,
.quick-select-btn[data-intensity="4"].selected,
.quick-select-btn[data-intensity="6"].selected {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.quick-select-btn[data-intensity="8"],
.quick-select-btn[data-intensity="10"] {
  border-color: rgba(239, 68, 68, 0.3);
}

.quick-select-btn[data-intensity="8"]:hover,
.quick-select-btn[data-intensity="10"]:hover,
.quick-select-btn[data-intensity="8"].selected,
.quick-select-btn[data-intensity="10"].selected {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Modal Footer */
.pain-modal-footer {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(241, 245, 249, 0.5));
}

.pain-modal-btn {
  flex: 1;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
}

.pain-modal-cancel {
  background: white;
  color: var(--text-muted);
  border: 2px solid var(--border);
}

.pain-modal-cancel:hover {
  background: var(--surface);
  border-color: var(--text-muted);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.pain-modal-cancel:active {
  transform: translateY(0);
}

.pain-modal-confirm {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: 2px solid transparent;
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.pain-modal-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(20, 184, 166, 0.4);
}

.pain-modal-confirm:active {
  transform: translateY(0);
}

.confirm-icon {
  font-size: 18px;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .pain-intensity-modal {
    align-items: center;
    justify-content: center;
  }

  .pain-modal-content {
    width: 92%;
    max-width: none;
    border-radius: 20px;
    transform: scale(0.9) translateY(20px);
    max-height: none;
    overflow-y: visible;
  }

  .pain-intensity-modal[aria-hidden="false"] .pain-modal-content {
    transform: scale(1) translateY(0);
  }

  .pain-modal-header {
    padding: 18px 20px 14px;
  }

  .pain-modal-header h3 {
    font-size: 18px;
  }

  .pain-modal-location {
    font-size: 14px;
  }

  .pain-modal-body {
    padding: 16px 20px;
  }

  .pain-modal-footer {
    padding: 14px 20px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 12px));
  }

  .quick-select-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .quick-select-btn {
    min-height: 70px;
    padding: 12px 8px;
  }

  .quick-btn-number {
    font-size: 22px;
  }

  .quick-btn-label {
    font-size: 12px;
  }

  .pain-modal-btn {
    padding: 14px 20px;
    font-size: 16px;
  }
}

/* Tablet Landscape */
@media (min-width: 769px) and (max-width: 1024px) {
  .pain-modal-content {
    max-width: 520px;
  }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .pain-intensity-modal,
  .pain-modal-content,
  .pain-modal-backdrop,
  .pain-scale-slider::-webkit-slider-thumb,
  .pain-scale-slider::-moz-range-thumb,
  .quick-select-btn,
  .pain-modal-btn {
    transition: none;
  }
}

/* Focus States for Keyboard Navigation */
.pain-scale-slider:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 4px;
  border-radius: 999px;
}

.quick-select-btn:focus-visible,
.pain-modal-btn:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.pain-details-section {
  display: grid;
  gap: 24px;
}

/* Slider */
.slider-container {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.slider-label {
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
}

input[type="range"] {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  transition: transform 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
}

.slider-value {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 12px;
}

/* Checkbox Grid */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.checkbox-grid label {
  background: white;
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
}

.checkbox-grid label:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.checkbox-grid input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Review Summary */
.review-summary {
  background: var(--bg);
  padding: 24px;
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.review-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.review-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.review-section h3 {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 12px;
}

.review-item {
  display: flex;
  margin-bottom: 8px;
  font-size: 14px;
}

.review-label {
  font-weight: 600;
  color: var(--text);
  min-width: 200px;
}

.review-value {
  color: var(--text-light);
}

.ai-summary-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.ai-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.ai-summary-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.ai-summary-consent {
  background: var(--primary-light);
  padding: 14px 16px;
  border-radius: var(--radius);
  flex: 1 1 260px;
}

.ai-summary-consent span {
  font-size: 13px;
  line-height: 1.5;
}

.ai-summary-controls .btn-compact {
  align-self: center;
}

.btn-compact {
  padding: 6px 14px;
  font-size: 13px;
  line-height: 1.4;
}

.ai-summary-status {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.ai-summary-status[data-state="loading"] {
  color: var(--accent);
}

.ai-summary-status[data-state="success"] {
  color: var(--success);
}

.ai-summary-status[data-state="error"] {
  color: var(--danger);
}

.ai-summary-text {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  min-height: 120px;
  max-height: none;
  overflow: visible;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  word-wrap: break-word;
}

.ai-summary-text p {
  margin-bottom: 12px;
}

.ai-summary-text ul {
  margin: 0 0 12px 20px;
  padding: 0;
  list-style: disc;
}

.ai-summary-text li {
  margin-bottom: 6px;
}

.ai-summary-text strong {
  color: var(--text);
  font-weight: 600;
}

/* Consent */
.consent-section {
  background: var(--primary-light);
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
}

.consent-label input {
  width: 24px;
  height: 24px;
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.privacy-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  color: #6b7280;
  font-size: 12px;
}

.privacy-icon {
  width: 14px;
  height: 14px;
  color: #10b981;
  flex-shrink: 0;
}

.privacy-footer span {
  line-height: 1.4;
}

/* Recovery Trajectory Graph */
.recovery-trajectory-section {
  margin-top: 32px;
  padding: 32px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.trajectory-header {
  margin-bottom: 24px;
}

.trajectory-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 12px 0;
}

.trajectory-description {
  font-size: 14px;
  line-height: 1.6;
  color: #4b5563;
  margin: 0;
  padding: 16px;
  background: #f9fafb;
  border-left: 3px solid #10b981;
  border-radius: 6px;
}

.trajectory-canvas-container {
  position: relative;
  width: 100%;
  margin: 24px 0;
  padding: 16px;
  padding-top: 32px;
  background: #ffffff;
  border-radius: 8px;
}

.trajectory-legend {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 13px;
  color: #6b7280;
  text-align: center;
}

/* Navigation */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}

.nav-spacer {
  flex: 1;
}

.save-status {
  font-size: 13px;
  color: var(--text-light);
  margin: 0 16px;
}

/* Buttons */
.btn {
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  transform: translateY(0);
  letter-spacing: 0.3px;
}

/* Ripple effect */
.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  pointer-events: none;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(20, 184, 166, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(20, 184, 166, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.3);
}

.btn-secondary {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text);
  border: 1.5px solid var(--border);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(148, 163, 184, 0.15);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #15803d;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-tertiary {
  border: 2px dashed var(--border);
  background: transparent;
  color: var(--text-light);
}

.btn-tertiary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}
  background: rgba(22, 165, 150, 0.08);
}

.btn-danger {
  background: var(--danger);
  color: white;
  width: 100%;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal[aria-hidden="false"] {
  display: flex;
}

.modal-content {
  background: white;
  padding: 32px;
  border-radius: var(--radius);
  max-width: 500px;
  margin: 20px;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-content h2 {
  color: var(--danger);
  font-size: 24px;
  margin-bottom: 16px;
}

.modal-content p {
  margin-bottom: 24px;
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 1024px) {
  .wizard-container {
    grid-template-columns: 1fr;
  }

  .progress-sidebar {
    position: relative;
    top: 0;
  }

  .wizard-steps::before {
    left: 5%;
    right: 5%;
  }
}

@media (max-width: 768px) {
  .wizard-header {
    padding: env(safe-area-inset-top, 20px) 0 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
  }

  .wizard-steps {
    padding: 0 12px;
    gap: 8px;
  }

  .wizard-steps::before {
    top: 14px;
    height: 2px;
  }

  .step {
    gap: 4px;
  }

  .step-circle {
    width: 28px;
    height: 28px;
    font-size: 13px;
    font-weight: 600;
  }

  .step.active .step-circle {
    transform: scale(1.05);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
  }

  .step.completed:hover .step-circle,
  .step.active:hover .step-circle {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
  }

  .step-label {
    display: none;
  }

  /* Mobile sidebar optimization */
  .progress-sidebar {
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Hide the text menu on mobile */
  .sidebar-steps {
    display: none;
  }

  /* Make progress circle much smaller and cooler */
  .progress-circle {
    display: none;
  }

  .progress-text {
    font-size: 14px;
    font-weight: 700;
  }

  /* Add segmented pie look with gaps */
  .progress-circle svg {
    filter: drop-shadow(0 2px 4px rgba(22, 165, 150, 0.2));
  }

  .progress-bg {
    stroke-width: 6;
    stroke-dasharray: 4 4;
  }

  .progress-bar {
    stroke-width: 6;
    stroke-dasharray: 4 4;
  }

  .wizard-content {
    padding: 24px;
  }

  .step-content h2 {
    font-size: 24px;
  }

  .form-grid,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .info-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-top: 32px;
    margin-bottom: 32px;
    padding-top: 16px;
  }

  .wizard-nav {
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
    margin: 0 -16px;
  }

  .btn {
    flex: 1 1 100%;
    font-size: 16px;
    padding: 14px 20px;
  }

  .nav-spacer {
    display: none;
  }

  /* Prevent horizontal scroll on all containers */
  .wizard-container,
  .step-content,
  .wizard-content,
  .form-section,
  .body-map-container,
  .selected-areas-display {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .wizard-container {
    margin: 8px auto;
    padding: 0;
  }

  .wizard-content {
    padding: 16px;
    max-width: 100%;
  }

  .step-content {
    padding: 0;
    max-width: 100%;
  }

  .step-content h2 {
    font-size: 22px;
    margin-bottom: 12px;
    word-wrap: break-word;
  }

  /* Fix: Prevent input focus border/shadow overflow on mobile */
  input:focus,
  input[type="text"]:focus,
  input[type="email"]:focus,
  input[type="tel"]:focus,
  input[type="date"]:focus,
  select:focus,
  textarea:focus {
    transform: none;
    box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.15);
  }

  .step-description {
    font-size: 14px;
    margin-bottom: 20px;
  }

  /* Body map and pain points mobile optimization */
  .body-map-container {
    padding: 16px;
  }

  .selected-areas-display {
    padding: 12px;
    margin-bottom: 16px;
  }

  .selected-areas-display strong {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .pain-points-list {
    gap: 6px;
  }

  .pain-point-item {
    padding: 8px 10px;
  }

  .pain-point-name {
    font-size: 13px;
    word-break: break-word;
  }

  .pain-point-intensity {
    font-size: 11px;
    padding: 2px 6px;
  }

  .view-btn {
    font-size: 13px;
    padding: 8px 12px;
  }

  /* Review page fixes */
  .review-summary {
    max-width: 100%;
    overflow-x: hidden;
  }

  .review-section {
    margin-bottom: 20px;
    max-width: 100%;
    overflow-x: hidden;
  }

  .review-section h3 {
    font-size: 16px;
    word-wrap: break-word;
  }

  .review-item {
    padding: 10px 12px;
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .review-label {
    font-size: 13px;
    min-width: 0;
    flex-shrink: 0;
  }

  .review-value {
    font-size: 13px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 0;
  }

  /* AI Summary section mobile fixes */
  .ai-summary-section {
    padding: 16px 12px;
    max-width: 100%;
    overflow-x: hidden;
  }

  .ai-summary-header h3 {
    font-size: 18px;
  }

  .ai-summary-text {
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .consent-label {
    font-size: 13px;
  }

  /* Form elements mobile fixes */
  .form-section {
    padding: 16px 16px;
    max-width: 100%;
    overflow-x: visible;
  }

  .pain-details-section {
    padding: 0;
    gap: 16px;
  }

  .form-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
  }

  .form-group label {
    font-size: 14px;
  }

  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px;
    width: 100%;
    max-width: 100%;
  }

  .checkbox-grid {
    gap: 8px;
  }

  .checkbox-grid label {
    font-size: 14px;
    padding: 10px 12px;
    word-wrap: break-word;
  }

  /* Privacy footer mobile */
  .privacy-footer {
    font-size: 11px;
    margin: 16px 0;
    text-align: center;
    flex-direction: column;
    gap: 6px;
  }

  /* Recovery Trajectory - Mobile */
  .recovery-trajectory-section {
    margin-top: 24px;
    padding: 16px 12px;
  }

  .trajectory-header h3 {
    font-size: 16px;
    margin-bottom: 8px;
  }

  .trajectory-description {
    font-size: 12px;
    padding: 10px;
    line-height: 1.5;
  }

  .trajectory-canvas-container {
    padding: 4px;
    padding-top: 24px;
    margin: 16px -8px;
  }

  #recoveryTrajectoryChart {
    max-height: 280px;
  }

  .trajectory-legend {
    font-size: 11px;
    padding-top: 12px;
    margin-top: 12px;
  }

  /* Save status mobile */
  .save-status {
    font-size: 12px;
    padding: 6px 10px;
  }

  /* Ensure no element causes overflow */
  * {
    max-width: 100%;
  }

  img {
    max-width: 100%;
    height: auto;
  }

  /* App-like header on mobile */
  .wizard-header {
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding-top: max(env(safe-area-inset-top, 20px), 20px);
  }

  /* Mobile Bottom Navigation */
  .wizard-nav {
    display: none !important;
  }

  .mobile-bottom-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 16px;
    padding-bottom: calc(env(safe-area-inset-bottom, 12px) + 12px);
    border-top: 1px solid var(--glass-border);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    gap: 16px;
  }

  .mobile-nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex: 1;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.3);
  }

  .mobile-nav-btn:active {
    transform: scale(0.97);
  }

  .mobile-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }

  .mobile-nav-btn.btn-back {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text);
    box-shadow: none;
  }

  .mobile-step-indicator {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap;
    padding: 0 8px;
  }

  .nav-icon {
    font-size: 18px;
    line-height: 1;
  }

  /* Add padding to content to prevent overlap with bottom nav */
  .wizard-content {
    padding-bottom: 100px;
  }

  /* Enhanced mobile cards */
  .form-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    border: 1px solid rgba(255, 255, 255, 0.4);
  }

  .form-section:active {
    transform: scale(0.99);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  }

  /* Enhanced mobile step circles */
  .wizard-steps {
    padding: 0 20px;
    gap: 12px;
  }

  .step-circle {
    width: 36px;
    height: 36px;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .step.active .step-circle {
    transform: scale(1.25);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3),
                0 0 0 8px rgba(255, 255, 255, 0.15);
    animation: pulse 2s ease-in-out infinite;
  }

  @keyframes pulse {
    0%, 100% {
      box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
    }
    50% {
      box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.2);
    }
  }

  .step.completed .step-circle {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  }
}

/* Desktop only - hide mobile nav */
@media (min-width: 769px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}
