﻿/* ============================================================
   Portal Theme - Core Variables & Base Styles
   Typography is loaded via <link rel="stylesheet"> in
   web-templates/header.html. See CLAUDE.md Fonts rules.
   ============================================================ */


/* ============================================================
   SMJV Portal Theme - Core Variables & Base Styles
   ============================================================ */

:root {
  /* SMJV Cut Angle */
  --cut-angle: 14deg;

  /* Spacing Scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 32px;
  --space-4xl: 48px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-full: 50px;

  /* Font Sizes */
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 22px;
  --font-size-2xl: 28px;
  --font-size-3xl: 36px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
  --transition-slower: 0.5s ease;

  /* Brand Colors */
  --primary: #2C704F;
  --primary-dark: #1E5038;
  --accent: #FFA300;
  --teal: #009382;
  --highlight: #22D3C5;
  --accent-warm: #C8893C;

  /* Overlay/Gradient Colors - Dynamic per theme */
  --overlay-primary: rgba(44, 112, 79, 0.55);
  --overlay-primary-dark: rgba(30, 80, 56, 0.65);
  --gradient-accent: #1E5038;

  /* Hero overlay - full gradient definition (can be overridden per theme) */
  --hero-overlay: linear-gradient(135deg, var(--overlay-primary) 0%, var(--overlay-primary-dark) 100%);

  /* Stage/card header gradient (can be overridden per theme - solid for Surerus) */
  --stage-gradient: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);

  /* Text Colors */
  --text-primary: #1A1A1A;
  --text-secondary: #555559;
  --text-tertiary: #888888;
  --warm-grey: #A79B94;
  --cool-grey: #555559;
  --cool-grey-light: #C9C8C7;
  --border-subtle: #EBEBEB;

  /* Feedback Colors */
  --error: #D13438;
  --error-light: rgba(209, 52, 56, 0.08);
  --error-border: rgba(209, 52, 56, 0.3);
  --success: #2C704F;
  --success-border: rgba(44, 112, 79, 0.3);
  --success-dark: #1E5038;
  --warning: #C8893C;
  --info: #009382;

  /* Surface Colors */
  --background: #FAFAFA;
  --surface: #FFFFFF;
  --surface-alt: #F0F0F0;
  --surface-raised: #F5F5F5;
  --surface-hover: #EBEBEB;
  --border: #E5E5E5;

  /* Background Overlays */
  --overlay-dark: rgba(0, 0, 0, 0.5);
  --overlay-dark-strong: rgba(0, 0, 0, 0.7);
  --overlay-white: rgba(255, 255, 255, 0.1);
  --overlay-white-strong: rgba(255, 255, 255, 0.2);
  --overlay-white-solid: rgba(255, 255, 255, 0.9);
  --overlay-white-05: rgba(255, 255, 255, 0.05);
  --overlay-white-06: rgba(255, 255, 255, 0.06);
  --overlay-white-12: rgba(255, 255, 255, 0.12);
  --overlay-white-15: rgba(255, 255, 255, 0.15);
  --overlay-white-18: rgba(255, 255, 255, 0.18);
  --overlay-white-25: rgba(255, 255, 255, 0.25);
  --overlay-white-30: rgba(255, 255, 255, 0.30);
  --overlay-white-40: rgba(255, 255, 255, 0.40);
  --overlay-white-50: rgba(255, 255, 255, 0.50);
  --overlay-white-60: rgba(255, 255, 255, 0.60);
  --overlay-white-70: rgba(255, 255, 255, 0.70);
  --overlay-white-80: rgba(255, 255, 255, 0.80);
  --overlay-dark-15: rgba(0, 0, 0, 0.15);
  --overlay-dark-40: rgba(0, 0, 0, 0.40);

  /* Sidebar Locked State */
  --sidebar-locked: rgba(255, 255, 255, 0.35);
  --sidebar-locked-subtle: rgba(255, 255, 255, 0.2);

  /* Feedback Backgrounds */
  --success-bg: #d1fae5;
  --error-bg: #fef2f2;
  --warning-bg: #fef7e6;
  --info-bg: rgba(0, 147, 130, 0.08);
  --danger-bg: rgba(209, 52, 56, 0.06);
  --danger-border: rgba(209, 52, 56, 0.2);
  --info-border: rgba(0, 147, 130, 0.12);

  /* Accent Variants */
  --accent-hover: #ffb833;
  --accent-light: rgba(255, 163, 0, 0.1);
  --accent-glow: rgba(255, 163, 0, 0.4);
  --accent-glow-strong: rgba(255, 163, 0, 0.6);

  /* RGB channel variables for rgba() composition */
  --accent-rgb: 255, 163, 0;
  --teal-rgb: 0, 147, 130;
  --error-rgb: 209, 52, 56;

  /* Additional overlay used in video backgrounds */
  --overlay-black-dark: rgba(0, 0, 0, 0.55);

  /* Scan Visual */
  --scan-visual-bg: linear-gradient(135deg, #0a1a14 0%, #0f2b1f 50%, #0a1a14 100%);

  /* Teal Variants */
  --teal-dark: #007A6A;
  --teal-subtle: rgba(0, 147, 130, 0.03);
  --teal-light: rgba(0, 147, 130, 0.05);
  --teal-medium: rgba(0, 147, 130, 0.1);

  /* Common Gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  --gradient-primary-accent: linear-gradient(135deg, var(--primary), var(--accent));
  --gradient-primary-teal: linear-gradient(135deg, var(--primary), var(--teal));
  --gradient-teal-primary: linear-gradient(135deg, var(--teal), var(--primary));
  --gradient-accent-warm: linear-gradient(135deg, var(--accent), var(--accent-warm));
  --gradient-highlight-teal: linear-gradient(135deg, var(--highlight), var(--teal));
  --gradient-gold: linear-gradient(135deg, #FFC629, #FFD75E);
  --splash-welcome-accent: #FFA300;
  --splash-welcome-accent-hover: #ffb833;
  --splash-welcome-gradient: linear-gradient(135deg, #FFA300 0%, #FFD080 100%);
  --splash-accent-gradient-end: #FFD080;
  --splash-text-muted: rgba(255, 255, 255, 0.6);
  --gradient-status: linear-gradient(135deg, var(--primary-focus-shadow), var(--accent-light));
  --gradient-subtle-blend: linear-gradient(135deg, var(--primary-hover-bg) 0%, var(--accent-subtle) 100%);
  --gradient-primary-surface: linear-gradient(135deg, var(--primary-hover-bg) 0%, var(--surface) 100%);
  --gradient-teal-surface: linear-gradient(135deg, var(--teal-subtle) 0%, var(--surface) 100%);

  /* Horizontal Feedback Gradients (90deg) */
  --gradient-success-h: linear-gradient(90deg, var(--primary-subtle) 0%, var(--surface) 100%);
  --gradient-error-h: linear-gradient(90deg, var(--error-light) 0%, var(--surface) 100%);
  --gradient-error-bg-h: linear-gradient(90deg, rgba(209, 52, 56, 0.06) 0%, var(--background) 100%);
  --gradient-warning-h: linear-gradient(90deg, var(--warning-bg) 0%, var(--surface) 100%);
  --gradient-info-h: linear-gradient(90deg, var(--info-bg) 0%, var(--surface) 100%);
  --gradient-progress-h: linear-gradient(90deg, var(--primary), var(--accent));

  /* Additional Gradients */
  --gradient-accent-button: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  --gradient-teal-dark: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  --gradient-background-subtle: linear-gradient(135deg, #F8F9FA 0%, #E8F5F0 100%);
  --gradient-grid-pattern: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);

  /* Shadows */
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-4: 0 2px 4px rgba(0, 0, 0, 0.08);
  --shadow-8: 0 4px 8px rgba(0, 0, 0, 0.08);
  --shadow-16: 0 8px 16px rgba(0, 0, 0, 0.1);
  --shadow-28: 0 14px 28px rgba(0, 0, 0, 0.12);
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);

  /* Layout */
  --header-height: 74px;
  --footer-height: 36px;
  --main-containersubtracted: 110px;
  --sidebar-width: 320px;
  --sidebar-collapsed-width: 60px;

  /* Typography */
  --font-family: 'Inter', Arial, sans-serif;
  --font-family-display: 'Barlow Condensed', Arial, sans-serif;

  /* Layout */
  --container-max-width: 1400px;
  /* Neutral Palette - use these instead of raw hex for white/black/greys.
     Semantic tokens above (--text-primary, --surface, --border) should be
     preferred where meaning is clear; fall back to neutrals only for
     decorative cases (dividers, shadows, overlays). */
  --white: #FFFFFF;
  --black: #000000;
  --gray-50:  #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-200: #EBEBEB;
  --gray-300: #E5E5E5;
  --gray-400: #C9C8C7;
  --gray-500: #A79B94;
  --gray-600: #6E6E72;
  --gray-700: #555559;
  --gray-800: #2B2B2E;
  --gray-900: #1A1A1A;

  /* Motion Tokens - composable duration + easing.
     Prefer these over --transition-* when you need to mix-and-match,
     e.g. transition: opacity var(--duration-base) var(--easing-standard). */
  --duration-instant: 0.1s;
  --duration-fast: 0.15s;
  --duration-base: 0.2s;
  --duration-slow: 0.3s;
  --duration-slower: 0.5s;
  --duration-slowest: 0.8s;

  --easing-standard: ease;
  --easing-snappy: cubic-bezier(0.4, 0, 0.2, 1);
  --easing-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --easing-bounce: cubic-bezier(0.68, -0.55, 0.27, 1.55);
  --easing-decelerate: cubic-bezier(0, 0, 0.2, 1);
  --easing-accelerate: cubic-bezier(0.4, 0, 1, 1);

  /* Z-Index Scale - use these instead of magic numbers.
     Header/footer are 500 by design (see CLAUDE.md layout architecture).
     Splash layers sit above --z-tooltip because the page-load splash must
     cover every other layer including toasts/tooltips during boot. */
  --z-base: 1;
  --z-raised: 10;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 500;
  --z-modal-backdrop: 900;
  --z-modal: 1000;
  --z-popover: 1100;
  --z-toast: 1200;
  --z-tooltip: 1300;
  --z-splash-backdrop: 1400;
  --z-splash: 1500;

  /* Gradient Style Marker - themes declare their gradient personality here.
     Value is one of: soft (default blend) | hard-75 (Surerus 75/25 stop).
     Page CSS should not branch on this directly -- use the named gradient
     variables (--gradient-primary, --stage-gradient) which are already
     overridden per theme. This token is purely informational / for lint tools. */
  --gradient-style: soft;
}

/* ==========================================================================
   Company Theme Overrides - Class-Based Theming
   Applied via Liquid in Header based on company ID
   ========================================================================== */

/* Default Theme (SMJV/Murphy) - Green/Orange */
body.theme-smjv {
  --primary: #2C704F;
  --primary-dark: #1E5038;
  --accent: #FFA300;
  --teal: #009382;
  --highlight: #22D3C5;
  --success: #2C704F;
  --info: #009382;
  --overlay-primary: rgba(44, 112, 79, 0.55);
  --overlay-primary-dark: rgba(30, 80, 56, 0.65);
  --gradient-accent: #1E5038;
  --hero-overlay: linear-gradient(135deg, rgba(44, 112, 79, 0.55) 0%, rgba(30, 80, 56, 0.65) 100%);
  --stage-gradient: linear-gradient(135deg, #2C704F 0%, #1E5038 100%);
  /* Opacity variants for hover/focus states */
  --primary-hover-bg: rgba(44, 112, 79, 0.05);
  --primary-subtle: rgba(44, 112, 79, 0.08);
  --primary-focus-shadow: rgba(44, 112, 79, 0.1);
  --primary-light: rgba(44, 112, 79, 0.15);
  --primary-focus-ring: rgba(44, 112, 79, 0.2);
  --primary-shadow: rgba(44, 112, 79, 0.3);
  --primary-shadow-strong: rgba(44, 112, 79, 0.4);
  --teal-light: rgba(0, 147, 130, 0.05);
  --accent-subtle: rgba(255, 163, 0, 0.04);
  --accent-light: rgba(255, 163, 0, 0.1);
  --accent-glow: rgba(255, 163, 0, 0.4);
  --accent-glow-strong: rgba(255, 163, 0, 0.6);
  --accent-hover: #ffb833;
  --scan-visual-bg: linear-gradient(135deg, #0a1a14 0%, #0f2b1f 50%, #0a1a14 100%);
  --gradient-primary: linear-gradient(135deg, #2C704F 0%, #1E5038 100%);
  --gradient-primary-accent: linear-gradient(135deg, #2C704F, #FFA300);
  --gradient-primary-teal: linear-gradient(135deg, #2C704F, #009382);
  --gradient-teal-primary: linear-gradient(135deg, #009382, #2C704F);
  --gradient-accent-warm: linear-gradient(135deg, #FFA300, #C8893C);
  --gradient-progress-h: linear-gradient(90deg, #2C704F, #009382);
  --gradient-accent-light: linear-gradient(135deg, var(--accent) 0%, #FFD080 100%);
  --info-bg: rgba(91, 155, 213, 0.08);
  --info-border: rgba(91, 155, 213, 0.25);
  --splash-overlay-tint: rgba(30, 80, 56, 0.82);
  --gradient-osp-hero: linear-gradient(160deg, #1a5c3a 0%, #2C704F 30%, #237a4a 60%, #1a5c3a 100%);
}

/* WHC Theme - Navy/Red */
body.theme-whc {
  --primary: #221f5d;
  --primary-dark: #1a1847;
  --accent: #c2323c;
  --teal: #009382;
  --highlight: #1f4183;
  --success: #009382;
  --info: #1f4183;
  --overlay-primary: rgba(34, 31, 93, 0.55);
  --overlay-primary-dark: rgba(26, 24, 71, 0.65);
  --gradient-accent: #1a1847;
  --hero-overlay: linear-gradient(135deg, rgba(34, 31, 93, 0.55) 0%, rgba(26, 24, 71, 0.65) 100%);
  --stage-gradient: linear-gradient(135deg, #221f5d 0%, #1a1847 100%);
  /* Opacity variants for hover/focus states */
  --primary-hover-bg: rgba(34, 31, 93, 0.05);
  --primary-subtle: rgba(34, 31, 93, 0.08);
  --primary-focus-shadow: rgba(34, 31, 93, 0.1);
  --primary-light: rgba(34, 31, 93, 0.15);
  --primary-focus-ring: rgba(34, 31, 93, 0.2);
  --primary-shadow: rgba(34, 31, 93, 0.3);
  --primary-shadow-strong: rgba(34, 31, 93, 0.4);
  --teal-light: rgba(0, 147, 130, 0.05);
  --accent-subtle: rgba(194, 50, 60, 0.04);
  --accent-light: rgba(194, 50, 60, 0.1);
  --accent-glow: rgba(194, 50, 60, 0.4);
  --accent-glow-strong: rgba(194, 50, 60, 0.6);
  --accent-rgb: 194, 50, 60;
  --accent-hover: #a82832;
  --scan-visual-bg: linear-gradient(135deg, #0a0a1e 0%, #111140 50%, #0a0a1e 100%);
  --gradient-primary: linear-gradient(135deg, #221f5d 0%, #1a1847 100%);
  --gradient-primary-accent: linear-gradient(135deg, #221f5d, #c2323c);
  --gradient-primary-teal: linear-gradient(135deg, #221f5d, #009382);
  --gradient-teal-primary: linear-gradient(135deg, #009382, #221f5d);
  --gradient-accent-warm: linear-gradient(135deg, #c2323c, #a82832);
  --gradient-progress-h: linear-gradient(90deg, #221f5d, #009382);
  --gradient-accent-light: linear-gradient(135deg, var(--accent) 0%, rgba(194, 50, 60, 0.4) 100%);
  --info-bg: rgba(91, 155, 213, 0.08);
  --info-border: rgba(91, 155, 213, 0.25);
  --splash-overlay-tint: rgba(26, 27, 75, 0.82);
  --gradient-osp-hero: linear-gradient(160deg, #0e0d3a 0%, #221f5d 30%, #1a1847 60%, #0e0d3a 100%);
}

/* Surerus Theme - Gold/Charcoal */
/* Note: Surerus uses hard color stops (no soft blends) for gradients */
/* Gold is primary (buttons), Charcoal in gradients/backgrounds */
body.theme-surerus {
  --primary: #C8893C;
  --primary-dark: #555559;
  --primary-darker: #3a3a3d;
  --accent: #C8893C;
  --teal: #C8893C;
  --highlight: #C9A30D;
  --success: #2C704F;
  --info: #C9A30D;
  --text-primary: #1A1A1A;
  --overlay-primary: rgba(85, 85, 89, 0.55);
  --overlay-primary-dark: rgba(65, 65, 69, 0.65);
  --gradient-accent: #C9A30D;
  --hero-overlay: rgba(85, 85, 89, 0.60);
  --stage-gradient: linear-gradient(135deg, #555559 0%, #555559 75%, #C9A30D 75%, #C9A30D 100%);
  /* Opacity variants for hover/focus states - using charcoal for subtle backgrounds */
  --primary-hover-bg: rgba(200, 137, 60, 0.05);
  --primary-subtle: rgba(200, 137, 60, 0.08);
  --primary-focus-shadow: rgba(200, 137, 60, 0.1);
  --primary-light: rgba(200, 137, 60, 0.15);
  --primary-focus-ring: rgba(200, 137, 60, 0.2);
  --primary-shadow: rgba(200, 137, 60, 0.3);
  --primary-shadow-strong: rgba(200, 137, 60, 0.4);
  --teal-light: rgba(201, 163, 13, 0.05);
  --accent-subtle: rgba(201, 163, 13, 0.04);
  --accent-light: rgba(201, 163, 13, 0.1);
  --accent-glow: rgba(200, 137, 60, 0.4);
  --accent-glow-strong: rgba(200, 137, 60, 0.6);
  --accent-rgb: 200, 137, 60;
  --teal-rgb: 200, 137, 60;
  --accent-hover: #B8940C;
  --scan-visual-bg: linear-gradient(135deg, #1a1a1c 0%, #2a2a2d 50%, #1a1a1c 100%);
  /* Hard color stop gradients (no soft blends) - charcoal takes 75%, gold takes 25% */
  --gradient-primary: linear-gradient(135deg, #555559 0%, #555559 75%, #C9A30D 75%, #C9A30D 100%);
  --gradient-primary-accent: linear-gradient(135deg, #555559 0%, #555559 75%, #C9A30D 75%, #C9A30D 100%);
  --gradient-primary-teal: linear-gradient(135deg, #555559 0%, #555559 75%, #D4A90E 75%, #D4A90E 100%);
  --gradient-teal-primary: linear-gradient(135deg, #D4A90E 0%, #D4A90E 75%, #555559 75%, #555559 100%);
  --gradient-accent-warm: linear-gradient(135deg, #C9A30D 0%, #C9A30D 25%, #555559 25%, #555559 100%);
  --gradient-status: linear-gradient(135deg, rgba(85, 85, 89, 0.1) 0%, rgba(85, 85, 89, 0.1) 75%, rgba(201, 163, 13, 0.1) 75%, rgba(201, 163, 13, 0.1) 100%);
  --gradient-progress-h: linear-gradient(90deg, #555559 0%, #555559 75%, #C9A30D 75%, #C9A30D 100%);
  --gradient-accent-light: linear-gradient(135deg, var(--accent) 0%, var(--accent) 75%, #555559 75%, #555559 100%);
  --info-bg: rgba(91, 155, 213, 0.08);
  --info-border: rgba(91, 155, 213, 0.25);
  --gradient-style: hard-75;
  --splash-overlay-tint: rgba(61, 61, 64, 0.82);
  --gradient-osp-hero: linear-gradient(160deg, #3d3d40 0%, #555559 75%, #C9A30D 75%, #C9A30D 100%);
}

/* Surerus Radio Button Overrides */
body.theme-surerus .radio-input {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary-dark);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  position: relative;
}

body.theme-surerus .radio-input:checked {
  border-color: var(--primary);
  background: var(--primary);
}

body.theme-surerus .radio-input:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface);
}

body.theme-surerus .radio-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-focus-ring);
}

/* Surerus Checkbox Overrides */
body.theme-surerus input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  border: 2px solid var(--primary-dark);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  margin: 0;
  vertical-align: middle;
}

body.theme-surerus input[type="checkbox"]:checked {
  border-color: var(--primary);
  background: var(--primary);
}

body.theme-surerus input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 6px;
  width: 5px;
  height: 9px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

body.theme-surerus input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-focus-ring);
}

/* Surerus Button Overrides - primary (Continue) is bright gold, secondary is charcoal */
body.theme-surerus .btn-primary {
  background-color: var(--highlight);
  border-color: var(--highlight);
  color: var(--white);
}

body.theme-surerus .btn-primary:hover:not(:disabled):not(.btn-disabled),
body.theme-surerus .btn-primary:active:not(:disabled):not(.btn-disabled) {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

body.theme-surerus .btn-primary:focus:not(:disabled):not(.btn-disabled) {
  background-color: var(--highlight);
  border-color: var(--highlight);
  outline: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--highlight);
}

body.theme-surerus .btn-secondary {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--surface);
}

body.theme-surerus .btn-secondary:hover:not(:disabled),
body.theme-surerus .btn-secondary:active:not(:disabled) {
  background-color: var(--primary-darker);
  border-color: var(--primary-darker);
  color: var(--surface);
}

body.theme-surerus .btn-secondary:focus:not(:disabled) {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  outline: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary-dark);
  color: var(--surface);
}

/* ==========================================================================
   End Company Theme Overrides
   ========================================================================== */

html {
  overflow: auto;
}

/* ============================================================
   Base Resets & Global Styles
   ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.5;
  background: var(--background);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#privateModeText {
  display: none !important;
}

/* Override Bootstrap's thin-dotted focus ring on links */
a:focus {
  outline: none;
}
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============================================================
   Common Animations
   ============================================================ */

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0);
  }

  to {
    transform: scale(1);
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-15px) rotate(5deg);
  }
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

/* ============================================================
   Header / Navbar
   ============================================================ */

header h1 {
  color: var(--primary-dark);
  margin: 0;
}

.header {
  background: var(--surface);
  padding: 8px 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-4);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-image {
  height: 36px;
  width: auto;
}

.logo-css {
  display: flex;
  align-items: center;
  gap: 3px;
}

.logo-bar {
  width: 14px;
  height: 24px;
  transform: skewX(calc(-1 * var(--cut-angle)));
}

/* Semantic class names for dynamic theming */
.logo-bar.bar-secondary,
.logo-bar.orange {
  background: var(--accent);
}

.logo-bar.bar-primary,
.logo-bar.green {
  background: var(--primary);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 600;
  font-size: 11px;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.header-nav-link:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.header-nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.header-nav-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.header-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 6px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.user-greeting {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.header-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.header-logout-btn:hover {
  background: var(--error-light);
  color: var(--error);
}

.header-logout-btn svg {
  width: 16px;
  height: 16px;
}

.header-signin-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--primary);
  color: var(--white);
  border-radius: 6px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.header-signin-btn:hover {
  background: var(--primary-dark);
  color: var(--white);
}

.header-signin-btn svg {
  width: 16px;
  height: 16px;
}

/* Onboarding Dropdown */
.onboarding-dropdown {
  position: relative;
}

.onboarding-dropdown-toggle {
  cursor: pointer;
  border: none;
  background: none;
}

.dropdown-chevron {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.onboarding-dropdown.open .dropdown-chevron {
  transform: rotate(180deg);
}

.onboarding-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  z-index: 510;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility 0s 0.15s;
}

.onboarding-dropdown.open .onboarding-dropdown-menu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility 0s;
}

.onboarding-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--transition-fast);
}

.onboarding-dropdown-item svg {
  flex-shrink: 0;
}

a.onboarding-dropdown-item:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  text-decoration: none;
}

.onboarding-dropdown-item.completed svg {
  stroke: var(--primary);
}

.onboarding-dropdown-item.current {
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-light);
}

.stage-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin: 0 3px;
}

.onboarding-dropdown-item.locked {
  color: var(--text-secondary);
  cursor: default;
  opacity: 0.5;
}

/* Header responsive styles */
@media (max-width: 768px) {
  .header {
    padding: 8px 12px;
  }

  .header-nav-link span {
    display: none;
  }

  .header-nav-link {
    padding: 6px;
  }

  .onboarding-dropdown-toggle .dropdown-chevron {
    display: none;
  }

  .onboarding-dropdown-menu {
    left: auto;
    right: 0;
  }

  .user-greeting {
    display: none;
  }

  .header-divider {
    margin: 0 4px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .logo-image {
    height: 32px;
  }

  .header-nav {
    gap: 2px;
  }

  .header-signin-btn span {
    display: none;
  }

  .header-signin-btn {
    padding: 8px;
  }
}

/* ============================================================
   Main Container & Layout
   ============================================================ */

.main-container {
  height: calc(100vh - var(--main-containersubtracted)) !important;
  display: flex;
  padding: var(--space-lg) !important;
  margin-top: var(--header-height) !important;
  overflow: auto;
}

/* ============================================================
   Unanswered Agreements Banner
   ============================================================ */

.agreements-banner {
  background: var(--warning-bg);
  border: 1px solid var(--warning);
  border-radius: var(--radius-lg);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
}

.agreements-banner-content {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 14px;
  color: var(--text-primary);
  flex-wrap: wrap;
}

.agreements-banner-icon {
  color: var(--warning);
  flex-shrink: 0;
}

.agreements-banner-link {
  margin-left: auto;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

.agreements-banner-link:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .agreements-banner-content {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }

  .agreements-banner-link {
    margin-left: 0;
  }
}

/* ============================================================
   Progress Sidebar (Common to all onboarding pages)
   ============================================================ */

.progress-sidebar {
  width: var(--sidebar-width);
  background: var(--stage-gradient);
  padding: 28px 22px;
  position: fixed;
  left: 0;
  top: var(--header-height);
  bottom: var(--footer-height);
  overflow-y: auto;
  z-index: 101;
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease, padding 0.3s ease;
  padding-bottom: 16px;
}

.progress-sidebar::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 60px;
  background: var(--accent);
  opacity: 0.15;
  transform: skewX(calc(-1 * var(--cut-angle)));
  transform-origin: top right;
  pointer-events: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-title {
  color: var(--white);
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

.progress-subtitle {
  color: var(--overlay-white-70);
  font-size: 13px;
  margin-bottom: 0;
}

.progress-steps {
  position: relative;
  z-index: 1;
}

.progress-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.step-indicator {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--overlay-white);
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 11px;
  color: var(--overlay-white-50);
  flex-shrink: 0;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

/* Connector line between steps — bridges from indicator to next step's indicator */
.progress-step::after {
  content: '';
  position: absolute;
  top: calc(12px + 28px);
  left: 14px;
  transform: translateX(-50%);
  width: 2px;
  bottom: -12px;
  background: var(--overlay-dark-15);
  transition: left 0.3s ease;
}

.progress-step:last-child::after {
  display: none;
}

div.progress-step {
  cursor: default;
}

.progress-step.locked .step-title {
  color: var(--sidebar-locked);
}

.progress-step.locked .step-description {
  color: var(--sidebar-locked-subtle);
}

.progress-step.locked .step-indicator {
  opacity: 0.35;
}

.step-lock {
  flex-shrink: 0;
  margin-left: auto;
  align-self: center;
  color: var(--sidebar-locked);
}

.progress-step:not(.active):hover {
  background: var(--overlay-white-06);
  border-radius: var(--radius-md);
  margin-left: -8px;
  margin-right: -8px;
  padding-left: 8px;
  padding-right: 8px;
}

.progress-step:not(.active):hover::after {
  left: 22px;
}

.progress-step:not(.active):hover .step-indicator {
  border-color: var(--overlay-white-50);
  background: var(--overlay-white-15);
}

.progress-step:not(.active):hover .step-title {
  color: var(--overlay-white-80);
}

/* Active step: full row highlight + accent indicator */
.progress-step.active,
.progress-step.completed.active {
  background: var(--overlay-white-15) !important;
  border-radius: var(--radius-md);
  margin-left: -8px !important;
  margin-right: -8px !important;
  padding-left: 5px !important;
  padding-right: 8px !important;
  border-left: 3px solid var(--accent) !important;
}

.progress-step.active .step-indicator,
.progress-step.completed.active .step-indicator {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: var(--white) !important;
  box-shadow: 0 0 20px var(--accent-glow) !important;
}

.progress-step.completed:not(.active) .step-indicator {
  background: var(--surface);
  border-color: var(--white);
  color: var(--primary);
}

.progress-step.completed::after {
  background: var(--overlay-white-solid);
}

.progress-step.active::after,
.progress-step.completed.active::after {
  left: 19px;
}

/* Step indicator icons vs checkmark */
.step-icon {
  display: block;
}

.step-check {
  display: none;
}

.progress-step.completed .step-icon {
  display: none;
}

.progress-step.completed .step-check {
  display: block;
}

.step-content {
  flex: 1;
  padding-top: 3px;
  overflow: hidden;
  transition: opacity 0.2s ease, width 0.2s ease;
}

.step-title {
  color: var(--overlay-white-50);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 0;
  transition: all 0.3s ease;
}

.progress-step.active .step-title,
.progress-step.completed .step-title {
  color: var(--white);
}

.step-description {
  color: var(--overlay-white-30);
  font-size: 11px;
  transition: all 0.3s ease;
}

.progress-step.active .step-description {
  color: var(--overlay-white-60);
}

/* Sidebar Home Link */
.sidebar-home-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: var(--space-lg);
  padding: 12px 14px;
  color: var(--overlay-white-60);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 500;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.sidebar-home-link:hover {
  color: var(--white);
  background: var(--overlay-white-05);
}

.sidebar-home-link svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.sidebar-home-link:hover svg {
  transform: scale(1.1);
}

.sidebar-advisor {
  padding: 12px 14px;
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-advisor-label {
  font-size: 11px;
  color: var(--overlay-white-60);
  margin-bottom: 3px;
}

.sidebar-advisor-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--white);
}

.sidebar-advisor-email {
  display: block;
  font-size: 12px;
  color: var(--overlay-white-60);
  text-decoration: none;
  margin-top: 3px;
}

.sidebar-advisor-email:hover {
  color: var(--white);
  text-decoration: underline;
}

/* Sidebar Collapse Toggle (desktop) */
.sidebar-collapse-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  cursor: pointer;
  color: var(--overlay-white-50);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background 0.2s ease;
  flex-shrink: 0;
}

.sidebar-collapse-toggle:hover {
  color: var(--white);
  background: var(--overlay-white);
}

.sidebar-collapse-toggle svg {
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.progress-sidebar.collapsed .sidebar-collapse-toggle svg {
  transform: rotate(180deg);
}

/* Collapsed Sidebar State */
.progress-sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  padding: 12px 10px;
}

.progress-sidebar.collapsed .progress-title,
.progress-sidebar.collapsed .progress-subtitle,
.progress-sidebar.collapsed .sidebar-advisor,
.progress-sidebar.collapsed .sidebar-home-link span {
  display: none;
}

.progress-sidebar.collapsed .sidebar-header {
  justify-content: center;
}

.progress-sidebar.collapsed .sidebar-home-link {
  justify-content: center;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  gap: 0;
}

.progress-sidebar.collapsed .step-content {
  display: none;
}

.progress-sidebar.collapsed .progress-steps {
  align-items: center;
}

.progress-sidebar.collapsed .progress-step {
  justify-content: center;
  gap: 0;
  padding: 10px 0;
}

.progress-sidebar.collapsed .progress-step::after {
  top: calc(10px + 28px);
  bottom: -10px;
  left: 50% !important;
  transform: translateX(-50%) !important;
}

.progress-sidebar.collapsed::after {
  display: none;
}

body.sidebar-collapsed .content-area {
  margin-left: var(--sidebar-collapsed-width);
  max-width: calc(100% - var(--sidebar-collapsed-width));
}

/* ============================================================
   Content Area
   ============================================================ */

.content-area {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 0;
  max-width: calc(100% - var(--sidebar-width));
  transition: margin-left 0.3s ease, max-width 0.3s ease;
}

.stage-container,
.page-container {
  margin: 0 auto;
  max-width: 1000px;
  padding-bottom: 70px;
}

/* ============================================================
   Common Card Styles
   ============================================================ */

.stage-card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-8);
  animation: slideUp 0.5s ease;
}

.stage-header {
  background: var(--stage-gradient);
  padding: 20px;
  position: relative;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
}

.stage-header::before {
  content: '';
  position: absolute;
  right: -50px;
  top: -50px;
  width: 200px;
  height: 200px;
  background: var(--accent);
  opacity: 0.1;
  border-radius: 50%;
}

.stage-header::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 150px;
  height: 80px;
  background: var(--accent);
  opacity: 0.2;
  transform: skewX(calc(-1 * var(--cut-angle)));
  transform-origin: bottom right;
}

.stage-icon {
  width: 64px;
  height: 64px;
  background: var(--overlay-white);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
}

.stage-icon svg {
  width: 32px;
  height: 32px;
  color: var(--white);
}

.stage-number {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stage-title {
  color: var(--white);
  font-size: 28px;
  font-weight: 700;
  margin: 0 !important;
}

.stage-description {
  color: var(--overlay-white-70);
  font-size: 14px;
  line-height: 1.6;
  max-width: 500px;
  margin: 0 !important;
}

.stage-body {
  padding: 20px 20px;
}

/* ============================================================
   Progress Bar in Content
   ============================================================ */

.content-progress {
  margin-bottom: var(--space-md);
}

.progress-bar-container {
  height: 8px;
  background: var(--border);
  border-radius: 50px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-progress-h);
  border-radius: 50px;
  transition: width 0.5s ease;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ============================================================
   Common Form Elements
   ============================================================ */

.form-section {
  margin-bottom: 20px;
}

.form-section:last-child {
  margin-bottom: 0;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title svg {
  width: 20px;
  height: 20px;
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: -8px 0 16px;
  line-height: 1.5;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(12px, 2vw, 16px);
  margin-bottom: 0;
}

.form-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0;
  min-width: 0; /* CSS Grid: prevents grid items overflowing their column (min-width: auto default) */
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  margin: 0;
  color: var(--text-secondary);
}

.form-label .required {
  color: var(--error);
}

.hiddenInput {
  display: none !important;
}

/* Fluent UI v9 Style Inputs - Expanding bottom border on focus */
.form-input,
.form-select,
.form-textarea {
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.1s ease;
  background: var(--surface);
  position: relative;
}

/* Wrapper for the expanding underline effect */
.form-group {
  position: relative;
}

/* Fluent v9 expanding underline - created via input wrapper */
/* Using a pseudo-element approach on each input type */
.form-input,
.form-select,
.form-textarea {
  background-image: linear-gradient(var(--primary), var(--primary));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: center bottom;
  transition: border-color 0.1s ease, background-size 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  background-size: 100% 2px;
}

/* Error state underline */
.form-input.invalid,
.form-select.invalid,
.form-textarea.invalid {
  background-image: linear-gradient(var(--error), var(--error));
}

.form-input.invalid:focus,
.form-select.invalid:focus,
.form-textarea.invalid:focus {
  background-size: 100% 2px;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--cool-grey-light);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: none;
  background-size: 100% 2px;
}

.form-input.valid {
  border-color: var(--primary);
}

/* Placeholder text — fainter than input text so it's clearly not data */
.form-input::placeholder,
.form-select::placeholder,
textarea.form-input::placeholder {
  color: var(--cool-grey);
  opacity: 0.5;
  font-style: italic;
}

/* Country selector buttons - Dynamics style focus */
.country-selector .country-option:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary);
}

.validation-message {
  font-size: 12px;
  color: var(--error);
  margin-top: 4px;
  display: none;
}

.validation-message.visible {
  display: block;
}

.required-field-error {
  font-size: 12px;
  color: var(--error);
  margin-top: 4px;
  display: block;
}

.validation-banner {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--error-bg);
  border: 1px solid var(--error);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  margin-bottom: var(--space-md);
  animation: validation-banner-in 0.3s ease;
}

.validation-banner-icon {
  flex-shrink: 0;
  color: var(--error);
  font-size: 18px;
}

.validation-banner-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--error);
}

@keyframes validation-banner-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-hint {
  font-size: 12px;
  color: var(--warm-grey);
  display: block;
  margin-top: 6px;
}

/* ============================================================
   Address Search Component
   ============================================================ */

.address-search-container {
  margin-bottom: 16px;
}

.address-search-input-wrapper {
  position: relative;
}

.address-search-input-wrapper .form-input {
  padding-right: 40px;
  width: 100%;
}

.address-search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--cool-grey);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.address-search-icon svg {
  width: 100%;
  height: 100%;
}

.address-search-icon.loading svg {
  animation: spin 1s linear infinite;
}

.address-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-16);
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  margin-top: 4px;
}

.address-results.open {
  display: block;
}

.address-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.address-result-item:last-child {
  border-bottom: none;
}

.address-result-item:hover {
  background: var(--primary-hover-bg);
}

.address-result-flag {
  width: 20px;
  height: 15px;
  flex-shrink: 0;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.address-result-content {
  flex: 1;
  min-width: 0;
}

.address-result-main {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.3;
}

.address-result-secondary {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.address-no-results {
  padding: 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

.address-fields-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  background: var(--info-bg);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 12px;
}

.address-fields-note svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--info);
}

/* Make address search container position relative for dropdown */
.address-search-container {
  position: relative;
}

/* ============================================================
   Common Button Styles
   ============================================================ */

.button-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   Dynamics 365 Model-Driven App Style Buttons
   ============================================================ */

.btn {
  padding: 10px 24px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  font-family: inherit;
  min-height: 48px;
  text-decoration: none !important;
  position: relative;
  vertical-align: middle;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Primary Button - Orange CTA (per brand guide) */
.btn-primary {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

.btn-primary:hover:not(:disabled):not(.btn-disabled) {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-primary:active:not(:disabled):not(.btn-disabled) {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-primary:focus:not(:disabled):not(.btn-disabled) {
  background-color: var(--accent);
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
}

/* Disabled button via CSS class (allows click events for validation dialogs) */
.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: auto;
}

/* Secondary Button - Green filled (per brand guide) */
.btn-secondary {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--surface);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--surface);
}

.btn-secondary:active:not(:disabled) {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-secondary:focus:not(:disabled) {
  background-color: var(--primary);
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary);
  color: var(--surface);
}

/* Outline Button - for tertiary actions (white bg, border) */
.btn-outline {
  background-color: var(--surface);
  border-color: var(--border);
  color: var(--text-primary);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--primary-hover-bg);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline:focus:not(:disabled) {
  outline: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary);
}

/* Accent Button */
.btn-accent {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--text-primary) !important;
}

.btn-accent:hover:not(:disabled) {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-accent:focus:not(:disabled) {
  outline: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
}

/* Disabled state */
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Loading state - Dynamics style spinner */
.btn.loading {
  color: transparent !important;
  pointer-events: none;
  animation: none !important;
  transform: none !important;
}

.btn.loading svg {
  visibility: hidden;
  animation: none !important;
}

.btn.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  margin-left: -8px;
  border: 2px solid currentColor;
  border-color: var(--overlay-white-30);
  border-top-color: var(--surface);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-secondary.loading::after,
.btn-save.loading::after {
  border-color: var(--overlay-dark-15);
  border-top-color: var(--primary);
}

/* Save Status Indicator */
.save-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.save-status svg {
  width: 16px;
  height: 16px;
}

.save-status.saving {
  color: var(--text-secondary);
}

.save-status.saving svg {
  animation: spin 1s linear infinite;
}

.save-status.saved {
  color: var(--success);
}

.save-status.error {
  color: var(--error);
}

.save-status.unsaved {
  color: var(--warning);
}

.save-status.hidden {
  opacity: 0;
  visibility: hidden;
}

.save-helper-text {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: right;
  margin-top: 8px;
  margin-bottom: 0;
}
.save-helper-text strong { color: var(--text-primary); font-weight: 600; }

/* Button group with save */
.button-group-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.button-group-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Continue Validation Helper Message */
.continue-validation-message {
  font-size: 13px;
  color: var(--warning);
  text-align: right;
  margin-top: 8px;
}

.continue-validation-message:empty {
  display: none;
}

.continue-validation-message .validation-item {
  display: inline;
}

@media (max-width: 768px) {
  .continue-validation-message {
    text-align: left;
  }
  .continue-validation-message .validation-item {
    display: block;
    padding: 2px 0;
  }
  .continue-validation-message .validation-sep {
    display: none;
  }
}

/* Save Button */
.btn-save {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  font-weight: 600;
  min-width: auto;
}

.btn-save-label { font-size: 13px; white-space: nowrap; }

.btn-save:hover:not(:disabled) {
  background-color: var(--primary-hover-bg);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-save:active:not(:disabled) {
  background-color: var(--background);
}

.btn-save:focus:not(:disabled) {
  background: transparent;
  outline: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary);
}

/* Generic Secondary Button - works with any .btn.secondary combo */
.btn.secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
  font-weight: 500;
}

.btn.secondary:hover:not(:disabled) {
  background-color: var(--background);
  color: var(--text-primary);
}

/* ============================================================
   Shared Agreement Component Styles
   Used by: Agreements page, Payroll Info (subsistence)
   ============================================================ */

/* --- Section Heading (used above agreement list, contract card, etc.) --- */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}

.section-heading-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.section-heading-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-heading-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.section-heading-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.section-heading-tag.tag-count {
  background: var(--primary);
  color: var(--white);
}

.section-heading-tag.tag-complete {
  background: var(--success-bg);
  color: var(--success);
}

/* --- Agreement List --- */
.agreement-list {
  margin-bottom: var(--space-lg);
}

.agreement-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  margin-bottom: 8px;
}

.agreement-list-item:last-child {
  margin-bottom: 0;
}

.agreement-list-item:hover {
  background: var(--background);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.agreement-list-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.agreement-list-text {
  flex: 1;
  min-width: 0;
}

.agreement-list-name {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.agreement-list-summary {
  display: block;
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  background: var(--background);
  padding: 2px 8px;
  border-radius: 4px;
}

.agreement-list-summary * {
  display: inline !important;
  font-size: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  font-family: inherit !important;
}

.agreement-list-date {
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.agreement-list-hint {
  font-size: 10px;
  font-style: italic;
  color: var(--text-secondary);
  white-space: nowrap;
}

.agreement-list-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.agreement-list-chevron {
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: transform 0.15s ease;
}

.agreement-list-item:hover .agreement-list-chevron {
  transform: translateX(2px);
  color: var(--primary);
}

/* --- Agreement Modal --- */
.agreement-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-dark);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.agreement-modal-overlay.visible {
  opacity: 1;
}
body:has(.agreement-modal-overlay.visible) {
  overflow: hidden;
}

.agreement-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 960px;
  max-height: 97vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: translateY(20px);
  transition: transform 0.25s ease;
  overflow: hidden;
}

.agreement-modal-overlay.visible .agreement-modal {
  transform: translateY(0);
}

.agreement-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px 14px;
  flex-shrink: 0;
}

.agreement-modal-header-text {
  flex: 1;
}

.agreement-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.agreement-modal-subtitle {
  display: inline-block;
  color: var(--text-secondary);
  margin-top: 4px;
  background: var(--background);
  padding: 2px 10px;
  border-radius: 4px;
}

.agreement-modal-close {
  flex-shrink: 0;
  background: var(--background);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  margin-top: 2px;
}

.agreement-modal-close:hover {
  background: var(--error-light);
  border-color: var(--error-border);
  color: var(--error);
}

.agreement-modal-body {
  padding: 0 24px 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.agreement-modal-divider {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  padding: 8px 0 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.agreement-modal-divider svg {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.agreement-modal-body .agreement-content {
  flex: 1;
  overflow-y: auto;
  position: relative;
  border-radius: var(--radius-md);
}

/* Scroll-to-unlock notice */
.scroll-unlock-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.scroll-unlock-notice.unlocked {
  opacity: 0;
  pointer-events: none;
}

.scroll-unlock-notice svg {
  flex-shrink: 0;
}

/* Review Timer Ring (footer countdown) */
.review-timer-ring {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  transition: opacity 0.4s;
}
.review-timer-ring.complete {
  opacity: 0;
}
.timer-ring-bg {
  stroke: var(--border);
}
.timer-ring-progress {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}
.timer-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Modal Bottom — 2-column panel (current response + history) */
.agreement-modal-bottom {
  display: flex;
  gap: 1px;
  background: var(--border-subtle);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.modal-bottom-col {
  flex: 1;
  padding: 14px 24px;
  background: var(--surface);
}

.modal-bottom-current {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.modal-bottom-history {
  flex: 1;
  max-height: 160px;
  overflow-y: auto;
}

.modal-bottom-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

/* Modal Footer */
.agreement-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 12px;
}

.agreement-modal-footer .response-buttons {
  justify-content: flex-end;
  flex: 1;
}

.agreement-modal-footer .response-buttons.scroll-locked {
  opacity: 0.4;
  pointer-events: none;
}

/* Side arrow buttons beside agreement modal */
.modal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--overlay-white-solid);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.modal-arrow:hover {
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transform: translateY(-50%) scale(1.08);
}

.modal-arrow-prev {
  left: calc(50% - 480px - 56px);
}

.modal-arrow-next {
  right: calc(50% - 480px - 56px);
}

/* Footer nav buttons (mobile only — hidden on desktop) */
.modal-nav-footer {
  display: none;
  gap: 8px;
  padding: 10px 24px 14px;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface);
}

.modal-nav-footer .btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--background);
  color: var(--text-secondary);
  font-family: inherit;
  transition: all var(--transition-base);
}

.modal-nav-footer .btn:hover {
  background: var(--surface);
  color: var(--text-primary);
}

/* --- Agreement Content + Rich Text Reset --- */
.agreement-content {
  overflow-y: auto;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--background);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 0;
}

.agreement-content h1,
.agreement-content h2,
.agreement-content h3,
.agreement-content h4,
.agreement-content h5,
.agreement-content h6 {
  margin: 0 0 8px;
  line-height: 1.3;
}

.agreement-content p {
  margin: 0 0 12px;
}

.agreement-content p:last-child {
  margin-bottom: 0;
}

.agreement-content ul,
.agreement-content ol {
  padding-left: 24px;
  margin: 0 0 12px;
}

.agreement-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.agreement-content table td,
.agreement-content table th {
  border: 1px solid var(--border-subtle);
  padding: 6px 10px;
  text-align: left;
}

.agreement-content img {
  max-width: 100%;
  height: auto;
}

.agreement-content a {
  color: var(--primary);
  text-decoration: underline;
}

.agreement-content blockquote {
  margin: 0 0 12px;
  padding: 8px 16px;
  border-left: 3px solid var(--border);
  color: var(--text-secondary);
}

.agreement-content pre {
  background: var(--surface);
  padding: 12px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 0 0 12px;
}

.agreement-content hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 16px 0;
}

.agreement-content li {
  margin-bottom: 6px;
}

/* --- Status Badges --- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.status-badge::before {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.badge-signed::before,
.badge-accepted::before {
  content: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

.badge-declined::before {
  content: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
}

.badge-pending::before {
  content: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23d97706' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
}

.badge-signed,
.badge-accepted {
  background: var(--success-bg);
  color: var(--success);
}

.badge-declined {
  background: var(--error-bg);
  color: var(--error);
}

.badge-pending {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-revoked::before {
  content: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2.5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 10h10a5 5 0 0 1 0 10h-1'/%3E%3Cpolyline points='7 6 3 10 7 14'/%3E%3C/svg%3E");
}

.badge-revoked {
  background: var(--background);
  color: var(--text-secondary);
}

/* --- Response Buttons --- */
.response-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.response-buttons .btn {
  border-radius: var(--radius-md);
}

.response-buttons .btn:only-child {
  margin-right: auto;
}

/* --- Response Status --- */
.response-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* --- Change Response Link --- */
.change-response-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  padding: 6px 14px;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-md);
  background: transparent;
  text-decoration: none;
  margin-left: auto;
  transition: background 0.15s ease, color 0.15s ease;
}

.change-response-link:hover {
  background: var(--primary);
  color: var(--surface);
}

.change-response-link.loading {
  color: transparent;
  pointer-events: none;
  animation: none !important;
  transform: none !important;
}

.change-response-link.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  margin-left: -7px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* --- Response History Toggle --- */
.response-history-toggle {
  width: 100%;
  text-align: right;
}

.history-toggle-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.history-toggle-link:hover {
  color: var(--primary);
}

.history-toggle-chevron {
  transition: transform 0.2s ease;
}

.history-toggle-link.expanded .history-toggle-chevron {
  transform: rotate(180deg);
}

.response-history-collapsible {
  width: 100%;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

/* --- Response History --- */
.response-history-list {
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding: 4px 0;
}

.response-history-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  flex-shrink: 0;
}

.response-history-entry:not(:last-child) {
  border-left: 1px solid var(--border);
}

.response-history-entry .history-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.response-history-entry .history-badge.badge-accepted {
  background: var(--success-bg);
  color: var(--success);
}

.response-history-entry .history-badge.badge-declined {
  background: var(--error-bg);
  color: var(--error);
}

.response-history-entry .history-badge::before {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.response-history-entry .history-badge.badge-accepted::before {
  content: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

.response-history-entry .history-badge.badge-declined::before {
  content: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
}

.response-history-entry .history-badge.badge-revoked {
  background: var(--background);
  color: var(--text-secondary);
}

.response-history-entry .history-badge.badge-revoked::before {
  content: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2.5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 10h10a5 5 0 0 1 0 10h-1'/%3E%3Cpolyline points='7 6 3 10 7 14'/%3E%3C/svg%3E");
}

.history-date {
  color: var(--text-secondary);
  font-size: 10px;
  white-space: nowrap;
  text-align: center;
}

/* --- Agreement Component Responsive --- */
@media (max-width: 768px) {
  .agreement-content {
    padding: 16px;
  }

  .agreement-list-item {
    padding: 12px 14px;
    gap: 10px;
  }

  .agreement-list-name {
    font-size: 13px;
  }

  .agreement-modal {
    max-height: 95vh;
    max-width: 100%;
  }

  .agreement-modal-header {
    padding: 16px 18px 12px;
  }

  .agreement-modal-body {
    padding: 0 18px 14px;
  }

  .agreement-modal-bottom {
    flex-direction: column;
  }

  .modal-bottom-col {
    padding: 12px 18px;
  }

  .modal-bottom-current {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .modal-bottom-current .change-response-link {
    margin-left: 0;
    align-self: flex-end;
  }

  .modal-bottom-current .response-history-toggle {
    text-align: left;
  }

  .agreement-modal-footer {
    padding: 12px 18px;
  }

  .agreement-modal-title {
    font-size: 17px;
  }

  .agreement-modal-footer .response-buttons {
    flex-direction: column;
  }

  .agreement-modal-footer .btn {
    width: 100%;
    justify-content: center;
  }

  .modal-arrow {
    display: none !important;
  }

  .modal-nav-footer {
    display: flex !important;
  }
}

/* ============================================================
   Common Info/Status Boxes
   ============================================================ */

/* Info FAB — floating bottom-right icon with popup */
.info-fab-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
}

.info-fab-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--teal);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-fab-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

.info-fab-btn svg {
  width: 20px;
  height: 20px;
}

.info-fab-popup {
  display: none;
  position: absolute;
  bottom: 52px;
  right: 0;
  width: 280px;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14), 0 2px 6px rgba(0,0,0,0.08);
  padding: 14px 16px;
  animation: infoFabIn 0.15s ease-out;
}

.info-fab-wrap.open .info-fab-popup {
  display: block;
}

@keyframes infoFabIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.info-fab-popup .info-box-title {
  font-weight: 600;
  color: var(--teal);
  font-size: 13px;
  margin-bottom: 4px;
}

.info-fab-popup .info-box-text {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

/* Hide legacy inline info-box (now rendered inside FAB) */
.stage-header .info-box,
.stage-body .info-box {
  display: none;
}

.page-readonly .info-fab-wrap { display: none; }

.status-message {
  background: var(--gradient-status);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.status-message-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.status-message-content {
  flex: 1;
}

.status-message-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.status-message-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.status-message.success {
  background: var(--success-bg);
  border-color: var(--success);
}

.status-message.error {
  background: var(--error-bg);
  border: 1px solid #fecaca;
}

.status-message.error .status-message-title {
  color: var(--error);
}

.error-contact {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 13px;
  color: var(--text-secondary);
}

.error-contact a {
  color: var(--primary);
  text-decoration: none;
}

.error-contact a:hover {
  text-decoration: underline;
}

.error-contact-info {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.error-contact-info a {
  color: var(--primary);
  text-decoration: none;
}

.error-contact-info a:hover {
  text-decoration: underline;
}

/* ============================================================
   Loading & Save Indicators
   ============================================================ */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-white-solid);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.loading-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.save-indicator {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-16);
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.save-indicator.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Responsive Breakpoints
   ============================================================ */

/* Mobile Sidebar Toggle Button */
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.sidebar-toggle:hover {
  background: var(--background);
}

.sidebar-toggle svg {
  width: 24px;
  height: 24px;
  stroke: var(--text-primary);
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-height);
  background: var(--overlay-dark);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* Mobile Sidebar Close Button */
.sidebar-close {
  display: none;
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: var(--overlay-white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.sidebar-close:hover {
  background: var(--overlay-white-strong);
}

.sidebar-close svg {
  width: 18px;
  height: 18px;
  stroke: var(--white);
}

@media (max-width: 1024px) {
  .sidebar-toggle {
    display: flex;
  }

  .sidebar-collapse-toggle {
    display: none;
  }

  .sidebar-overlay {
    display: block;
  }

  .sidebar-close {
    display: flex;
  }

  .progress-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 95;
    width: var(--sidebar-width);
    padding: 28px 22px;
    bottom: var(--footer-height);
  }

  .progress-sidebar.open {
    transform: translateX(0);
  }

  /* Reset collapsed state on mobile */
  .progress-sidebar.collapsed .step-content {
    display: block;
  }

  .progress-sidebar.collapsed .progress-title,
  .progress-sidebar.collapsed .progress-subtitle,
  .progress-sidebar.collapsed .sidebar-advisor,
  .progress-sidebar.collapsed .sidebar-home-link span {
    display: revert;
  }

  .progress-sidebar.collapsed .progress-step {
    justify-content: flex-start;
    gap: 14px;
  }

  .progress-sidebar.collapsed .sidebar-home-link {
    justify-content: flex-start;
    padding: 12px 14px;
    gap: 10px;
  }

  .progress-sidebar.collapsed::after {
    display: block;
  }

  .content-area,
  body.sidebar-collapsed .content-area {
    margin-left: 0;
    max-width: 100%;
    padding: 30px;
  }

  .main-container {
    padding: var(--space-xl);
  }
}

/* Tablet landscape - smoother transition */
@media (max-width: 900px) {
  .content-area {
    padding: 24px;
  }

  .stage-header {
    padding: 24px;
  }

  .stage-title {
    font-size: 24px;
  }

  .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 768px) {
  .main-container {
    padding: var(--space-lg);
  }

  .content-area {
    padding: 20px 16px;
  }

  .header {
    padding: 12px 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: clamp(10px, 2vw, 12px);
  }

  .button-group {
    flex-direction: column-reverse;
    gap: 12px;
  }

  .button-group-left,
  .button-group-right {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .button-group-left {
    flex-direction: column-reverse;
  }

  .btn {
    width: 100%;
    justify-content: center;
    min-height: 40px;
    padding: 10px 16px;
  }

  .btn-save {
    width: 100%;
    min-width: auto;
    padding: 10px 16px;
    justify-content: center;
    min-height: 40px;
  }

  .save-status {
    justify-content: center;
    width: 100%;
  }

  .save-helper-text { text-align: center; }

  .stage-header {
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0;
  }

  .stage-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    margin-bottom: 0;
    order: 10;
    margin-left: auto;
  }

  .stage-icon svg {
    width: 22px;
    height: 22px;
  }

  .stage-number {
    flex-basis: calc(100% - 56px);
    margin-bottom: 2px;
  }

  .stage-title {
    font-size: 22px;
    flex-basis: calc(100% - 56px);
  }

  .stage-description {
    flex-basis: 100%;
  }

  .stage-header::before,
  .stage-header::after {
    display: none;
  }
}

/* Tablet portrait - additional refinement */
@media (max-width: 600px) {
  .content-area {
    padding: 16px 12px;
  }

  .stage-container,
  .page-container {
    padding-bottom: 100px;
  }

  .stage-header {
    padding: 16px;
  }

  .stage-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .stage-icon svg {
    width: 20px;
    height: 20px;
  }

  .stage-number {
    flex-basis: calc(100% - 52px);
  }

  .stage-title {
    font-size: 20px;
    flex-basis: calc(100% - 52px);
  }

  .form-section {
    margin-bottom: 16px;
  }

  .section-title {
    font-size: 15px;
    margin-bottom: 12px;
  }
}

@media (max-width: 380px) {
  .stage-title {
    font-size: 18px;
  }
}

/* Ensure touch targets are adequate on mobile */
@media (pointer: coarse) {
  .btn {
    min-height: 40px;
    padding: 10px 16px;
  }

  .form-input,
  .form-select,
  .form-textarea {
    min-height: 44px;
    padding: 12px;
  }
}

/* ============================================================
   Form-Specific Components CSS
   Used across Worker Details, Medical Declaration, etc.
   ============================================================ */

/* ============================================================
   Checkbox and Radio Styles
   ============================================================ */

.checkbox-group,
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-group.horizontal {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 20px;
}

.checkbox-item,
.radio-item {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.checkbox-input,
.radio-input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}

.checkbox-label,
.radio-label {
  font-size: 14px;
  line-height: 1.5;
}

/* ============================================================
   Yes/No Toggle Group
   ============================================================ */

.yes-no-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.yes-no-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px;
  background: var(--background);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.yes-no-item.has-details {
  flex-direction: column;
  gap: 12px;
}

.yes-no-item.invalid,
.yes-no-item.invalid button {
  border-color: var(--error);
}

.yes-no-item.unanswered {
  border-style: dashed;
  border-color: var(--warning);
}

.yes-no-unanswered-hint {
  font-size: 11px;
  color: var(--warning);
  margin-right: 4px;
  white-space: nowrap;
  align-self: center;
  order: -1;
}

.yes-no-item:not(.unanswered) .yes-no-unanswered-hint {
  display: none;
}

.yes-no-question {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
}

.yes-no-question strong {
  color: var(--primary);
}

.yes-no-toggle {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.toggle-btn {
  padding: 6px 16px;
  border: 1px solid var(--cool-grey-light);
  background: var(--cool-grey-light);
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  color: var(--text-secondary);
}

.toggle-btn:hover {
  border-color: var(--primary);
}

.toggle-btn.active,
.toggle-btn.active-no {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.yes-no-details {
  width: 100%;
  margin-top: 8px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.3s ease;
}

.yes-no-details.visible {
  max-height: 200px;
  opacity: 1;
  margin-top: 12px;
}

.yes-no-details .form-input,
.yes-no-details .form-textarea {
  width: 100%;
}

/* Conditional section animations */
.conditional-section {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
  margin-top: 0;
}

.conditional-section.visible {
  max-height: 500px;
  opacity: 1;
  margin-top: 16px;
}

/* ============================================================
   Country Selector
   ============================================================ */

.country-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.country-option {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.country-option:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.country-option.selected {
  border-color: var(--primary);
  background: var(--primary-hover-bg);
  color: var(--primary);
}

.country-option .country-flag {
  font-size: 24px;
  line-height: 1.2;
  margin-bottom: 4px;
  display: block;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", sans-serif;
}

.country-option .country-flag-img {
  width: 28px;
  height: 21px;
  margin-bottom: 6px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.country-option .country-flag-svg {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  stroke: var(--text-secondary);
}

.country-option:hover .country-flag-svg,
.country-option.selected .country-flag-svg {
  stroke: var(--primary);
}

/* ============================================================
   Profile Photo Upload
   ============================================================ */

.photo-upload-container {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px;
  background: var(--background);
  border-radius: 12px;
  margin-bottom: 24px;
}

.photo-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--gradient-primary-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 600;
  color: var(--white);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-upload-content {
  flex: 1;
}

.photo-upload-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.photo-upload-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.photo-upload-actions {
  display: flex;
  gap: 12px;
}

.photo-upload-input {
  display: none !important;
}

/* ============================================================
   Multi-Entry Cards (Emergency Contacts, Dependents)
   ============================================================ */

.entry-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.entry-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  position: relative;
}

.entry-card .form-grid {
  grid-template-columns: repeat(3, 1fr);
}

.entry-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.entry-card-title {
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.entry-card-number {
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.remove-entry-btn {
  background: none;
  border: none;
  color: var(--error);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.remove-entry-btn:hover,
.remove-entry-btn:focus {
  background: var(--error-light);
  color: var(--error);
}

/* Inline button spinner (injected via JS) */
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--error-border);
  border-top-color: var(--error);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

.add-entry-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  background: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  font-family: inherit;
}

.add-entry-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-hover-bg);
}

.add-entry-btn svg {
  width: 16px;
  height: 16px;
}

.add-entry-btn:disabled {
  border-color: var(--border);
  background: var(--background);
  color: var(--text-muted);
  cursor: not-allowed;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.save-entry-btn {
  padding: 8px 20px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.save-entry-btn:hover:not(:disabled) {
  background: var(--primary-dark);
  color: var(--white);
}

.save-entry-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: var(--text-muted);
}

/* ============================================================
   Searchable Dropdown / Lookup
   ============================================================ */

.search-wrapper {
  /* position: relative is set in Fluent v9 underline section */
  display: flex;
  align-items: center;
}

.search-wrapper .form-input {
  padding-right: calc(var(--space-4xl) + var(--space-xl));
  flex-grow: 1;
}

.search-wrapper .form-input.hiddenInput {
  display: none;
}

.search-wrapper .search-icon-btn {
  position: absolute;
  left: calc(100% - 36px);
  width: 36px;
  height: 36px;
  padding: 0;
  min-height: auto;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
}

.search-wrapper .search-icon-btn:hover {
  background: var(--background);
  color: var(--primary);
}

.search-wrapper .search-icon-btn svg {
  width: 18px;
  height: 18px;
}

.search-wrapper .loading-icon {
  position: absolute;
  right: var(--space-lg);
  color: var(--primary);
  display: none;
  align-items: center;
  justify-content: center;
}

.search-wrapper .loading-icon.visible {
  display: flex;
}

.search-wrapper .loading-icon svg {
  width: 18px;
  height: 18px;
  animation: spin 1s linear infinite;
}

.search-wrapper .clear-btn {
  position: absolute;
  right: calc(var(--space-sm) + 40px);
  width: 24px;
  height: 24px;
  padding: 0;
  min-height: auto;
  border-radius: var(--radius-full);
  background: var(--cool-grey-light);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  opacity: 0;
  pointer-events: none;
}

.search-wrapper .form-input.has-value~.clear-btn {
  opacity: 1;
  pointer-events: auto;
}

.search-wrapper .clear-btn:hover {
  background: var(--cool-grey);
  color: var(--surface);
}

.lookup-dropdown {
  position: fixed;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-16);
  max-height: 320px;
  overflow-y: auto;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.15s ease;
}

.lookup-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  height: 400px;
}

.lookup-dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid var(--border);
}

.lookup-dropdown-item:last-child {
  border-bottom: none;
}

.lookup-dropdown-item:hover,
.lookup-dropdown-item.highlighted {
  background: var(--primary-subtle);
}

.lookup-dropdown-item.highlighted {
  background: var(--primary-focus-shadow);
}

.lookup-dropdown-item .community-name {
  font-size: var(--font-size-base);
  color: var(--text-primary);
  font-weight: 500;
}

.lookup-dropdown-item.no-results {
  color: var(--text-secondary);
  font-style: italic;
  cursor: default;
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
}

.lookup-dropdown-item.no-results:hover {
  background: transparent;
}

.lookup-dropdown-item.loadingItem {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  color: var(--primary);
  padding: var(--space-xl) var(--space-lg);
  cursor: default;
}

.lookup-dropdown-item.loadingItem:hover {
  background: transparent;
}

.lookup-dropdown-item.loadingItem svg {
  width: 18px;
  height: 18px;
  animation: spin 1s linear infinite;
}

/* ============================================================
   Mobile Responsive
   ============================================================ */

@media (max-width: 768px) {
  .photo-upload-container {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .photo-preview {
    width: 80px;
    height: 80px;
    font-size: 28px;
  }

  .photo-upload-actions {
    justify-content: center;
  }

  .country-selector {
    flex-direction: column;
    gap: 8px;
  }

  .yes-no-item {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .yes-no-item>div:first-child {
    flex-direction: column;
    gap: 12px;
  }

  .yes-no-toggle {
    width: 100%;
  }

  .toggle-btn {
    flex: 1;
    padding: 10px 12px;
    min-width: 0;
    font-size: 13px;
  }

  .yes-no-question {
    font-size: 13px;
  }

  .entry-card {
    padding: 16px;
  }

  .entry-card .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .entry-card-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}

/* Switch entry cards to 2 columns earlier to account for the 320px fixed sidebar */
@media (max-width: 1100px) {
  .entry-card .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .entry-card .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Modal and Upload Components CSS
   ============================================================ */

/* ============================================================
   Modal Overlay
   ============================================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--overlay-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-28);
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.9);
  margin: auto;
  transition: all var(--transition-base);
}

.modal-overlay.active .modal {
  transform: scale(1);
  display: block;
}

.saving-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.saving-overlay-content .loading-spinner {
  border-color: var(--overlay-white-25);
  border-top-color: var(--surface);
}

.saving-overlay-text {
  color: var(--white);
  font-size: 16px;
  font-weight: 500;
}

.modal-large {
  max-width: 800px;
}

.modal-header {
  background: var(--stage-gradient);
  padding: var(--space-2xl);
  color: var(--white);
  position: relative;
}

.modal-header::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100px;
  height: 50px;
  background: var(--accent);
  opacity: 0.2;
  transform: skewX(calc(-1 * var(--cut-angle)));
  transform-origin: bottom right;
}

.modal-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
}

.modal-close {
  position: absolute;
  top: 6px;
  right: var(--space-lg);
  background: var(--overlay-white);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--white);
  transition: all var(--transition-base);
  z-index: 99999;
}

.modal-close:hover {
  background: var(--overlay-white-strong);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-body {
  padding: var(--space-2xl);
}

.modal-footer {
  padding: var(--space-lg) var(--space-2xl) var(--space-2xl);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
}

/* Validation Error Dialog */
.modal-validation {
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-validation .modal-header {
  padding: var(--space-lg);
}

.modal-validation .modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-validation .modal-footer {
  padding: var(--space-md) var(--space-lg);
}

.validation-dialog-intro {
  margin: 0 0 var(--space-md);
  color: var(--text);
}

.validation-dialog-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.validation-dialog-list li {
  padding: var(--space-md);
  border-left: 3px solid var(--error);
  background: var(--surface-raised);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: background 0.15s ease;
  line-height: 1.5;
}

.validation-dialog-list li:hover {
  background: var(--surface-hover);
}

/* ============================================================
   Drop Zone — shared upload component
   Canonical class: .drop-zone
   Aliases: .id-drop-zone (Worker Details), .upload-zone (Tasks, Driver)
   ============================================================ */

.drop-zone,
.id-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 20px 16px;
  text-align: center;
  transition: border-color .25s, background .25s;
  position: relative;
}

.drop-zone.drag-over,
.id-drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-hover-bg);
}

.drop-zone-input,
.id-drop-zone-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: -1;
}

.drop-zone-icon,
.id-drop-zone-icon {
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.drop-zone-icon svg,
.id-drop-zone-icon svg {
  width: 28px;
  height: 28px;
}

.drop-zone-title,
.id-drop-zone-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.drop-zone-sub,
.id-drop-zone-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.drop-zone-fmt,
.id-drop-zone-fmt {
  margin-top: 8px;
  font-size: 10px;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Action button row */
.drop-zone-btn-row,
.id-btn-row {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.drop-zone-action-btn,
.id-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}

.drop-zone-action-btn svg,
.id-action-btn svg {
  width: 14px;
  height: 14px;
}

.drop-zone-action-btn.primary,
.id-action-btn.primary {
  background: var(--primary);
  color: var(--surface);
}

.drop-zone-action-btn.primary:hover,
.id-action-btn.primary:hover {
  opacity: 0.9;
}

/* File selected state */
.drop-zone-file-info,
.id-upload-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--primary-hover-bg);
  border: 1.5px solid var(--primary);
  border-radius: 8px;
}

.drop-zone-file-icon,
.id-upload-file-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.drop-zone-file-icon svg,
.id-upload-file-icon svg {
  width: 14px;
  height: 14px;
}

.drop-zone-file-name,
.id-upload-file-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-zone-file-remove,
.id-upload-file-remove {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 6px;
  transition: all .2s;
}

.drop-zone-file-remove:hover,
.id-upload-file-remove:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Upload progress */
.drop-zone-progress,
.id-upload-progress {
  padding: 16px;
  text-align: center;
}

.drop-zone-progress-bar,
.id-upload-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--background);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.drop-zone-progress-fill,
.id-upload-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  width: 0%;
  transition: width .3s ease;
  animation: dropZonePulse 1.5s ease-in-out infinite;
}

@keyframes dropZonePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.drop-zone-progress-text,
.id-upload-progress-text {
  font-size: 12px;
  color: var(--text-secondary);
}

/* .upload-zone alias — matches .drop-zone visuals */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 20px 16px;
  text-align: center;
  transition: border-color .25s, background .25s;
  cursor: pointer;
  position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-hover-bg);
}

.upload-zone.has-file {
  border-style: solid;
  border-color: var(--success-border);
  background: var(--success-bg);
  padding: 8px;
  margin-top: 8px;
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-zone.has-file input[type="file"] {
  display: none;
}

.upload-zone-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: var(--primary);
}

.upload-zone-icon svg {
  width: 24px;
  height: 24px;
}

.upload-zone-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.upload-zone-hint {
  font-size: 11px;
  color: var(--text-secondary);
}

.upload-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.upload-empty svg {
  width: 32px;
  height: 32px;
  opacity: 0.5;
}

.upload-empty span {
  font-size: 14px;
}

.upload-empty .upload-hint {
  font-size: 12px;
  opacity: 0.7;
}

/* ============================================================
   Uploaded File Display
   ============================================================ */

.uploaded-file {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--surface);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
}

.uploaded-file-icon {
  width: 40px;
  height: 40px;
  background: var(--teal);
  color: var(--white);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.uploaded-file-icon svg {
  width: 20px;
  height: 20px;
}

.uploaded-file-info {
  flex: 1;
}

.uploaded-file-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: var(--font-size-base);
}

.uploaded-file-size {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.uploaded-file-remove {
  background: none;
  border: none;
  color: var(--error);
  cursor: pointer;
  padding: var(--space-sm);
}

.uploaded-file-remove:hover {
  color: var(--error);
}

.uploaded-file-remove svg {
  width: 18px;
  height: 18px;
}

/* ============================================================
   Upload Notes
   ============================================================ */

.upload-notes {
  margin-top: 20px;
}

.upload-notes-label {
  display: block;
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.upload-notes-label .optional {
  font-weight: 400;
  color: var(--warm-grey);
}

.upload-notes-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: var(--font-size-base);
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  transition: all 0.2s ease;
  background: var(--surface);
}

.upload-notes-input:hover {
  border-color: var(--cool-grey);
}

.upload-notes-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44, 112, 79, 0.1);
}

.upload-notes-input::placeholder {
  color: var(--warm-grey);
}

/* ============================================================
   Document Upload Items
   ============================================================ */

.document-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.document-upload-item,
.upload-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.document-upload-item.has-file,
.upload-item.has-file {
  border-color: var(--primary);
  background: var(--primary-hover-bg);
}

.document-upload-header,
.upload-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 20px;
  gap: 16px;
}

.document-upload-info,
.upload-info {
  flex: 1;
}

.document-upload-title,
.upload-title {
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.document-upload-description,
.upload-description {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.document-upload-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.document-upload-status svg {
  width: 14px;
  height: 14px;
}

.document-upload-zone {
  margin: 0 20px 20px 20px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.document-upload-zone:hover {
  border-color: var(--primary);
  background: var(--primary-hover-bg);
}

.document-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.document-upload-item.has-file .document-upload-zone input[type="file"] {
  display: none;
}

.document-upload-item.has-file .document-upload-zone {
  border-style: solid;
  border-color: var(--primary);
  background: var(--primary-hover-bg);
  padding: 16px;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.upload-placeholder svg {
  width: 32px;
  height: 32px;
  opacity: 0.5;
}

.upload-placeholder span {
  font-size: 14px;
}

.upload-placeholder .upload-hint {
  font-size: 12px;
  opacity: 0.7;
}

.optional-badge,
.required-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid;
}

.optional-badge {
  background: var(--background);
  color: var(--text-secondary);
  border-color: var(--border);
}

.required-badge {
  background: var(--error);
  color: var(--white);
  border-color: var(--error);
}

/* ============================================================
   Document Viewer Modal
   ============================================================ */

.document-viewer-body {
  padding: 24px;
  padding-bottom: 16px;
}

.document-viewer {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  height: 400px;
  position: relative;
  overflow: hidden;
}

.document-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--background);
  z-index: 1;
}

.document-loading p {
  color: var(--text-secondary);
  font-size: var(--font-size-base);
}

.document-loading.hidden {
  display: none;
}

.document-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: var(--surface);
}

.document-info {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.document-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.document-info-label {
  font-size: 12px;
  color: var(--warm-grey);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.document-info-value {
  font-size: var(--font-size-base);
  color: var(--text-primary);
  font-weight: 500;
}

.document-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
}

/* ============================================================
   DocuSign Modal
   ============================================================ */

.docusign-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-dark-strong);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.docusign-modal-content {
  background: var(--surface);
  width: 90%;
  height: 90%;
  max-width: 1200px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.docusign-modal-header {
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.docusign-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.close-modal {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--gray-600);
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
}

.close-modal:hover {
  color: var(--text-primary);
}

.docusign-modal-body {
  flex: 1;
  overflow: hidden;
}

#docusignIframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ============================================================
   DocuSign Container
   ============================================================ */

.docusign-container {
  background: var(--background);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.docusign-icon {
  width: 80px;
  height: 80px;
  background: var(--gradient-gold);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: var(--shadow-8);
}

.docusign-icon svg {
  width: 40px;
  height: 40px;
  color: var(--text-primary);
}

.docusign-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.docusign-description {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.docusign-status {
  margin: 24px;
  padding: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 500;
}

.docusign-status.pending {
  background: var(--accent-light);
  color: var(--accent-warm);
}

.docusign-status.signed {
  background: var(--primary-focus-shadow);
  color: var(--primary);
}

.docusign-status svg {
  width: 20px;
  height: 20px;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
  .modal {
    width: 95%;
    max-height: 95vh;
  }

  .upload-zone {
    padding: 20px 16px;
  }

  .uploaded-file {
    flex-wrap: wrap;
    gap: 8px;
  }

  .uploaded-file-info {
    flex: 1;
    min-width: 150px;
  }

  .document-viewer {
    height: 300px;
  }

  .document-info {
    flex-direction: column;
    gap: 12px;
  }

  .document-upload-header,
  .upload-header {
    flex-direction: column;
    gap: 12px;
  }

  .document-upload-status {
    align-self: flex-start;
  }

  .document-upload-zone {
    padding: 20px 16px;
  }

  .docusign-container {
    padding: 24px 20px;
  }

  .docusign-icon {
    width: 48px;
    height: 48px;
  }

  .docusign-title {
    font-size: 18px;
  }
}


#content {
  margin-top: var(--header-height);
}

/* ============================================================
   LOGIN PAGE STYLES (Anonymous/Unauthenticated Users)
   All styles scoped under .loginpage
   ============================================================ */

.loginpage .logo-text {
  display: flex;
  flex-direction: column;
}

.loginpage .logo-text h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.loginpage .logo-text span {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.loginpage .header-signin {
  padding: 10px 24px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.loginpage .header-signin:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-8);
}

/* ============================================================
   HERO SECTION
   ============================================================ */

.loginpage .hero {
  min-height: calc(100vh - var(--space-lg));
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.loginpage .hero-background {
  position: absolute;
  inset: 0;
  background: var(--stage-gradient);
}

/* Video Background */
.loginpage .hero-video-wrapper {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.loginpage .hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.loginpage .hero-video-overlay {
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
  pointer-events: none;
}

/* Decorative cut-angle elements */
.loginpage .hero-decoration-1 {
  position: absolute;
  right: -100px;
  top: -100px;
  width: 500px;
  height: 500px;
  background: var(--accent);
  opacity: 0.15;
  transform: skewX(calc(-1 * var(--cut-angle))) rotate(-15deg);
  animation: float-hero 20s ease-in-out infinite;
  z-index: 1;
}

.loginpage .hero-decoration-2 {
  position: absolute;
  right: 10%;
  bottom: -150px;
  width: 400px;
  height: 400px;
  background: var(--accent);
  opacity: 0.18;
  transform: skewX(calc(-1 * var(--cut-angle)));
  animation: float-hero 25s ease-in-out infinite reverse;
  z-index: 1;
}

.loginpage .hero-decoration-3 {
  position: absolute;
  left: -200px;
  bottom: 20%;
  width: 300px;
  height: 600px;
  background: var(--surface);
  opacity: 0.05;
  transform: skewX(calc(-1 * var(--cut-angle)));
  z-index: 1;
}

/* Subtle grid pattern */
.loginpage .hero-pattern {
  position: absolute;
  inset: 0;
  background-image: var(--gradient-grid-pattern);
  background-size: 60px 60px;
  z-index: 1;
}

@keyframes float-hero {

  0%,
  100% {
    transform: skewX(calc(-1 * var(--cut-angle))) translateY(0px) rotate(-15deg);
  }

  50% {
    transform: skewX(calc(-1 * var(--cut-angle))) translateY(30px) rotate(-15deg);
  }
}

.loginpage .hero-content {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  padding: 60px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.loginpage .hero-text {
  animation: slideUp 0.8s ease;
}

.loginpage .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--overlay-white-12);
  padding: 8px 16px;
  border-radius: 50px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.loginpage .hero-badge-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

.loginpage .hero-badge span {
  color: var(--overlay-white-solid);
  font-size: 13px;
  font-weight: 500;
}

.loginpage .hero-title {
  font-size: 52px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -1.5px;
}

.loginpage .hero-title .highlight {
  color: var(--accent);
}

.loginpage .hero-subtitle {
  font-size: 18px;
  color: var(--overlay-white-80);
  line-height: 1.6;
  margin-bottom: 40px;
  max-width: 480px;
}

.loginpage .hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Login page specific button overrides */
.loginpage .btn-primary {
  padding: 16px 36px;
  font-size: 16px;
}

.loginpage .btn-primary:hover svg {
  transform: translateX(4px);
}

.loginpage .btn-secondary {
  padding: 16px 28px;
  background: var(--overlay-white);
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  font-size: 16px;
}

.loginpage .btn-secondary:hover {
  background: var(--overlay-white-18);
  border-color: var(--overlay-white-40);
}

/* ============================================================
   HERO CARD
   ============================================================ */

.loginpage .hero-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow-28);
  position: relative;
  overflow: hidden;
  animation: slideUp 0.8s ease 0.2s both;
}

.loginpage .hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: var(--accent);
  opacity: 0.08;
  transform: skewX(calc(-1 * var(--cut-angle)));
  transform-origin: top right;
}

.loginpage .card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.loginpage .card-icon {
  width: 56px;
  height: 56px;
  background: var(--stage-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loginpage .card-icon svg {
  width: 28px;
  height: 28px;
  color: var(--white);
}

.loginpage .card-header-text h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.loginpage .card-header-text p {
  font-size: 14px;
  color: var(--text-secondary);
}

.loginpage .feature-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.loginpage .feature-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: var(--background);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.loginpage .feature-item:hover {
  background: var(--surface-alt);
}

.loginpage .feature-check {
  width: 24px;
  height: 24px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.loginpage .feature-check svg {
  width: 14px;
  height: 14px;
  color: var(--white);
}

.loginpage .feature-text {
  flex: 1;
}

.loginpage .feature-text strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.loginpage .feature-text span {
  font-size: 13px;
  color: var(--text-secondary);
}

.loginpage .card-signin {
  width: 100%;
  padding: 18px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.loginpage .card-signin:hover {
  color: var(--white);
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 163, 0, 0.35);
}

.loginpage .card-signin svg {
  width: 20px;
  height: 20px;
}

.loginpage .card-help {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

.loginpage .card-help a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 500;
}

.loginpage .card-help a:hover {
  text-decoration: underline;
}

/* ============================================================
   VALUES SECTION
   ============================================================ */

.loginpage .values-section {
  background: var(--surface);
  padding: 80px 40px;
}

.loginpage .values-container {
  max-width: 1200px;
  margin: 0 auto;
}

.loginpage .values-header {
  text-align: center;
  margin-bottom: 56px;
}

.loginpage .values-header h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.loginpage .values-header p {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

.loginpage .values-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.loginpage .value-card {
  background: var(--background);
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.loginpage .value-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 60px;
  height: 40px;
  background: var(--primary);
  opacity: 0;
  transform: skewX(calc(-1 * var(--cut-angle)));
  transition: all 0.3s ease;
}

.loginpage .value-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-8);
  transform: translateY(-4px);
}

.loginpage .value-card:hover::after {
  opacity: 0.1;
}

.loginpage .value-emoji {
  font-size: 36px;
  margin-bottom: 16px;
  display: block;
}

.loginpage .value-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.loginpage .value-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  .loginpage .header-signin {
    padding: 8px 16px;
    font-size: 13px;
  }

  .loginpage .btn-primary,
  .loginpage .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .loginpage .hero-card {
    padding: 28px;
  }

  .loginpage .values-section {
    padding: 60px 20px;
  }

  .loginpage .values-grid {
    grid-template-columns: 1fr;
  }

}

/* ============================================================
   SHARED TASK STYLES
   Used by Tasks page and All My Tasks page
   ============================================================ */

/* Page Hero */
.page-hero {
  background: var(--stage-gradient);
  border-radius: var(--radius-2xl);
  padding: var(--space-2xl);
  margin-bottom: var(--space-2xl);
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-xl);
  align-items: center;
  box-shadow: var(--shadow-16);
  animation: slideUp 0.5s ease;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: var(--accent);
  opacity: 0.1;
  border-radius: 50%;
}

.page-hero::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 180px;
  height: 100px;
  background: var(--accent);
  opacity: 0.15;
  transform: skewX(calc(-1 * var(--cut-angle)));
  transform-origin: bottom right;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-icon {
  font-size: 32px;
  margin-bottom: 8px;
  display: inline-block;
  animation: bounce 2s ease infinite;
}

.hero-title {
  color: var(--white);
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: 8px;
}

.hero-subtitle {
  color: var(--overlay-white-80);
  font-size: 15px;
  line-height: 1.6;
  max-width: 500px;
}

/* Progress Dial in Hero */
.hero-progress-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hero-progress-dial {
  position: relative;
  width: 160px;
  height: 160px;
}

.hero-progress-dial svg {
  transform: rotate(-90deg);
  width: 160px;
  height: 160px;
}

.hero-dial-bg {
  fill: none;
  stroke: var(--overlay-white-15);
  stroke-width: 12;
}

.hero-dial-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.hero-dial-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-dial-percent {
  font-size: 36px;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}

.hero-dial-label {
  font-size: 12px;
  color: var(--overlay-white-70);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-progress-stats {
  display: flex;
  gap: 20px;
}

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
}

.hero-stat-label {
  font-size: 11px;
  color: var(--overlay-white-60);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Filter Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  animation: slideUp 0.5s ease 0.1s backwards;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  background: var(--surface);
  padding: 6px;
  border-radius: 10px;
  box-shadow: var(--shadow-4);
}

.filter-tab {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--font-size-base);
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}

.filter-tab:hover {
  background: var(--background);
  color: var(--text-primary);
}

.filter-tab.active {
  background: var(--primary);
  color: var(--white);
}

.filter-tab .badge {
  background: var(--overlay-dark-15);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.filter-tab.active .badge {
  background: var(--overlay-white-25);
}

.status-filters {
  display: flex;
  gap: 12px;
  align-items: center;
}

.status-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.status-filter:hover {
  border-color: var(--primary);
}

.status-filter.active {
  border-color: var(--primary);
  background: var(--primary-hover-bg);
  color: var(--primary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.todo {
  background: var(--accent);
}

.status-dot.completed {
  background: var(--success);
}

.status-dot.overdue {
  background: var(--error);
}

.search-box {
  position: relative;
}

.search-box input {
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: var(--font-size-base);
  width: 240px;
  background: var(--surface);
  transition: all 0.2s ease;
  font-family: inherit;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44, 112, 79, 0.1);
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--warm-grey);
}

/* Tasks Container */
.tasks-container {
  display: grid;
  gap: 16px;
  animation: slideUp 0.5s ease 0.2s backwards;
}

/* Task Card */
.task-card-new {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
}

.task-card-new::before {
  display: none;
}

.task-card-new:not(.completed):hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.task-card-new.completed {
  background: var(--bg-light);
}

.task-card-new.completed .task-type-icon-new {
  background: var(--primary);
}
.task-card-new.completed .task-type-icon-new svg {
  stroke: var(--white);
}

.task-card-new.overdue {
  border-left: 3px solid var(--error);
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.1), 0 1px 2px rgba(0,0,0,0.06);
}

/* Task Type Icon */
.task-type-icon-new {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.task-type-icon-new svg {
  width: 16px;
  height: 16px;
  color: var(--white);
}

.task-type-icon-new.document {
  background: var(--gradient-teal-primary);
}

.task-type-icon-new.signature {
  background: var(--gradient-accent-warm);
}

.task-type-icon-new.form {
  background: var(--gradient-highlight-teal);
}

/* Task Info */
.task-info-new {
  flex: 1;
  min-width: 0;
}

.task-header-new {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}

.task-title-new {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.task-card-new.completed .task-title-new {
  color: var(--text-secondary);
}

.task-badge-new {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.task-badge-new.general {
  background: var(--teal-medium);
  color: var(--teal);
}

.task-badge-new.payroll {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.task-badge-new.overdue {
  background: var(--error-light);
  color: var(--error);
}

.task-description-new {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.task-meta-new {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--warm-grey);
}

.task-meta-item-new {
  display: flex;
  align-items: center;
  gap: 5px;
}

.task-meta-item-new svg {
  width: 14px;
  height: 14px;
}

.task-meta-item-new.overdue {
  color: var(--error);
  font-weight: 500;
}

/* Task Actions */
.task-actions-new {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}
.task-actions-new .btn {
  font-size: 12px !important;
  padding: 6px 12px !important;
  min-height: auto !important;
  gap: 5px !important;
  white-space: nowrap;
  border-radius: 6px !important;
}
.task-actions-new .btn svg {
  width: 14px !important;
  height: 14px !important;
}

/* Completed badge */
.task-completed-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}
.task-completed-badge svg {
  width: 14px;
  height: 14px;
  stroke: var(--primary);
}

/* Empty State */
.empty-state-new {
  text-align: center;
  padding: 64px 32px;
  background: var(--surface);
  border-radius: var(--radius-2xl);
  border: 2px dashed var(--border);
}

.empty-state-icon-new {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: var(--gradient-primary-teal);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state-icon-new svg {
  width: 40px;
  height: 40px;
  color: var(--white);
}

.empty-state-title-new {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state-text-new {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto;
}

/* Complete Journey Section */
.complete-journey-section {
}

.complete-journey-card {
  background: var(--gradient-subtle-blend);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-lg) var(--space-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.complete-journey-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.complete-journey-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.complete-journey-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Complete Journey Button - Large CTA variant */
.btn-complete-journey {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  background-color: var(--accent);
  border: 1px solid var(--accent);
  color: var(--white);
  border-radius: 2px;
  font-size: var(--font-size-md);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.1s ease, border-color 0.1s ease;
  font-family: inherit;
  position: relative;
  z-index: 1;
}

.btn-complete-journey:hover:not(:disabled) {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-complete-journey:focus:not(:disabled) {
  outline: none;
  box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--accent);
}

.btn-complete-journey:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-complete-journey svg {
  width: 20px;
  height: 20px;
}

.btn-complete-journey.loading {
  color: transparent !important;
  pointer-events: none;
  position: relative;
  animation: none !important;
  transform: none !important;
}

.btn-complete-journey.loading svg {
  visibility: hidden;
}

.btn-complete-journey.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 16px 20px;
  box-shadow: var(--shadow-16);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 400px;
  transform: translateX(120%);
  transition: transform 0.3s ease;
  border-left: 4px solid var(--primary);
}

.toast.visible {
  transform: translateX(0);
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--error);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.toast.success .toast-icon {
  color: var(--success);
}

.toast.error .toast-icon {
  color: var(--error);
}

.toast.warning .toast-icon {
  color: var(--warning);
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Shared Task Responsive Styles */
@media (max-width: 1200px) {
  .page-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-subtitle {
    margin: 0 auto;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .search-box input {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .task-card-new {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px;
  }

  .task-type-icon-new {
    width: 44px;
    height: 44px;
  }

  .task-type-icon-new svg {
    width: 22px;
    height: 22px;
  }

  .task-actions-new {
    width: 100%;
  }

  .task-actions-new .btn {
    flex: 1;
    justify-content: center;
  }

  .hero-progress-dial {
    width: 130px;
    height: 130px;
  }

  .hero-progress-dial svg {
    width: 130px;
    height: 130px;
  }

  .hero-dial-percent {
    font-size: 28px;
  }

  .status-filters {
    flex-wrap: wrap;
  }
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  background: var(--stage-gradient);
  position: fixed;
  bottom: 0;
  width: 100%;
  overflow: hidden;
  height: calc(36px + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  transition: height 0.3s ease, opacity 0.3s ease;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.footer.footer-shrunk {
  height: 24px;
  opacity: 0.85;
}

.footer.footer-shrunk .footer-logo .logo-bar {
  height: 14px;
  width: 8px;
}

.footer.footer-shrunk .footer-brand-text strong {
  font-size: 10px;
}

.footer.footer-shrunk .footer-tagline {
  display: none;
}

.footer-decoration {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 200px;
  background: var(--accent);
  opacity: 0.1;
  transform: skewX(calc(-1 * var(--cut-angle)));
  transform-origin: bottom right;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
  width: 100%;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 3px;
}

.footer-logo .logo-bar {
  width: 12px;
  height: 20px;
  transition: width 0.3s ease, height 0.3s ease;
}

.footer-brand-text {
  color: var(--white);
}

.footer-brand-text strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  transition: font-size 0.3s ease;
}

.footer-brand-text span {
  font-size: 10px;
  opacity: 0.7;
}

.footer-tagline {
  color: var(--overlay-white-80);
  font-size: 11px;
  font-style: italic;
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 32px;
}

.footer-links a {
  color: var(--overlay-white-80);
  text-decoration: none;
  font-size: 11px;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--white);
}

@media (max-width: 600px) {
  .footer {
    height: auto;
    padding: 12px 0 max(12px, env(safe-area-inset-bottom, 12px));
  }

  .footer-content {
    flex-direction: column;
    gap: 12px;
    padding: 8px 20px;
    text-align: center;
  }

  .footer-brand {
    justify-content: center;
  }

  .footer-links {
    gap: 16px;
    justify-content: center;
  }

  .footer-tagline {
    display: none;
  }
}

/* ============================================================
   SHARED COMPONENTS - Consolidated from page-specific CSS
   ============================================================ */

/* Additional Animation Keyframes */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(-10vh) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg);
  }
}

/* ============================================================
   Photo Upload Component (Worker Details)
   ============================================================ */

.photo-upload-container {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--gradient-teal-surface);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
}

.photo-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--border);
}

.photo-preview.has-photo {
  background: transparent;
  border-color: var(--primary);
}

.photo-preview.no-photo {
  background: var(--background-alt);
  color: var(--border);
  border-color: var(--border);
}

.photo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.photo-preview.loading {
  position: relative;
}

.photo-preview.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--overlay-dark);
  border-radius: inherit;
}

.photo-upload-content {
  flex: 1;
}

.photo-upload-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.photo-upload-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.photo-upload-actions {
  display: flex;
  gap: var(--space-sm);
}

.photo-upload-input {
  display: none;
}

/* ============================================================
   Redirect Overlay (Tasks Page)
   ============================================================ */

.redirect-overlay {
  position: fixed;
  inset: 0;
  background: var(--hero-overlay);
  z-index: 9999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--white);
  text-align: center;
  padding: 40px;
}

.redirect-overlay.visible {
  display: flex;
}

.redirect-spinner-large {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 24px;
}

.redirect-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  animation: fadeInUp 0.5s ease 0.2s both;
}

.redirect-message {
  font-size: 16px;
  opacity: 0.9;
  animation: fadeInUp 0.5s ease 0.4s both;
}

.redirect-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 13px;
}

.redirect-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ============================================================
   Completion/Success Overlay (Completed Page)
   ============================================================ */

.completion-video-wrapper {
  position: fixed;
  inset: 0;
  z-index: 999;
  overflow: hidden;
}

.completion-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.completion-video-overlay {
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
  pointer-events: none;
}

.completion-overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 1000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--white);
  padding: 40px 20px;
  text-align: center;
}

.completion-overlay.visible {
  display: flex;
}

.completion-icon {
  width: 120px;
  height: 120px;
  background: var(--surface);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  animation: scaleIn 0.6s ease 0.3s both;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.completion-icon svg {
  width: 60px;
  height: 60px;
  color: var(--primary);
}

.completion-title {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 16px;
  animation: fadeInUp 0.8s ease 0.5s both;
}

.completion-subtitle {
  font-size: 20px;
  opacity: 0.9;
  margin-bottom: 12px;
  animation: fadeInUp 0.8s ease 0.7s both;
}

.completion-message {
  font-size: 16px;
  opacity: 0.8;
  max-width: 500px;
  line-height: 1.7;
  margin-bottom: 40px;
  animation: fadeInUp 0.8s ease 0.9s both;
}

.completion-next-steps {
  background: var(--overlay-white);
  border-radius: 16px;
  padding: 24px 32px;
  max-width: 500px;
  width: 100%;
  animation: fadeInUp 0.8s ease 1.1s both;
  backdrop-filter: blur(10px);
}

.completion-next-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
  margin-bottom: 16px;
}

.completion-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.completion-step:last-child {
  border-bottom: none;
}

.completion-step-icon {
  width: 32px;
  height: 32px;
  background: var(--overlay-white-15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.completion-step-text {
  font-size: 14px;
  opacity: 0.9;
}

.completion-footer {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  animation: fadeInUp 0.8s ease 1.3s both;
}

.completion-logo {
  display: flex;
  align-items: center;
  gap: 4px;
}

.completion-logo-bar {
  width: 40px;
  height: 56px;
  transform: skewX(calc(-1 * var(--cut-angle)));
}

.completion-logo-bar.orange,
.completion-logo-bar.bar-secondary {
  background: var(--accent);
}

.completion-logo-bar.green,
.completion-logo-bar.bar-primary {
  background: var(--primary);
}

/* Success State */
.success-state {
  text-align: center;
  padding: 60px 40px;
}

.success-icon {
  width: 100px;
  height: 100px;
  background: var(--gradient-primary-teal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  animation: scaleIn 0.5s ease;
}

.success-icon svg {
  width: 50px;
  height: 50px;
  color: var(--white);
}

.success-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}

.success-message {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
  max-width: 500px;
  margin: 0 auto;
}

/* State Container */
.state-container {
  text-align: center;
  padding: 64px 32px;
  background: var(--surface);
  border-radius: var(--radius-2xl);
}

.error-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: var(--error-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--error);
}

.error-icon svg {
  width: 40px;
  height: 40px;
}

.state-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.state-message {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto 24px;
}

/* Confetti */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1001;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -20px;
}

/* ============================================================
   Completion/Success Responsive
   ============================================================ */

@media (max-width: 768px) {
  .photo-upload-container {
    flex-direction: column;
    text-align: center;
  }

  .photo-upload-actions {
    justify-content: center;
  }

  .completion-overlay {
    padding: 20px;
    padding-bottom: 120px;
  }

  .completion-icon {
    width: 90px;
    height: 90px;
    margin-bottom: 24px;
  }

  .completion-icon svg {
    width: 45px;
    height: 45px;
  }

  .completion-title {
    font-size: 28px;
  }

  .completion-subtitle {
    font-size: 16px;
  }

  .completion-message {
    font-size: 14px;
    margin-bottom: 28px;
  }

  .completion-next-steps {
    padding: 20px;
  }

  .completion-footer {
    bottom: 24px;
    gap: 16px;
  }

  .completion-logo-bar {
    width: 32px;
    height: 44px;
  }

  .success-state {
    padding: 40px 20px;
  }

  .success-icon {
    width: 80px;
    height: 80px;
  }

  .success-title {
    font-size: 24px;
  }

  .success-message {
    font-size: 14px;
  }
}

/* ============================================================
   Custom Date Picker (.wh-dp-*)
   Month/year dropdown picker for date-of-birth fields
   ============================================================ */

.wh-dp-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
}

.wh-dp-wrap input[type="date"] {
  cursor: pointer;
  width: 100%;
}

/* Hide native calendar icon */
.wh-dp-wrap input[type="date"]::-webkit-calendar-picker-indicator {
  display: none;
  -webkit-appearance: none;
}

.wh-dp-panel {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 9999;
  width: 320px;
  max-width: calc(100vw - 24px);
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  box-shadow: var(--shadow-16);
  padding: 12px;
  display: none;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

.wh-dp-panel.open {
  display: block;
}

/* Header row: arrows + month/year selects */
.wh-dp-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.wh-dp-header button {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  transition: background 0.15s;
}

.wh-dp-header button:hover {
  background: var(--primary);
  color: var(--white);
}

.wh-dp-header select {
  flex: 1;
  height: 32px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-primary);
  font-size: 13px;
  padding: 0 4px;
  cursor: pointer;
}

.wh-dp-header select:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}

/* Day-of-week labels */
.wh-dp-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  user-select: none;
}

/* Day grid */
.wh-dp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.wh-dp-day {
  width: 100%;
  aspect-ratio: 1;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
  padding: 0;
}

.wh-dp-day:hover:not(.selected):not(.disabled) {
  background: var(--primary);
  color: var(--white);
  opacity: 0.7;
}

.wh-dp-day.selected {
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
}

.wh-dp-day.today:not(.selected) {
  border: 2px solid var(--primary);
}

.wh-dp-day.disabled {
  color: var(--text-secondary);
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.wh-dp-day.other-month {
  visibility: hidden;
}

/* Footer row: Today / Clear */
.wh-dp-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  gap: 8px;
}

.wh-dp-footer button {
  flex: 1;
  height: 30px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.wh-dp-footer button:hover {
  background: var(--primary);
  color: var(--white);
}

/* ============================================================
   Accessibility - Reduced Motion Support
   Respects user's system preference for reduced motion
   ============================================================ */

@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;
  }

  .stage-card,
  .task-card,
  .entry-card,
  .modal {
    animation: none !important;
  }

  .progress-sidebar,
  .sidebar-overlay {
    transition: none !important;
  }

  .loading-spinner {
    animation: none !important;
  }
}

/* ============================================================
   Guidance Banner — Shared across all onboarding pages
   ============================================================ */
.guidance-banner {
  display: none; /* Temporarily disabled */
  /* display: flex; */
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--info-bg);
  border: 1px solid var(--primary);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  position: relative;
  transition: opacity 0.3s ease, max-height 0.3s ease;
}

.guidance-banner.hiding {
  opacity: 0;
  max-height: 0;
  margin-bottom: 0;
  padding: 0;
  overflow: hidden;
}

.guidance-banner-icon {
  flex-shrink: 0;
  color: var(--primary);
  margin-top: 2px;
}

.guidance-banner-content {
  flex: 1;
  min-width: 0;
}

.guidance-banner-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.guidance-banner-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.guidance-steps-list {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

.guidance-steps-list li {
  margin-bottom: 4px;
}

.guidance-steps-list li:last-child {
  margin-bottom: 0;
}

.guidance-banner-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.guidance-banner-dismiss:hover {
  background: var(--background);
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .guidance-banner {
    padding: 14px;
    gap: 10px;
  }

  .guidance-banner-title {
    font-size: 14px;
  }
}

.guidance-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin: 0;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.guidance-toggle.visible {
  display: inline-flex;
}

.guidance-toggle:hover {
  background: var(--background);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.guidance-toggle svg {
  flex-shrink: 0;
}

/* ==========================================================================
   Read-Only Mode — Completed/Submitted Journeys
   ========================================================================== */

/* Text inputs + textareas: lock icon right-aligned inside field */
.page-readonly .stage-body [inert] .form-input,
.page-readonly .stage-body [inert] .form-textarea {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") !important;
  background-size: 14px 14px !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  padding-right: 32px;
  opacity: 0.7;
  cursor: default;
  color: var(--text-secondary);
}

/* Selects: lock positioned left of browser dropdown arrow */
.page-readonly .stage-body [inert] .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") !important;
  background-size: 14px 14px !important;
  background-repeat: no-repeat !important;
  background-position: right 30px center !important;
  padding-right: 48px;
  opacity: 0.7;
  cursor: default;
  color: var(--text-secondary);
}

.page-readonly .stage-body [inert] button,
.page-readonly .stage-body [inert] .toggle-btn {
  opacity: 0.7;
  cursor: default;
}

/* Checkboxes, radios, and their labels */
.page-readonly .stage-body [inert] .checkbox-input,
.page-readonly .stage-body [inert] .radio-input,
.page-readonly .stage-body [inert] input[type="checkbox"],
.page-readonly .stage-body [inert] input[type="radio"],
.page-readonly .stage-body [inert] .checkbox-label,
.page-readonly .stage-body [inert] .radio-label,
.page-readonly .stage-body [inert] .checkbox-group,
.page-readonly .stage-body [inert] .radio-group {
  opacity: 0.7;
  cursor: default;
}

/* File upload zones and uploaded file cards */
.page-readonly .stage-body [inert] .upload-zone,
.page-readonly .stage-body [inert] .drop-zone,
.page-readonly .stage-body [inert] .id-drop-zone,
.page-readonly .stage-body [inert] .document-upload-zone,
.page-readonly .stage-body [inert] .uploaded-file,
.page-readonly .stage-body [inert] .drop-zone-file-info,
.page-readonly .stage-body [inert] .id-upload-file-info {
  opacity: 0.7;
  cursor: default;
  pointer-events: none;
}

.page-readonly .btn-save {
  display: none !important;
}

.page-readonly .stage-body .add-entry-btn,
.page-readonly .photo-upload-container {
  display: none !important;
}

.page-readonly .save-status,
.page-readonly .save-helper-text {
  display: none;
}

.readonly-banner {
  display: none;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-bottom: var(--space-lg);
}

.page-readonly .readonly-banner {
  display: flex;
}

.readonly-banner svg {
  flex-shrink: 0;
}

/* ============================================
   Help Drawer
   ============================================ */

/* Trigger button — positioned top-right of stage-header */
.help-trigger-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s ease;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.help-trigger-btn svg {
  width: 18px;
  height: 18px;
}
.help-trigger-btn:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transform: scale(1.05);
}
.help-trigger-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Backdrop */
.help-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay-dark-40);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.help-drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

/* Drawer panel */
.help-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 100vw;
  height: 100vh;
  background: var(--surface);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
}
.help-drawer.open {
  transform: translateX(0);
}

/* Header */
.help-drawer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.help-drawer-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.help-drawer-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
  line-height: 1.3;
}
.help-drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.help-drawer-close svg {
  width: 18px;
  height: 18px;
}
.help-drawer-close:hover {
  background: var(--error-light);
  color: var(--error);
}

/* Body — scrollable content area */
.help-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.7;
}
.help-drawer-body h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 24px 0 8px 0;
}
.help-drawer-body h3:first-child {
  margin-top: 0;
}
.help-drawer-body p {
  margin: 0 0 12px 0;
  color: var(--text-secondary);
}
.help-drawer-body ul {
  margin: 0 0 16px 0;
  padding-left: 20px;
}
.help-drawer-body li {
  margin-bottom: 6px;
  color: var(--text-secondary);
}
.help-drawer-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Footer */
.help-drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.help-drawer-contact {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}
.help-drawer-contact a {
  color: var(--accent);
  text-decoration: none;
}
.help-drawer-contact a:hover {
  text-decoration: underline;
}

/* Mobile */
@media (max-width: 768px) {
  .help-drawer {
    width: 100vw;
  }
  .help-trigger-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    top: auto;
    width: 44px;
    height: 44px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    z-index: 999;
  }
  .help-trigger-btn svg {
    width: 20px;
    height: 20px;
  }
}