/* ========================================
   CSS Custom Properties (Design Tokens)
   MGH ED Patient Portal
   ======================================== */

:root {
  /* MGH Brand Colors - matched to the MGH logo green */
  --brand-primary: #76B043;
  --brand-primary-light: #8EC95E;
  --brand-secondary: #4A7A28;

  /* Section Card Colors - Vibrant red-to-green gradient for main sections */
  --section-red: #FFBABA;
  --section-red-end: #FFA0A0;
  --section-orange: #FFD6A5;
  --section-orange-end: #FFC078;
  --section-yellow: #E8E4A0;
  --section-yellow-end: #D6D080;
  --section-green: #A8E6B0;
  --section-green-end: #88D898;
  --section-teal: #A0D8D0;
  --section-teal-end: #80C8BE;
  --section-blue: #A8D8F0;
  --section-blue-end: #88C8E8;
  --section-gray: #DEDEDE;
  --section-gray-end: #CCCCCC;

  /* Section Glass Colors (translucent gradient endpoints) */
  --section-red-glass: rgba(255, 190, 190, 0.7);
  --section-red-glass-end: rgba(255, 130, 130, 0.7);
  --section-orange-glass: rgba(255, 218, 170, 0.7);
  --section-orange-glass-end: rgba(255, 170, 90, 0.7);
  --section-yellow-glass: rgba(235, 230, 165, 0.7);
  --section-yellow-glass-end: rgba(200, 195, 100, 0.7);
  --section-green-glass: rgba(170, 235, 180, 0.7);
  --section-green-glass-end: rgba(110, 205, 130, 0.7);
  --section-teal-glass: rgba(160, 216, 208, 0.7);
  --section-teal-glass-end: rgba(100, 180, 170, 0.7);
  --section-blue-glass: rgba(170, 220, 245, 0.7);
  --section-blue-glass-end: rgba(110, 185, 230, 0.7);
  --section-gray-glass: rgba(225, 225, 225, 0.7);
  --section-gray-glass-end: rgba(190, 190, 190, 0.7);

  /* Semantic Colors */
  --bg: #FFFFFF;
  --bg-surface: #F8F9FA;
  --bg-overlay: rgba(0, 0, 0, 0.6);
  --text: #1A1A1A;
  --text-secondary: #555555;
  --text-muted: #6B6B6B;
  --border: #DDDDDD;
  --focus-ring: #76B043;
  --text-on-brand: #FFFFFF;
  --link: #4A7A28;
  --link-hover: #365A1D;
  --entrance-arrow: #005EB8;
  --brand-primary-shadow: rgba(118, 176, 67, 0.3);

  /* Spacing Scale */
  --space-2xs: 0.25rem;  /* 4px */
  --space-xs: 0.5rem;    /* 8px */
  --space-sm: 1rem;      /* 16px */
  --space-md: 1.5rem;    /* 24px */
  --space-lg: 2rem;      /* 32px */
  --space-xl: 3rem;      /* 48px */

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-size-base: 1rem;       /* 16px */
  --font-size-sm: 0.875rem;     /* 14px */
  --font-size-lg: 1.125rem;     /* 18px */
  --font-size-xl: 1.25rem;      /* 20px */
  --font-size-2xl: 1.5rem;      /* 24px */
  --line-height: 1.6;
  --line-height-tight: 1.3;

  /* Layout */
  --max-width: 600px;
  --border-radius: 16px;
  --border-radius-sm: 12px;
  --header-height: auto;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms ease;

  /* Shadows (blue-tinted for depth) */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(31, 38, 135, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 32px rgba(31, 38, 135, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);

  /* Touch Targets */
  --min-touch-target: 44px;

  /* Icons & Arrows */
  --icon-size: 24px;
  --arrow-size: 10px;
  --arrow-size-sm: 8px;
  --arrow-border-width: 2px;

  /* Focus Ring */
  --focus-outline: 3px solid var(--focus-ring);
  --focus-offset: 2px;

  /* Glass Material System */
  --glass-blur: 8px;
  --glass-saturate: 160%;
  --glass-bg-light: rgba(255, 255, 255, 0.72);
  --glass-bg-medium: rgba(255, 255, 255, 0.55);
  --glass-bg-heavy: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.12);
  --glass-inner-glow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  --glass-transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-pill: 2rem;
  --glass-bg-opaque: rgba(248, 249, 250, 0.97);
  --glass-gloss: rgba(255, 255, 255, 0.45);
  --glass-gloss-end: rgba(255, 255, 255, 0.05);
}

/* ========================================
   Dark Mode Overrides
   ======================================== */
[data-theme="dark"] {
  --bg: #121212;
  --bg-surface: #1E1E1E;
  --bg-overlay: rgba(0, 0, 0, 0.8);
  --text: #E5E5E5;
  --text-secondary: #AAAAAA;
  --text-muted: #999999;
  --border: #333333;
  --focus-ring: #8EC95E;
  --link: #8EC95E;
  --link-hover: #B2D235;
  --entrance-arrow: #4DA3E8;
  --brand-primary-shadow: rgba(142, 201, 94, 0.25);
  --flow-step-bg: var(--brand-secondary);
  --flow-step-text: #E5E5E5;

  /* Dark mode section colors - vibrant enough to differentiate */
  --section-red: #5C2828;
  --section-red-end: #401818;
  --section-orange: #5C3A1C;
  --section-orange-end: #402810;
  --section-yellow: #504C1E;
  --section-yellow-end: #383512;
  --section-green: #1E5C22;
  --section-green-end: #124016;
  --section-teal: #1E4C48;
  --section-teal-end: #123832;
  --section-blue: #1E3E5C;
  --section-blue-end: #122C40;
  --section-gray: #3C3C3C;
  --section-gray-end: #2C2C2C;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

  /* Glass Material System - Dark Mode */
  --glass-bg-light: rgba(30, 30, 30, 0.72);
  --glass-bg-medium: rgba(30, 30, 30, 0.55);
  --glass-bg-heavy: rgba(30, 30, 30, 0.85);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --glass-inner-glow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --glass-bg-opaque: rgba(30, 30, 30, 0.97);

  /* Section Glass Colors - Dark Mode (brighter, more saturated) */
  --section-red-glass: rgba(140, 50, 50, 0.75);
  --section-red-glass-end: rgba(95, 30, 30, 0.75);
  --section-orange-glass: rgba(140, 85, 40, 0.75);
  --section-orange-glass-end: rgba(95, 55, 25, 0.75);
  --section-yellow-glass: rgba(125, 120, 50, 0.75);
  --section-yellow-glass-end: rgba(90, 85, 30, 0.75);
  --section-green-glass: rgba(45, 130, 55, 0.75);
  --section-green-glass-end: rgba(30, 90, 40, 0.75);
  --section-teal-glass: rgba(40, 110, 100, 0.75);
  --section-teal-glass-end: rgba(25, 80, 72, 0.75);
  --section-blue-glass: rgba(45, 100, 140, 0.75);
  --section-blue-glass-end: rgba(30, 70, 105, 0.75);
  --section-gray-glass: rgba(85, 85, 85, 0.75);
  --section-gray-glass-end: rgba(60, 60, 60, 0.75);

  --glass-gloss: rgba(255, 255, 255, 0.12);
  --glass-gloss-end: rgba(255, 255, 255, 0.02);
}

/* ========================================
   Font Size Overrides
   ======================================== */
.font-size-medium {
  --font-size-base: 1.125rem;   /* 18px */
  --font-size-sm: 1rem;         /* 16px */
  --font-size-lg: 1.25rem;      /* 20px */
  --font-size-xl: 1.375rem;     /* 22px */
  --font-size-2xl: 1.625rem;    /* 26px */
}

.font-size-large {
  --font-size-base: 1.25rem;    /* 20px */
  --font-size-sm: 1.125rem;     /* 18px */
  --font-size-lg: 1.375rem;     /* 22px */
  --font-size-xl: 1.5rem;       /* 24px */
  --font-size-2xl: 1.75rem;     /* 28px */
}
