/*
 * ==========================================================================
 * FysioJaap - Professional Healthcare Design System
 * ==========================================================================
 *
 * BRAND PHILOSOPHY:
 * A harmonious blend of professional healthcare expertise with a warm,
 * empathetic approach. This design system embodies trust, calm, and 
 * reassurance through thoughtful use of color, typography, and space.
 *
 * DESIGN PRINCIPLES:
 * - Organic & Natural: Soft curves and earth-toned palette
 * - Professional & Trustworthy: Clean layouts with clear hierarchy
 * - Accessible & Inclusive: WCAG compliant with thoughtful interactions
 * - Performant & Modern: Optimized for speed and user experience
 *
 * ==========================================================================
 */

/* ==========================================================================
   2. DESIGN TOKENS & CSS CUSTOM PROPERTIES
   ========================================================================== */

:root {
  /* Brand Colors - Fysiojaap Earth Palette */
  --color-primary: #1E4635;           /* Deep Forest Green */
  --color-secondary: #5E7A60;         /* Sage Green */
  --color-background: #F5F1E9;        /* Warm Cream */
  --color-white: #FFFFFF;             /* Pure White */
  
  /* Semantic Color System */
  --color-surface: var(--color-white);
  --color-surface-alt: #FBF8F2;
  --color-surface-hover: #FDFCFA;
  --color-text-primary: var(--color-primary);
  --color-text-secondary: #5a695b;
  --color-text-muted: #889088;
  --color-accent: var(--color-secondary);
  --color-accent-hover: #4a614c;
  --color-accent-light: rgba(94, 122, 96, 0.08);
  --color-accent-medium: rgba(94, 122, 96, 0.15);
  --color-accent-contrast: var(--color-white);
  --color-border: #E1DCD1;
  --color-border-light: #EAE5DB;
  --color-focus-ring: rgba(94, 122, 96, 0.35);
  
  /* State Colors */
  --color-success: #5E7A60;
  --color-warning: #D4A574;
  --color-error: #C66B5D;
  --color-info: var(--color-secondary);

  /* Typography System */
  --font-family-heading: 'Playfair Display', Georgia, serif;
  --font-family-body: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Font Weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Font Sizes - Fluid Typography */
  --font-size-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --font-size-sm: clamp(0.8125rem, 0.75rem + 0.3vw, 0.875rem);
  --font-size-base: clamp(0.9375rem, 0.875rem + 0.3vw, 1rem);
  --font-size-md: clamp(1.0625rem, 1rem + 0.3vw, 1.125rem);
  --font-size-lg: clamp(1.1875rem, 1.125rem + 0.3vw, 1.25rem);
  --font-size-xl: clamp(1.375rem, 1.25rem + 0.6vw, 1.5rem);
  --font-size-2xl: clamp(1.625rem, 1.5rem + 0.6vw, 1.875rem);
  --font-size-3xl: clamp(2rem, 1.75rem + 1.25vw, 2.25rem);
  --font-size-4xl: clamp(2.5rem, 2rem + 2.5vw, 3rem);

  /* Line Heights */
  --line-height-tight: 1.2;
  --line-height-base: 1.6;
  --line-height-relaxed: 1.75;

  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Border Radius - Organic Feel */
  --border-radius-sm: 6px;
  --border-radius-md: 10px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;
  --border-radius-pill: 50px;
  --border-radius-full: 9999px;
  
  /* Borders */
  --border-width: 1px;
  --border-width-thick: 3px;

  /* Shadows - Subtle & Natural */
  --shadow-xs: 0 1px 2px rgba(30, 70, 53, 0.04);
  --shadow-sm: 0 2px 4px rgba(30, 70, 53, 0.06), 0 1px 2px rgba(30, 70, 53, 0.04);
  --shadow-md: 0 4px 8px rgba(30, 70, 53, 0.08), 0 2px 4px rgba(30, 70, 53, 0.04);
  --shadow-lg: 0 8px 16px rgba(30, 70, 53, 0.1), 0 4px 8px rgba(30, 70, 53, 0.05);
  --shadow-xl: 0 16px 32px rgba(30, 70, 53, 0.12), 0 8px 16px rgba(30, 70, 53, 0.06);

  /* Motion & Animation */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 200ms;
  --duration-moderate: 350ms;
  --duration-slow: 500ms;

  /* Layout Constants */
  --layout-container-width: 1140px;
  --layout-sidebar-width: 280px;
  --layout-header-height: 64px;

  /* Z-Index Scale */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 400;
  --z-modal: 500;
  --z-toast: 600;
  --z-tooltip: 700;
  --z-top: 900;

  /* Feature Flags */
  color-scheme: light dark;
}

/* Dark Mode Theme */
@media (prefers-color-scheme: dark) {
  :root {
    --color-background: #1A3029;
    --color-surface: #1E4635;
    --color-surface-alt: #234539;
    --color-surface-hover: #2A5443;
    --color-text-primary: #F5F1E9;
    --color-text-secondary: #C4BDAE;
    --color-text-muted: #A6A095;
    --color-accent: #8DB08E;
    --color-accent-hover: #A5C4A7;
    --color-accent-light: rgba(141, 176, 142, 0.12);
    --color-accent-medium: rgba(141, 176, 142, 0.24);
    --color-accent-contrast: var(--color-primary);
    --color-border: #3A5547;
    --color-border-light: #2F4A3C;
    --color-focus-ring: rgba(141, 176, 142, 0.4);
    
    /* Adjust shadows for dark mode */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 16px 32px rgba(0, 0, 0, 0.35);
  }
}


/* ==========================================================================
   3. RESET & BASE STYLES
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--color-background);
  color: var(--color-text-primary);
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  font-weight: var(--font-weight-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

/* Subtle Background Texture */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 30%, var(--color-accent-light) 0%, transparent 35%),
    radial-gradient(circle at 80% 70%, var(--color-accent-light) 0%, transparent 40%);
  opacity: 0.4;
  z-index: -1;
  pointer-events: none;
}

/* Text Selection */
::selection {
  background-color: var(--color-accent-medium);
  color: var(--color-text-primary);
}


/* ==========================================================================
   4. ACCESSIBILITY & FOCUS STATES
   ========================================================================== */

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-md);
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--border-radius-pill);
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
  z-index: var(--z-top);
  transition: top var(--duration-fast) var(--ease-out-expo);
}

.skip-link:focus {
  top: var(--space-md);
}

/* Focus Visible States */
:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--color-focus-ring);
  border-radius: var(--border-radius-sm);
}

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


/* ==========================================================================
   5. LAYOUT COMPONENTS
   ========================================================================== */

/* App Container */
#app, .layout-container {
  height: 100vh;
  overflow: hidden;
}

.layout-container {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
}

/* Main Content Area */
.main-content {
  padding: var(--space-xl) var(--space-lg);
  overflow-y: auto;
  opacity: 0;
  animation: fadeIn var(--duration-moderate) var(--ease-smooth) forwards;
}

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

#app-root {
  max-width: var(--layout-container-width);
  width: 100%;
  margin: 0 auto;
}

/* Sidebar Navigation */
.sidebar-nav {
  display: none;
  background: var(--color-surface-alt);
  border-right: var(--border-width) solid var(--color-border-light);
  padding: var(--space-xl) var(--space-lg);
  overflow-y: auto;
  flex-direction: column;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding-bottom: var(--space-lg);
  margin-bottom: var(--space-lg);
  border-bottom: var(--border-width) solid var(--color-border-light);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: var(--space-lg);
  border-top: var(--border-width) solid var(--color-border-light);
}

/* Mobile Header */
.mobile-header {
  display: flex;
  height: var(--layout-header-height);
  background: color-mix(in srgb, var(--color-background) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: var(--border-width) solid var(--color-border-light);
  padding: 0 var(--space-lg);
  align-items: center;
  justify-content: space-between;
  z-index: var(--z-sticky);
}


/* ==========================================================================
   6. TYPOGRAPHY
   ========================================================================== */

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-md);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-md); }

/* Body Text */
p {
  margin: 0 0 var(--space-lg);
  max-width: 65ch;
}

.lead {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-normal);
  max-width: 60ch;
}

/* Links */
a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--ease-smooth);
}

a:hover {
  color: var(--color-accent-hover);
}

/* Brand Logo */
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--color-text-primary);
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
  transition: transform var(--duration-fast) var(--ease-out-expo),
              color var(--duration-fast) var(--ease-smooth);
}

.brand-logo:hover {
  color: var(--color-accent);
  transform: translateY(-1px);
}

.sidebar-header .logo-text {
  font-size: var(--font-size-md); /* Slightly smaller to fit "Burnout Coach" */
}

button.brand-logo {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.mobile-header .logo-text {
  font-size: var(--font-size-md);
}

.brand-logo-img {
  flex-shrink: 0;
  color: var(--color-accent);
  height: 28px;
  width: 28px;
}

.sidebar-header .brand-logo-img {
  height: 32px;
  width: 32px;
}


/* ==========================================================================
   7. COMPONENTS
   ========================================================================== */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px 32px;
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  border: none;
  border-radius: var(--border-radius-pill);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: var(--border-radius-full);
  background: rgba(255, 255, 255, 0.15);
  transform: translate(-50%, -50%);
  transition: width var(--duration-moderate) var(--ease-out-expo),
              height var(--duration-moderate) var(--ease-out-expo);
}

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

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

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-accent-contrast);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text-primary);
  border: var(--border-width) solid var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-surface-hover);
  border-color: var(--color-accent);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
}

.btn-outline:hover:not(:disabled) {
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  transform: translateY(-1px);
}

.btn-lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--font-size-lg);
}

.btn-full {
  width: 100%;
}

/* Reset Button */
.reset-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  border-radius: var(--border-radius-md);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.reset-button:hover {
  background: var(--color-surface-hover);
  color: var(--color-accent);
  transform: translateY(-1px);
}

.reset-button span {
  display: none;
}

/* ---------- Cards ---------- */
.card {
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border-light);
  border-radius: var(--border-radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-xs);
  transition: all var(--duration-fast) var(--ease-smooth);
}

.card-interactive {
  cursor: pointer;
}

.card-interactive:hover,
.card-interactive:focus-within {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.card-title {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-sm);
}

.card-description {
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-md);
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.form-input {
  display: block;
  width: 100%;
  padding: var(--space-md);
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--border-radius-md);
  transition: all var(--duration-fast) var(--ease-smooth);
}

.form-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
  outline: none;
}

.form-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-sm);
  color: var(--color-text-secondary);
}

textarea.form-input {
  min-height: 80px;
  line-height: var(--line-height-base);
}

.radio-group-horizontal {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.radio-option-sm {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.radio-option-sm:hover {
  border-color: var(--color-accent-medium);
}

.radio-option-sm.is-checked {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
  font-weight: var(--font-weight-semibold);
}

.radio-option-sm input[type="radio"] {
  accent-color: var(--color-accent);
}

.time-preference-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  background: var(--color-surface-alt);
  padding: var(--space-md);
  border-radius: var(--border-radius-md);
}

.time-preference-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.chip-option {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-pill);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  background: var(--color-surface);
}

.chip-option:hover {
  border-color: var(--color-accent-medium);
  transform: translateY(-1px);
}

.chip-option.is-checked {
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}


/* Radio Options */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 2px solid var(--color-border-light);
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.radio-option:hover {
  border-color: var(--color-accent-medium);
  background: var(--color-surface-hover);
  transform: translateX(4px);
}

.radio-option input[type="radio"] {
  margin-top: 0.25rem;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--color-accent);
}

.radio-option.is-checked {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
  box-shadow: var(--shadow-sm);
}

.radio-option-label {
  flex: 1;
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-base);
}

/* ---------- Navigation ---------- */
.main-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.main-nav a,
.methods-nav-list a {
  position: relative;
  display: block;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-radius-md);
  border-left: var(--border-width-thick) solid transparent;
  font-weight: var(--font-weight-medium);
  transition: all var(--duration-fast) var(--ease-smooth);
}

.main-nav a:hover,
.methods-nav-list a:hover {
  color: var(--color-text-primary);
  background: var(--color-surface-hover);
  transform: translateX(4px);
}

.main-nav a.active,
.main-nav a[aria-current="page"],
.methods-nav-list a.active,
.methods-nav-list a[aria-current="page"] {
  color: var(--color-text-primary);
  background: var(--color-surface);
  border-left-color: var(--color-accent);
  font-weight: var(--font-weight-semibold);
  box-shadow: var(--shadow-sm);
}

/* Recommended Methods Navigation */
.recommended-methods-nav {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border-light);
}

.nav-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
}

.methods-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.nav-info-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  padding: var(--space-sm) var(--space-md);
  text-align: center;
}

/* ---------- Progress Indicators ---------- */
.scroll-indicator-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
  min-width: 0;
}

.scroll-progress-container {
  width: 4px;
  height: 32px;
  background: var(--color-border-light);
  border-radius: var(--border-radius-full);
  overflow: hidden;
}

.scroll-progress-bar {
  width: 100%;
  height: 100%;
  background-color: var(--color-accent);
  transform-origin: top;
  transform: scaleY(0);
  transition: transform 100ms linear;
}

/* Progress Bar */
.progress-bar {
  height: 8px;
  background: var(--color-border-light);
  border-radius: var(--border-radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--color-accent);
  border-radius: var(--border-radius-full);
  transition: width var(--duration-moderate) var(--ease-out-expo);
}

/* ---------- Loading & Feedback ---------- */
.loading-screen {
  display: grid;
  place-items: center;
  min-height: 400px;
  gap: var(--space-lg);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border-light);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  background: var(--color-primary);
  color: var(--color-white);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-xl);
  max-width: 420px;
  pointer-events: auto;
  animation: slideInUp var(--duration-moderate) var(--ease-out-expo);
}

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

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius-pill);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
}

.badge-primary {
  background: var(--color-accent-light);
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* ---------- Accordion ---------- */
.accordion-section {
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: var(--space-md);
}

.accordion-summary {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  padding: var(--space-md) 0;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color var(--duration-fast) var(--ease-smooth);
}

.accordion-summary::-webkit-details-marker {
  display: none;
}

.accordion-summary:hover {
  color: var(--color-accent);
}

.accordion-summary::after {
  content: '+';
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-normal);
  color: var(--color-accent);
  transition: transform var(--duration-fast) var(--ease-out-expo);
}

.accordion-section[open] > .accordion-summary::after {
  transform: rotate(45deg);
}

.accordion-content {
  padding-bottom: var(--space-lg);
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.modal-panel {
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  max-width: 600px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal-header {
  padding: var(--space-lg);
  flex-shrink: 0;
  border-bottom: 1px solid var(--color-border-light);
}

.modal-header h2 {
  margin-bottom: var(--space-sm);
}

.modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
  flex-grow: 1;
}

.modal-footer {
  padding: var(--space-lg);
  flex-shrink: 0;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  background: var(--color-surface-alt);
  border-bottom-left-radius: var(--border-radius-lg);
  border-bottom-right-radius: var(--border-radius-lg);
}

.modal-close-btn {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  z-index: var(--z-top);
}

.modal-close-btn::before,
.modal-close-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 2px;
  background-color: var(--color-text-secondary);
  transition: transform var(--duration-fast) var(--ease-out-expo);
}

.modal-close-btn::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.modal-close-btn::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.modal-close-btn:hover::before,
.modal-close-btn:hover::after {
  background-color: var(--color-accent);
  transform: translate(-50%, -50%) scale(1.1) rotate(45deg);
}

.modal-close-btn:hover::after {
  transform: translate(-50%, -50%) scale(1.1) rotate(-45deg);
}


/* ==========================================================================
   8. PAGE SECTIONS
   ========================================================================== */

/* ---------- Hero Section ---------- */
.hero-section {
  text-align: center;
  padding: var(--space-4xl) var(--space-lg);
  margin-bottom: var(--space-3xl);
  position: relative;
  border-bottom: 1px solid var(--color-border-light);
}

.hero-title {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-4xl);
  color: var(--color-text-primary);
  margin-bottom: var(--space-md);
}

.hero-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  max-width: 65ch;
  margin: 0 auto var(--space-xl);
  line-height: var(--line-height-relaxed);
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Process Steps ---------- */
.process-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-xl);
  margin: var(--space-3xl) 0;
}

.home-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  margin-top: var(--space-2xl);
}

@media (min-width: 62em) {
  .home-layout {
    grid-template-columns: 2fr 1fr;
    align-items: start;
  }
}

.step {
  text-align: center;
  padding: var(--space-lg);
}

.step-number {
  width: 3rem;
  height: 3rem;
  background-color: var(--color-accent);
  color: var(--color-accent-contrast);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin: 0 auto var(--space-md);
  box-shadow: var(--shadow-sm);
}

.step-title {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-sm);
}

.step-description {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
}

/* ---------- Quiz Section ---------- */
.quiz-container {
  max-width: 700px;
  margin: 0 auto;
}

.quiz-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.quiz-progress {
  margin-bottom: var(--space-xl);
}

.quiz-progress-text {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.question-text {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-xl);
  text-align: center;
  color: var(--color-text-primary);
}

.quiz-navigation {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: var(--space-2xl);
}

/* ---------- Profile Result ---------- */
.style-result {
  background: var(--color-surface);
  border: 2px solid var(--color-accent);
  border-radius: var(--border-radius-xl);
  padding: var(--space-2xl);
  text-align: center;
  max-width: 600px;
  margin: var(--space-2xl) auto;
  box-shadow: var(--shadow-lg);
}

.style-icon {
  font-size: 5rem;
  margin-bottom: var(--space-md);
}

.style-name {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-3xl);
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}

.style-description {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-lg);
}

.style-traits {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Methods & Practices ---------- */
.recommended-method {
  position: relative;
  background: var(--color-accent-light);
  border: 2px solid var(--color-accent);
  border-radius: var(--border-radius-xl);
  padding: var(--space-2xl);
  margin-bottom: var(--space-2xl);
  box-shadow: var(--shadow-md);
}

.recommended-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--color-accent);
  color: var(--color-accent-contrast);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--border-radius-pill);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  box-shadow: var(--shadow-md);
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.method-name {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-sm);
}

.method-summary {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
  line-height: var(--line-height-relaxed);
}

.method-badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-accent-medium);
  color: var(--color-accent);
  border-radius: var(--border-radius-pill);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

/* Category Section */
.category-section {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border-light);
  margin-top: var(--space-2xl);
}

.category-title {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-xl);
  text-align: center;
  color: var(--color-text-primary);
}

.all-methods-page .category-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

/* Method Details */
.method-details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  margin-top: var(--space-2xl);
}

.method-section {
  margin-bottom: var(--space-2xl);
}

.method-sidebar-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.sidebar-card {
  background: var(--color-surface);
  padding: var(--space-lg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
}

.sidebar-card h3 {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-md);
}

.sidebar-card p,
.sidebar-card li {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

.steps-list,
.bullet-list {
  padding-left: var(--space-lg);
  margin: 0;
}

.steps-list li,
.bullet-list li {
  margin-bottom: var(--space-md);
}


.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  max-width: 100%;
  background: #000;
  border-radius: var(--border-radius-lg);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   9. UTILITY CLASSES
   ========================================================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

.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;
}


/* ==========================================================================
   10. RESPONSIVE DESIGN
   ========================================================================== */

/* Tablet and Desktop */
@media (min-width: 48em) {
  .main-content {
    padding: var(--space-2xl) var(--space-xl);
  }
  
  .hero-section {
    padding: var(--space-4xl) var(--space-2xl);
  }
}

/* Desktop */
@media (min-width: 62em) {
  .layout-container {
    grid-template-columns: var(--layout-sidebar-width) 1fr;
    grid-template-rows: 1fr;
  }
  
  .sidebar-nav {
    display: flex;
  }
  
  .reset-button span {
    display: inline;
  }
  
  .mobile-header {
    display: none;
  }
  
  .main-content {
    padding: var(--space-3xl) var(--space-4xl);
  }
  
  .method-details-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: var(--space-3xl);
  }
  
  .method-sidebar-content {
    position: sticky;
    top: var(--space-xl);
    align-self: start;
  }
}

/* Mobile */
@media (max-width: 47.99em) {
  .hero-actions {
    flex-direction: column;
  }
  
  .btn-full-mobile {
    width: 100%;
  }
  
  .toast-container {
    right: var(--space-md);
    left: var(--space-md);
    bottom: var(--space-md);
  }
  
  .toast {
    max-width: none;
  }
  
  .process-steps {
    grid-template-columns: 1fr;
  }
  
  .method-grid {
    grid-template-columns: 1fr;
  }
}

/* Print Styles */
@media print {
  body {
    background: white;
    color: black;
  }
  
  .sidebar-nav,
  .mobile-header,
  .hero-actions,
  .quiz-navigation,
  .btn,
  .toast-container {
    display: none !important;
  }
  
  .main-content {
    padding: 0;
    max-width: 100%;
  }
}


/* ==========================================================================
   END OF STYLESHEET
   ========================================================================== */