/* ==========================================================================
   MorDee Design Tokens — single source of truth (see DESIGN_SYSTEM_*.md §9.4)
   Raw colors / sizes live ONLY in this file.
   ========================================================================== */
:root {
  /* Teal (primary) */
  --color-teal-950: #0D3B3B; /* deep — headings, dark bands, footer */
  --color-teal-900: #1A5C5C;
  --color-teal-700: #1F6F6F;
  --color-teal-600: #2B8A8A; /* Vivid Cyan — brand */
  --color-teal-400: #45C5C3;
  --color-teal-300: #6DD2D2; /* bright accent — buttons, highlight */
  --color-teal-200: #9AE1E2;
  --color-teal-100: #CDF0F3;
  --color-teal-50:  #EEF9F9;

  /* Coral (accent / warm spark) */
  --color-coral-800: #B23A28;
  --color-coral-700: #C8452F;
  --color-coral-500: #FB735C; /* MorDee Coral — brand */
  --color-coral-300: #F79685;
  --color-coral-200: #FAB8AC;
  --color-coral-100: #FDDED6;
  --color-coral-50:  #FFF3F0;

  /* Neutral */
  --color-ink:        #1F2A2E;
  --color-text:       #565E62;
  --color-gray-700:   #605E5C;
  --color-text-muted: #6B7378;
  --color-gray-500:   #959193;
  --color-gray-300:   #D6D4D5;
  --color-gray-200:   #E5E2E3;
  --color-cream:      #FCFAF7;
  --color-surface:    #F9FAFE;
  --color-white:      #FFFFFF;
  --color-divider-on-dark: rgba(255, 255, 255, 0.12);

  /* Semantic */
  --color-success: #1E7A4D;  --color-success-bg: #E6F5EC;
  --color-warning: #8A5300;  --color-warning-bg: #FFF4D6;
  --color-error:   #B42318;  --color-error-bg:   #FDECEA;
  --color-info:    #1F6F6F;  --color-info-bg:    #EEF9F9;

  /* Gradients & glass */
  --gradient-mesh:
    radial-gradient(60% 80% at 8% 30%, rgba(69, 197, 195, 0.55) 0%, rgba(69, 197, 195, 0) 60%),
    radial-gradient(50% 70% at 45% 65%, rgba(154, 225, 226, 0.60) 0%, rgba(154, 225, 226, 0) 65%),
    radial-gradient(60% 80% at 92% 20%, rgba(253, 222, 214, 0.80) 0%, rgba(253, 222, 214, 0) 60%),
    #FCFAF7;
  --gradient-overlay: linear-gradient(180deg, rgba(13, 59, 59, 0.10) 0%, rgba(13, 59, 59, 0.92) 70%);
  --gradient-deep:  linear-gradient(180deg, #0D3B3B 0%, #1A5C5C 100%);
  --gradient-brand: linear-gradient(0deg, #6FC3C4 0%, #6BE2A8 100%); /* old-site card gradient */
  --glass-bg:        rgba(255, 255, 255, 0.48);
  --glass-bg-solid:  rgba(255, 255, 255, 0.88);
  --glass-border:    rgba(255, 255, 255, 0.40);
  --blur-glass:      16px;

  /* Fonts */
  --font-primary:   "Mitr", "Noto Sans Thai", "Sukhumvit Set", "Leelawadee UI", system-ui, sans-serif;
  --font-secondary: "Kanit", "Noto Sans Thai", "Sukhumvit Set", "Leelawadee UI", system-ui, sans-serif;
  --fw-light: 300; --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600;
  /* Semantic weights (lighter set, approved 4 Nov 2026) */
  --fw-heading: var(--fw-regular);   /* Mitr 400 — all headings */
  --fw-ui: var(--fw-regular);        /* Mitr 400 — nav, buttons, labels, chips */
  --fw-body: var(--fw-light);        /* Kanit 300 — paragraphs */
  --fw-emphasis: var(--fw-medium);   /* 500 — rare emphasis only */

  /* Font sizes — EVEN WHOLE PX ONLY */
  --fs-12: 12px; --fs-14: 14px; --fs-16: 16px; --fs-18: 18px; --fs-20: 20px;
  --fs-24: 24px; --fs-28: 28px; --fs-32: 32px; --fs-36: 36px; --fs-40: 40px;
  --fs-48: 48px; --fs-56: 56px; --fs-64: 64px;

  /* Line heights paired with primitive sizes (even px) */
  --lh-12: 20px; --lh-14: 24px; --lh-16: 24px; --lh-18: 28px; --lh-20: 28px; --lh-24: 32px;

  /* Semantic type — MOBILE values (base) */
  --fs-display: var(--fs-32); --lh-display: 44px;
  --fs-h1: var(--fs-36);      --lh-h1: 48px;
  --fs-h2: var(--fs-28);      --lh-h2: 40px;
  --fs-h3: var(--fs-24);      --lh-h3: 32px;
  --fs-h4: var(--fs-20);      --lh-h4: 28px;
  --fs-h5: var(--fs-18);      --lh-h5: 28px;
  --fs-h6: var(--fs-16);      --lh-h6: 24px;
  --fs-lead: var(--fs-18);    --lh-lead: 30px;
  --fs-body: var(--fs-16);    --lh-body: 28px;
  --fs-small: var(--fs-14);   --lh-small: 24px;
  --fs-caption: var(--fs-12); --lh-caption: 20px;
  --fs-label: var(--fs-14);   --lh-label: 20px;
  --fs-button: var(--fs-16);  --lh-button: 24px;
  --fs-nav: var(--fs-20);     --lh-nav: 32px;
  --fs-stat: var(--fs-36);    --lh-stat: 44px;
  --fs-marquee: var(--fs-16); --lh-marquee: 24px;
  --ls-heading-en: 0;

  /* Spacing */
  --space-4: 4px;   --space-8: 8px;   --space-12: 12px; --space-16: 16px;
  --space-20: 20px; --space-24: 24px; --space-32: 32px; --space-40: 40px;
  --space-48: 48px; --space-56: 56px; --space-64: 64px; --space-72: 72px;
  --space-96: 96px; --space-160: 160px;
  --section-padding: var(--space-56);
  --container-padding: var(--space-20);
  --container-max: 1296px;
  --grid-gutter: var(--space-16);

  /* Radius & shadow */
  --radius-2: 2px; --radius-8: 8px; --radius-12: 12px; --radius-16: 16px; --radius-24: 24px;
  --radius-32: 32px; --radius-pill: 999px;
  --shadow-sm: 0 2px 8px rgba(13, 59, 59, 0.06);
  --shadow-md: 0 12px 32px rgba(13, 59, 59, 0.10);
  --shadow-lg: 0 24px 48px rgba(13, 59, 59, 0.16);
  --shadow-step: 0 4px 0 #0D3B3B;

  /* Components */
  --btn-height: 56px; --btn-height-sm: 44px;
  --btn-icon: 32px;   --btn-icon-sm: 28px;
  --input-height: 56px;
  --nav-pill-height: 48px;
  --nav-link-height: 32px;

  /* Motion */
  --motion-fast: 150ms; --motion-base: 200ms; --motion-slow: 300ms;
  --motion-header: 450ms; /* header: top ↔ scrolled glass bar */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-out-soft: cubic-bezier(0.16, 1, 0.3, 1); /* entrance, Framer-like */
  --ease-out-gentle: cubic-bezier(0.33, 1, 0.68, 1); /* hero phones/cards: slower, even glide */
  --ease-in-out-strong: cubic-bezier(0.7, 0, 0.2, 1); /* intro logo flight */
  --ease-in-out-soft: cubic-bezier(0.65, 0, 0.35, 1); /* intro reveal */
  --marquee-duration: 40s;

  /* Layers */
  --z-navbar: 100; --z-dropdown: 200; --z-sticky-cta: 300; --z-overlay: 900; --z-modal: 1000;
  --z-intro: 1100;

  /* ------------------------------------------------------------------
     Prototype extras (layout sizes, placeholders, decoration)
     ------------------------------------------------------------------ */
  --icon-16: 16px; --icon-20: 20px; --icon-24: 24px; --icon-32: 32px; --icon-40: 40px; --icon-48: 48px;
  --logo-height: 44px;
  --logo-height-compact: 44px;
  --logo-height-footer: 56px; /* 72 px from tablet up */
  --header-offset: 96px;
  --hero-padding-top: 120px;
  --measure-wide: 960px;
  --measure: 720px;
  --measure-narrow: 640px;
  --qr-size: 120px;
  --qr-size-lg: 160px;
  --card-promo-width: 84%;
  --doctor-card-width: 240px;
  --dropdown-width: 320px;
  --mega-width: 840px;
  --mega-feature-width: 248px;
  --lang-menu-width: max-content; /* hugs the longest row: 12 + flag 20 + 8 + label + 12 */
  --flag-size: 28px;
  --form-max: 520px;

  --placeholder-light: linear-gradient(160deg, #EEF9F9 0%, #CDF0F3 45%, #9AE1E2 100%);
  --placeholder-warm:  linear-gradient(160deg, #FFF3F0 0%, #FDDED6 50%, #CDF0F3 100%);
  --placeholder-dark:  linear-gradient(135deg, #1F6F6F 0%, #1A5C5C 50%, #0D3B3B 100%);
  --color-placeholder-icon: rgba(13, 59, 59, 0.32);
  --color-placeholder-icon-dark: rgba(255, 255, 255, 0.32);
  --color-scrim: rgba(13, 59, 59, 0.40);

  /* Hero phones (Marqo layout) — mobile values; tablet/desktop below */
  --device-w-center: 168px;
  --device-w-side: 140px;
  --device-gap: var(--space-12);
  --device-offset: var(--space-24);
  --devices-visible: 320px;
  --hero-fade-height: 160px;
  --gradient-fade-white: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #FFFFFF 100%);
  --filter-device-shadow: drop-shadow(0 24px 40px rgba(13, 59, 59, 0.18));

  /* Hero background — Marqo profile in the real CI palette (old mordeeapp.com):
     CI Green #23C0B6 at the top (behind the white text) → CI Teal #6FC3C4 →
     CI Mint #6BE2A8 → light mint behind the phones → white fade.
     White text on #23C0B6 = 2.26 : 1 — client-approved exception (4 Nov 2026);
     legibility helped by --text-shadow-hero. */
  --gradient-hero-ci:
    radial-gradient(44% 40% at 0% 0%, rgba(35, 192, 182, 0.60) 0%, rgba(35, 192, 182, 0) 100%),
    radial-gradient(36% 30% at 100% 40%, rgba(240, 94, 117, 0.14) 0%, rgba(240, 94, 117, 0) 100%),
    radial-gradient(40% 44% at 0% 78%, rgba(220, 247, 236, 0.60) 0%, rgba(220, 247, 236, 0) 100%),
    radial-gradient(40% 44% at 100% 78%, rgba(220, 247, 236, 0.60) 0%, rgba(220, 247, 236, 0) 100%),
    linear-gradient(0deg,
      #DCF7EC 0,
      #DCF7EC calc(var(--devices-visible) * 0.32),
      #A9EFCB calc(var(--devices-visible) * 0.45),
      #6BE2A8 calc(var(--devices-visible) * 0.62),
      #6FC3C4 calc(var(--devices-visible) * 0.84),
      #26C1B5 var(--devices-visible),
      #23C0B6 calc(var(--devices-visible) + 184px));
  --text-shadow-hero: 0 1px 2px rgba(13, 59, 59, 0.24), 0 2px 16px rgba(13, 59, 59, 0.16);
  --glass-teal-bg: rgba(13, 59, 59, 0.75);     /* frosted Teal 950 (HR stat card); white text ≥ 4.5 : 1 on the mint band */
  --glass-teal-border: rgba(255, 255, 255, 0.12);
  --glass-dark-bg: rgba(255, 255, 255, 0.10);
  --glass-dark-bg-hover: rgba(255, 255, 255, 0.16);
  /* Scroll line (Clearpath-style) + word reveal */
  --arch-height: 40px;
  /* Corporate panel (Clearpath quote section): same light gradient as the FAQ help card (client request 5 Nov 2026) */
  --gradient-corporate: linear-gradient(135deg, #CDF0F3 0%, #C9F2DE 100%); /* Teal 100 → CI Mint tint */
  --word-dim-opacity: 0.18;

  /* Promotions coverflow: centre banner width, side step, blur */
  --cf-width: 84vw;
  --cf-step: 0.86;          /* side banner centre = width × step from the middle */
  --cf-side-scale: 0.84;
  --cf-blur: 4px;
  --cf-side-opacity: 0.6;
  --cf-duration: 640ms;

  /* Dark-glass widgets (hero float cards, call mock-up) — moved out of home.css */
  --glass-dark-bg-soft:   rgba(255, 255, 255, 0.08);
  --glass-dark-ring-soft: rgba(255, 255, 255, 0.10);
  --glass-dark-ring:      rgba(255, 255, 255, 0.22);
  --color-on-dark-muted:  rgba(255, 255, 255, 0.78); /* secondary text on dark glass */
  --color-on-dark-track:  rgba(255, 255, 255, 0.28); /* unfilled progress track */
  --color-ring-dark:      rgba(13, 59, 59, 0.9);     /* Teal 950 ring around dots / logos */
  --color-ci-mint-tint:   rgba(107, 226, 168, 0.18); /* CI Mint icon chip on dark */
  --shadow-chip:   0 4px 14px rgba(13, 59, 59, 0.12);
  --shadow-avatar: 0 6px 16px rgba(13, 59, 59, 0.20);
  --gradient-sheen: radial-gradient(80% 60% at 30% 15%, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 70%);
  --glass-dark-border: rgba(255, 255, 255, 0.20);

  /* Intro (Medlume-style opening) */
  --intro-logo-size: 240px;
  --mask-reveal-up: linear-gradient(0deg, #000 0%, #000 45%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0) 100%);
  --gradient-intro:
    radial-gradient(circle at 50% 50%, rgba(107, 226, 168, 0.50) 0%, rgba(107, 226, 168, 0) 45%),
    #23C0B6;

  /* Hero floating cards — Marqo dashboard-widget glass (ref. card: #095143 @ 60 %, blur 8, white 12 % ring) */
  --float-card-width: 208px;
  --float-card-bg: rgba(13, 59, 59, 0.55);
  --float-card-border: rgba(255, 255, 255, 0.14);
  --float-card-blur: 8px;

  /* Specialist consultation block — layout 1:1 with Wellbase "Live doctor consultation" (1440 / 390 px) */
  --consult-card-w: 640px; /* video card, ratio 562 : 440 */
  --consult-card-ratio: 562 / 440;
  --consult-card-ratio-mobile: 350 / 440;
  --gradient-consult-accent: linear-gradient(90deg, #1F6F6F 0%, #189C93 100%); /* "20 สาขา": Teal 700 → deep CI green, ≥ 3 : 1 */
  --gradient-faq-help: linear-gradient(135deg, #CDF0F3 0%, #C9F2DE 100%); /* Teal 100 → CI Mint tint, FAQ help card */
  --color-call-end: #F43F3F;                  /* end-call red */
  --color-call-live: #22C55E;                 /* live dot */
  --call-btn-bg: rgba(52, 64, 72, 0.45);      /* glass control buttons over the video */

  /* CI palette — taken from the old site (mordeeapp.com) */
  --color-ci-teal:  #6FC3C4;
  --color-ci-green: #23C0B6;
  --color-ci-mint:  #6BE2A8;
  --color-ci-pink:  #F05E75;
  --color-ci-coral: #FB735C;
  --color-ci-gray:  #A6ADC7;
  --gradient-feature-photo: linear-gradient(180deg, rgba(13, 59, 59, 0) 20%, rgba(13, 59, 59, 0.55) 52%, rgba(13, 59, 59, 0.92) 78%); /* menu photo card: clear top → Teal 950 under the text */
  /* Reviews (Wellbase testimonials layout): neutral light gray band + hairline frame */
  --color-review-bg: #FFFFFF;
  --color-review-line: #D5DBE2;
  --gradient-review-teal:  linear-gradient(150deg, #6FC3C4 0%, #23C0B6 100%);  /* CI Teal → CI Green */
  --gradient-review-coral: linear-gradient(150deg, #FB735C 0%, #F05E75 100%);  /* CI Coral → CI Pink */
  --gradient-review-mint:  linear-gradient(150deg, #6BE2A8 0%, #23C0B6 100%);  /* CI Mint → CI Green */
  /* How-it-works scroll story: pinned height (100vh stage + scroll distance) and the glow behind the phones */
  /* Articles section backdrop: the footer's stepped bars + glow, recoloured CI Green for a white section */
  --blog-bg-bars: url("/assets/img/blog/blog-bars.svg?v=8");
  --journey-pin-height: 280vh;
  /* Moving background blobs behind the big phone (CI Mint · CI Teal · Coral 100) */
  --journey-blob-mint:  radial-gradient(closest-side, rgba(107, 226, 168, 0.55) 0%, rgba(107, 226, 168, 0) 100%);
  --journey-blob-teal:  radial-gradient(closest-side, rgba(111, 195, 196, 0.50) 0%, rgba(111, 195, 196, 0) 100%);
  --journey-blob-coral: radial-gradient(closest-side, rgba(253, 222, 214, 0.85) 0%, rgba(253, 222, 214, 0) 100%);
  --glow-journey: radial-gradient(closest-side, rgba(107, 226, 168, 0.35) 0%, rgba(35, 192, 182, 0.12) 55%, rgba(35, 192, 182, 0) 100%);
  --gradient-review-back: linear-gradient(135deg, #FFF3F0 0%, #FDE3E8 100%); /* flipped review card: light pink (Coral 50 → light CI Pink tint) */
  --review-card-h: 420px;
  --gradient-icon-tile: linear-gradient(145deg, #FFFFFF 0%, #EEF9F9 100%); /* menu icon tile: white → Teal 50 */
  --color-icon-ci:  #36A3A2; /* CI icon line teal (CI sheet §05), 3.04 : 1 on white (graphics ≥ 3 : 1) */

  /* Primary button — old-site pink gradient, white label (client decision, 4 Nov 2026).
     White on #F05E75 = 3.20 : 1 → meets 3 : 1 (UI / large text) only. */
  --gradient-primary: linear-gradient(315deg, #F05E75 0%, #FB735C 100%);
  --gradient-primary-hover: linear-gradient(315deg, #E14D66 0%, #F0624B 100%);
  --primary-icon-bg: rgba(255, 255, 255, 0.22);

  /* Green button — old-site main button gradient, white label */
  --gradient-b2b: linear-gradient(315deg, #23C0B6 0%, #26C1B5 50%, #6BE2A8 100%);
  --gradient-b2b-hover: linear-gradient(315deg, #1FB2A9 0%, #23C0B6 50%, #5FD99D 100%);

  /* Ghost button on the hero: no fill, white ring + white label */
  --ghost-hover-bg: rgba(255, 255, 255, 0.16);

  /* Footer — layout measured 1:1 from the ReliaCare footer (1440 / 810 / 390 px).
     Colors: bright CI band (same family as --gradient-hero-ci): CI Green → CI Teal → CI Mint.
     Footer text is white (client decision, 4 Nov 2026), like the hero: 2.26 / 2.04 / 1.61 : 1 on
     these colors, below WCAG AA (no text shadow — client decision). Teal 950 would pass
     (5.44 / 6.03 / 7.66 : 1) if this is ever revisited. White = also the accent (squares, dividers). */
  /* Ends in CI Green (not Mint) so the white bottom row stays readable; Mint is a soft highlight */
  --gradient-footer-ci:
    radial-gradient(50% 60% at 0% 0%, rgba(35, 192, 182, 0.70) 0%, rgba(35, 192, 182, 0) 100%),
    radial-gradient(40% 50% at 100% 30%, rgba(240, 94, 117, 0.10) 0%, rgba(240, 94, 117, 0) 100%),
    radial-gradient(45% 45% at 80% 55%, rgba(107, 226, 168, 0.45) 0%, rgba(107, 226, 168, 0) 100%),
    linear-gradient(180deg, #23C0B6 0%, #6FC3C4 50%, #3FC4B5 80%, #23C0B6 100%);
  --color-footer-ink: var(--color-white);      /* all footer text and icons */
  --color-footer-accent: var(--color-white);   /* heading square */
  --color-footer-rule: rgba(255, 255, 255, 0.50);
  --gradient-footer-divider-v: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.85) 50%, rgba(255, 255, 255, 0) 100%);
  --gradient-footer-divider-h: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.85) 50%, rgba(255, 255, 255, 0) 100%);
  --footer-px: 16px;            /* 36 px tablet, 72 px desktop */
  --footer-brand-width: 475px;
  --footer-main-pt: 80px;
  --footer-main-pb: 60px;
  --footer-bottom-py: 30px;
  --sticky-cta-height: 64px;    /* floating pill 48 + 16 from the bottom */
  --footer-gap-tablet: 32px;
  --footer-col-max-tablet: 192px;
  --footer-glow-px: 72px;
  --footer-glow-bottom: -80px;  /* -250 px tablet, -400 px desktop */
  --footer-glow-ratio: 1296 / 799;
  --color-logo-teal: #6EC3C4; /* sampled from the MORDEE logotype */
}

/* Tablet */
@media (min-width: 768px) {
  :root {
    --cf-width: 72vw;
    --arch-height: 64px;
    --fs-display: var(--fs-40); --lh-display: 52px;
    --fs-h1: var(--fs-48);      --lh-h1: 64px;
    --fs-h2: var(--fs-40);      --lh-h2: 52px;
    --fs-h3: var(--fs-28);      --lh-h3: 40px;
    --fs-h4: var(--fs-24);      --lh-h4: 32px;
    --fs-h5: var(--fs-20);      --lh-h5: 28px;
    --fs-h6: var(--fs-18);      --lh-h6: 28px;
    --fs-lead: var(--fs-20);    --lh-lead: 32px;
    --fs-body: var(--fs-18);    --lh-body: 32px;
    --fs-nav: var(--fs-14);     --lh-nav: 20px;
    --fs-stat: var(--fs-40);    --lh-stat: 48px;
    --fs-marquee: var(--fs-18); --lh-marquee: 28px;
    --section-padding: var(--space-72);
    --container-padding: var(--space-40);
    --grid-gutter: var(--space-24);
    --card-promo-width: 44%;
    --hero-padding-top: 144px;
    --intro-logo-size: 320px;
    --device-w-center: 228px;
    --device-w-side: 188px;
    --device-gap: var(--space-24);
    --device-offset: var(--space-24);
    --devices-visible: 440px;
    --hero-fade-height: 200px;
    --footer-px: 36px;
    --logo-height-footer: 72px;
    --footer-glow-bottom: -250px;
  }
}

/* Desktop */
@media (min-width: 1200px) {
  :root {
    --cf-width: min(62vw, 920px);
    --cf-step: 0.8;
    --arch-height: 96px;
    --fs-display: 50px;         --lh-display: 66px; /* hero headline 50 px (client request, exception to even-size scale) */
    --fs-h1: var(--fs-56);      --lh-h1: 72px;
    --fs-h2: var(--fs-48);      --lh-h2: 64px;
    --fs-h3: var(--fs-32);      --lh-h3: 44px;
    --fs-h4: var(--fs-24);      --lh-h4: 36px;
    --fs-h5: var(--fs-20);      --lh-h5: 32px;
    --fs-stat: var(--fs-48);    --lh-stat: 56px;
    --fs-marquee: var(--fs-20); --lh-marquee: 28px;
    --ls-heading-en: -1px;
    --section-padding: var(--space-96);
    --container-padding: var(--space-72);
    --card-promo-width: 30%;
    --hero-padding-top: var(--space-160);
    --intro-logo-size: 400px;
    --device-w-center: 284px;
    --device-w-side: 232px;
    --device-gap: var(--space-32);
    --device-offset: var(--space-32);
    --devices-visible: 560px;
    --hero-fade-height: 240px;
    --footer-px: 72px;
    --footer-glow-bottom: -400px;
  }
}
