/* ============================================================
 * HS1 Brand Design Tokens
 * Henry Schein One Digital Playbook 2025-Q3
 *
 * Two layers:
 *   1. --hs1-*   Brand primitives  (palette reference values)
 *   2. --app-*   Semantic tokens   (what components consume)
 *
 * All Power.Dent air CSS files consume --app-* tokens.
 * To retheme, change the --app-* assignments; primitive values
 * should remain stable as the palette source of truth.
 * ============================================================ */

:root {

    /* ----------------------------------------------------------
     * Brand Primitives
     * ---------------------------------------------------------- */

    /* Jordy — Primary Blue */
    --hs1-jordy-600: #002A5C;
    --hs1-jordy-500: #004A99;
    --hs1-jordy-400: #0071E3;
    --hs1-jordy-300: #6299FF;
    --hs1-jordy-200: #B0C8FF;
    --hs1-jordy-100: #E1E9FF;

    /* Celeste — Teal / Secondary */
    --hs1-celeste-600: #0C3432;
    --hs1-celeste-500: #185A57;
    --hs1-celeste-400: #24918C;
    --hs1-celeste-300: #31BABF;
    --hs1-celeste-200: #9CF6FE;
    --hs1-celeste-100: #E0FCFF;

    /* Pixie — Purple */
    --hs1-pixie-600: #480094;
    --hs1-pixie-500: #7200E3;
    --hs1-pixie-400: #904FFF;
    --hs1-pixie-300: #AC89FF;
    --hs1-pixie-200: #CCB4FF;
    --hs1-pixie-100: #EEE9FF;

    /* Cardinal — Red / Pink */
    --hs1-cardinal-600: #9B2138;
    --hs1-cardinal-500: #BF2741;
    --hs1-cardinal-400: #F14D5E;
    --hs1-cardinal-300: #F9929B;
    --hs1-cardinal-200: #F9CACC;
    --hs1-cardinal-100: #FDEEEE;

    /* Neutrals */
    --hs1-true-black:   #181818;
    --hs1-bright-white: #FFFFFF;

    /* Aluminum */
    --hs1-aluminum-400: #646469;
    --hs1-aluminum-300: #AEAEB3;
    --hs1-aluminum-200: #D5D5D8;
    --hs1-aluminum-100: #F1F1F1;

    /* Enamel — Warm Neutrals */
    --hs1-enamel-400: #B49B7E;
    --hs1-enamel-300: #E1D5C6;
    --hs1-enamel-200: #F0E9E2;
    --hs1-enamel-100: #F5F1EE;

    /* ----------------------------------------------------------
     * Semantic App Tokens
     * Map brand primitives to UI roles in Power.Dent air.
     * ---------------------------------------------------------- */

    /* Brand identity */
    --app-color-brand-logo:             var(--hs1-jordy-600);    /* #002A5C — logo mark */
    --app-color-brand-icon:             var(--hs1-celeste-300);  /* #31BABF — icon accent */

    /* Primary accent scale
     * Replaces legacy blues: #3598dc / #60b2ea / #019ef7 */
    --app-color-accent:                 var(--hs1-jordy-400);    /* #0071E3 — interactive, links, borders */
    --app-color-accent-strong:          var(--hs1-jordy-500);    /* #004A99 — dark text, strong headings */
    --app-color-accent-deep:            var(--hs1-jordy-600);    /* #002A5C — deepest chrome text */
    --app-color-accent-light:           var(--hs1-jordy-300);    /* #6299FF — lighter interactive fill */
    --app-color-accent-surface:         var(--hs1-jordy-100);    /* #E1E9FF — panel / section bg tint */
    --app-color-accent-surface-hover:   var(--hs1-jordy-200);    /* #B0C8FF — panel bg on hover */
    --app-color-accent-border:          var(--hs1-jordy-200);    /* #B0C8FF — subtle border */

    /* Alpha variants (pre-computed rgba for use where hex-alpha was previously inlined) */
    --app-color-accent-alpha54:         rgba(0, 113, 227, 0.54); /* Jordy-400 @ 54 % opacity */
    --app-color-accent-alpha44:         rgba(0, 113, 227, 0.44); /* Jordy-400 @ 44 % opacity */
    --app-color-accent-rgb:             0, 113, 227;             /* Jordy-400 r,g,b triplet for rgba(var(--app-color-accent-rgb), alpha) */

    /* Sidebar / navigation chrome */
    --app-color-sidebar-bg:             #454545;                 /* neutral dark chrome — unchanged */
    --app-color-sidebar-hover:          var(--hs1-jordy-400);    /* #0071E3 — hover item bg */
    --app-color-sidebar-active:         var(--hs1-jordy-500);    /* #004A99 — active item bg */
    --app-color-sidebar-submenu:        var(--hs1-jordy-400);    /* #0071E3 — submenu default bg */
    --app-color-sidebar-submenu-active: var(--hs1-jordy-600);    /* #002A5C — active submenu bg */
    --app-color-sidebar-border:         var(--hs1-jordy-500);    /* #004A99 — separator */
    --app-color-sidebar-accent:         var(--hs1-jordy-400);    /* #0071E3 — collapsed rail (#sideBarMain) bg */
    /* Collapsed-sidebar-specific states (icon-rail mode, .page-sidebar-closed.page-sidebar-fixed).
     * These selectors have higher CSS specificity than the ones custom.css overrides, so they
     * were never affected by the custom.css #018EDF override in the original app. */
    --app-color-sidebar-hover-collapsed:             var(--hs1-jordy-400);   /* #0071E3 — collapsed rail item hover */
    --app-color-sidebar-submenu-collapsed-active:    var(--hs1-jordy-400);   /* #0071E3 — popup sub-menu open/active item */

    /* Secondary / teal moments
     * Celeste family for profile bars, teal badges, secondary accents */
    --app-color-secondary:              var(--hs1-celeste-400);  /* #24918C — secondary accent */
    --app-color-secondary-surface:      var(--hs1-celeste-200);  /* #9CF6FE — light teal surface */
    --app-color-secondary-border:       var(--hs1-celeste-300);  /* #31BABF — teal border */
    --app-color-secondary-text:         var(--hs1-celeste-400);  /* #24918C — teal text */

    /* Page / body */
    --app-color-body-bg:                #f6f9fb;                 /* page background */

    /* Text scale */
    --app-color-text:                   #555555;                 /* primary body text */
    --app-color-text-muted:             var(--hs1-aluminum-400); /* #646469 — secondary labels */

    /* Heading text — True Black per HS1 playbook H1–H5 spec */
    --app-color-heading:                var(--hs1-true-black);   /* #181818 — page-level headings */

    /* Supporting / caption / placeholder text — Aluminum-300 per playbook Caption/Legal spec */
    --app-color-supporting-text:        var(--hs1-aluminum-300); /* #AEAEB3 — muted captions, placeholders */

    /* Focus ring — Pixie-400 per playbook Text Field Active state (distinct from Jordy interactive) */
    --app-color-focus:                  var(--hs1-pixie-400);    /* #904FFF — keyboard focus outline */

    /* Error states — Cardinal family per playbook Text Field Error state */
    --app-color-error:                  var(--hs1-cardinal-500); /* #BF2741 — error text / icon */
    --app-color-error-border:           var(--hs1-cardinal-400); /* #F14D5E — error input border */
    --app-color-error-surface:          var(--hs1-cardinal-100); /* #FDEEEE — error background tint */

    /* Success surface — Celeste-100 per playbook (Celeste-400 already mapped as --app-color-success via --app-color-secondary) */
    --app-color-success-surface:        var(--hs1-celeste-100);  /* #E0FCFF — success background tint */
}

/* ============================================================
 * Legacy Blue Theme
 * Restores the pre-HS1-migration Metronic blue colour scheme.
 * Applied when html[data-theme="legacy"] (default in production
 * and the initial default in development).
 * Values verified from git commit f1aa7e12a.
 * ============================================================ */
:root[data-theme="legacy"] {

    /* ----------------------------------------------------------
     * Primary accent scale
     * Source: Metronic blue theme + custom CSS overrides.
     * Multiple legacy blues (#019ef7 / #60b2ea / #337ab7 / #2795e0)
     * were all collapsed into a single --app-color-accent; the
     * canonical Metronic primary blue #3598dc is used here.
     * ---------------------------------------------------------- */
    --app-color-accent:                 #3598dc;
    --app-color-accent-strong:          #0068af;  /* section/panel heading text, #305772, #3475a2 */
    --app-color-accent-deep:            #235a89;  /* deepest chrome, sidebar active */
    --app-color-accent-light:           #60b2ea;  /* lighter interactive fill */
    --app-color-accent-surface:         #eaf6ff;  /* panel / section bg tint */
    --app-color-accent-surface-hover:   #bbdef9;  /* panel bg on hover */
    --app-color-accent-border:          #d0e6f7;  /* subtle border (#84c5f1 on hover tab) */
    --app-color-accent-alpha54:         rgba(96, 178, 234, 0.54); /* #60b2ea8a — accordion hover/body */
    --app-color-accent-alpha44:         rgba(96, 178, 234, 0.44); /* approx #60b2ea70 */
    --app-color-accent-rgb:             53, 152, 220;             /* Legacy #3598dc r,g,b triplet for rgba(var(--app-color-accent-rgb), alpha) */

    /* ----------------------------------------------------------
     * Sidebar / navigation chrome
     * ---------------------------------------------------------- */
    --app-color-sidebar-hover:          #018EDF;  /* hover item bg — effective value from custom.css cascade (overrides core-OD.css #5a94c7) */
    --app-color-sidebar-active:         #235a89;  /* active item bg */
    --app-color-sidebar-submenu:        #019ef7;  /* submenu default bg */
    --app-color-sidebar-submenu-active: #0a4272;  /* active submenu bg */
    --app-color-sidebar-border:         #235a89;  /* separator */
    --app-color-sidebar-accent:         #019ef7;  /* collapsed rail (#sideBarMain) bg — vivid Metronic blue, distinct from --app-color-accent #3598dc */
    /* Collapsed-sidebar-specific states — these selectors have higher specificity than the
     * custom.css rules, so they were NEVER affected by the #018EDF override in the original app.
     * Values come directly from master-at:core-OD.css. */
    --app-color-sidebar-hover-collapsed:             #5a94c7;  /* icon-rail hover: core-OD.css value, not overridden by custom.css */
    --app-color-sidebar-submenu-collapsed-active:    #397ab2;  /* popup sub-menu open/active item (original #397ab2, not collapsed into #235a89) */

    /* ----------------------------------------------------------
     * Brand icon / secondary teal
     * ---------------------------------------------------------- */
    --app-color-brand-icon:             #36c6d3;  /* teal icon accent (#27a4b0 variant) */
    --app-color-secondary:              #489fc8;  /* secondary accent */
    --app-color-secondary-surface:      #b2e4fc;  /* light teal surface */
    --app-color-secondary-border:       #70c3e9;  /* teal border (#5dbfdc for datepicker) */
    --app-color-secondary-text:         #489fc8;  /* teal text */

    /* ----------------------------------------------------------
     * Heading text
     * Legacy panels/sections used blue for all heading text.
     * ---------------------------------------------------------- */
    --app-color-heading:                #0068af;

    /* ----------------------------------------------------------
     * Focus ring
     * Legacy had no separate focus colour — primary blue was used.
     * ---------------------------------------------------------- */
    --app-color-focus:                  #3598dc;

    /* ----------------------------------------------------------
     * Error states — Bootstrap 3 defaults (pre-HS1)
     * ---------------------------------------------------------- */
    --app-color-error:                  #a94442;
    --app-color-error-border:           #843534;
    --app-color-error-surface:          #f2dede;

    /* ----------------------------------------------------------
     * Success surface — Bootstrap 3 default (pre-HS1)
     * ---------------------------------------------------------- */
    --app-color-success-surface:        #dff0d8;

    /* ----------------------------------------------------------
     * Tokens intentionally omitted — identical in both themes:
     *   --app-color-brand-logo      (#002A5C)
     *   --app-color-sidebar-bg      (#454545)
     *   --app-color-body-bg         (#f6f9fb)
     *   --app-color-text            (#555555)
     *   --app-color-text-muted      (#646469)
     *   --app-color-supporting-text (#AEAEB3)
     * ---------------------------------------------------------- */
}
