/* ===========================================================================
   eCommerce Health Check — Design System (the agency brand, scandiweb)
   ---------------------------------------------------------------------------
   Static Blade surfaces (landing / 2FA / styleguide) read these tokens. The same values are
   PHP constants in App\Domains\Shared\Support\BrandTokens for the server-rendered surfaces
   (client PDF, mail theme, Filament accent) — BrandTokensTest fails when the two drift.

   Brand rules encoded here (see the scandiweb brand skill):
     · 7 colours only: Dark / Light / Dark Gray / Light Gray + Blue (primary) / Green / Orange
     · Golos Text for headings, Inter for body — self-hosted from /fonts/brand
     · rectangles have 2px corners, badges are pills; NO shadows, NO gradients, NO card borders
     · text colour follows the IMMEDIATE background; green highlights only on dark surfaces
   Severity / RAG colours are SEMANTIC and deliberately outside the brand palette.

   Two scopes: the default is the LIGHT content look (white page, dark text). Add `.hc-dark` to
   a wrapper for the dark hero/title look (dark page, white text, green highlight) — the landing,
   the 2FA challenge. Cards inside it are DARK surfaces too (user ruling 2026-08-27: no white card
   on the dark pages, matching the dark login card). Components colour themselves ONLY through
   tokens (never `.hc-dark .x { color }`), so a scope switch is always one token block.
   No build step — edit + refresh; /styleguide previews every component.
   =========================================================================== */

@import url("../fonts/brand/brand-fonts.css");

:root {
    /* ---- Brand palette (mirrored by BrandTokens::cssTokens) ---- */
    --hc-dark:       #10132C;
    --hc-light:      #FFFFFF;
    --hc-dark-gray:  #7E83A0;
    --hc-light-gray: #DADCF1;
    --hc-blue:       #3F4AAF;
    --hc-green:      #6EF76E;
    --hc-orange:     #FF5A31;

    /* ---- Light scope (default): white page, dark text ---- */
    --hc-bg:          var(--hc-light);
    --hc-surface:     var(--hc-light);        /* cards on a light-gray inset, panels */
    --hc-surface-2:   var(--hc-light-gray);   /* card fills on white, insets */
    --hc-surface-3:   rgba(63,74,175,.08);    /* hover / raised */
    --hc-line:        var(--hc-light-gray);   /* hairlines / dividers */
    --hc-line-strong: rgba(126,131,160,.55);  /* input borders */
    --hc-text:        var(--hc-dark);
    --hc-muted:       var(--hc-dark-gray);
    --hc-faint:       rgba(126,131,160,.7);
    --hc-card-bg:     var(--hc-light-gray);   /* .hc-card fill in this scope */

    --hc-brand:       var(--hc-blue);
    --hc-brand-soft:  rgba(63,74,175,.10);
    --hc-brand-ring:  rgba(63,74,175,.35);
    --hc-highlight:   var(--hc-blue);         /* 1–3 highlighted headline words */
    --hc-on-brand:    var(--hc-light);        /* text on a brand-blue fill */
    --hc-link:        var(--hc-blue);
    --hc-on-status:   var(--hc-light);        /* text on a solid good/high fill */
    --hc-hover:       brightness(.94);        /* filled-control hover on this surface */

    /* ---- RAG / status palette (semantic; print shades = RagBand::hex()) ---- */
    --hc-good:        #15803d;   --hc-good-soft:   rgba(21,128,61,.12);
    --hc-low:         #b45309;   --hc-low-soft:    rgba(180,83,9,.12);
    --hc-medium:      #c2410c;   --hc-medium-soft: rgba(194,65,12,.12);
    --hc-high:        #b91c1c;   --hc-high-soft:   rgba(185,28,28,.12);
    --hc-info:        var(--hc-blue); --hc-info-soft: var(--hc-brand-soft);

    /* ---- Typography ---- */
    --hc-font-heading: "Golos Text", Inter, Arial, sans-serif;
    --hc-font:         Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --hc-font-mono:    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    --hc-fs-xs: 12px; --hc-fs-sm: 13px; --hc-fs-md: 14.5px; --hc-fs-lg: 16px;
    --hc-fs-xl: 20px; --hc-fs-2xl: 26px; --hc-fs-3xl: 34px;
    --hc-lh: 1.55;

    /* ---- Shape & spacing ---- */
    --hc-radius: 2px; --hc-radius-pill: 999px;
    --hc-space-1: 4px; --hc-space-2: 8px; --hc-space-3: 12px; --hc-space-4: 16px;
    --hc-space-5: 24px; --hc-space-6: 32px; --hc-space-7: 48px;

    /* ---- Focus & motion (no elevation — the brand has no shadows) ---- */
    --hc-ring: 0 0 0 3px var(--hc-brand-ring);
    --hc-ease: .15s ease;

    /* control sizing */
    --hc-control-h: 40px;
    --hc-control-pad: 0 14px;
}

/* ---- Dark scope: the title-slide look ---- */
.hc-dark {
    --hc-bg:          var(--hc-dark);
    --hc-surface:     var(--hc-dark);
    --hc-surface-2:   rgba(255,255,255,.06);
    --hc-surface-3:   rgba(255,255,255,.10);
    --hc-line:        rgba(255,255,255,.14);
    --hc-line-strong: rgba(255,255,255,.28);
    --hc-text:        var(--hc-light);
    --hc-muted:       var(--hc-dark-gray);
    --hc-faint:       rgba(255,255,255,.5);
    --hc-card-bg:     rgba(255,255,255,.05);  /* a dark card on the dark page — a faint lift, no border */
    --hc-highlight:   var(--hc-green);
    --hc-link:        var(--hc-light);
    --hc-on-status:   var(--hc-dark);         /* dark text on the light status fills */
    --hc-hover:       brightness(1.08);
    /* light fills read on navy — dark text on them (RagBand::hexOnDark) */
    --hc-good:   var(--hc-green); --hc-good-soft:   rgba(110,247,110,.14);
    --hc-low:    #fbbf24;         --hc-low-soft:    rgba(251,191,36,.14);
    --hc-medium: var(--hc-orange);--hc-medium-soft: rgba(255,90,49,.16);
    --hc-high:   #f87171;         --hc-high-soft:   rgba(248,113,113,.16);
    --hc-info:   #a5b4fc;         --hc-info-soft:   rgba(165,180,252,.14);
    background: var(--hc-bg);
    color: var(--hc-text);
}
/* ---------------------------------------------------------------------------
   Scope: apply .hc-app to <body> (or a wrapper) for base background + text.
   Component classes work anywhere.
   --------------------------------------------------------------------------- */
.hc-app {
    margin: 0;
    background: var(--hc-bg);
    color: var(--hc-text);
    font-family: var(--hc-font);
    font-size: var(--hc-fs-md);
    line-height: var(--hc-lh);
    -webkit-font-smoothing: antialiased;
}
.hc-app *, .hc-scope * { box-sizing: border-box; }

/* ---- Typography (titles: heading face, single line-height; body 1.15+) ---- */
.hc-h1, .hc-h2, .hc-h3 { font-family: var(--hc-font-heading); font-weight: 700; line-height: 1.1; letter-spacing: -.01em; color: var(--hc-text); }
.hc-h1 { font-size: var(--hc-fs-3xl); margin: 0 0 var(--hc-space-3); }
.hc-h2 { font-size: var(--hc-fs-2xl); margin: 0 0 var(--hc-space-3); }
.hc-h3 { font-size: var(--hc-fs-xl); margin: 0 0 var(--hc-space-2); }
.hc-eyebrow { font-size: var(--hc-fs-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--hc-muted); margin: 0 0 var(--hc-space-2); }
.hc-text { color: var(--hc-text); }
.hc-muted { color: var(--hc-muted); }
.hc-lede { color: var(--hc-muted); font-size: var(--hc-fs-lg); line-height: 1.6; max-width: 60ch; }
.hc-accent { color: var(--hc-highlight); }
.hc-link { color: var(--hc-link); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color var(--hc-ease); }
.hc-link:hover { border-bottom-color: currentColor; }
.hc-code { font-family: var(--hc-font-mono); font-size: .92em; background: var(--hc-surface-2); border-radius: var(--hc-radius); padding: 1px 6px; color: var(--hc-text); }
.hc-kbd { font-family: var(--hc-font-mono); font-size: .82em; background: var(--hc-surface-2); border: 1px solid var(--hc-line-strong); border-bottom-width: 2px; border-radius: var(--hc-radius); padding: 2px 7px; color: var(--hc-text); }

/* ---- Buttons (primary is ALWAYS the brand blue; 2px corners; no shadow) ---- */
.hc-btn {
    --_bg: var(--hc-surface-2); --_fg: var(--hc-text); --_bd: transparent;
    appearance: none; cursor: pointer; text-decoration: none; user-select: none;
    display: inline-flex; align-items: center; justify-content: center; gap: var(--hc-space-2);
    height: var(--hc-control-h); padding: var(--hc-control-pad);
    font-family: var(--hc-font); font-size: var(--hc-fs-md); font-weight: 700; line-height: 1;
    color: var(--_fg); background: var(--_bg); border: 1px solid var(--_bd);
    border-radius: var(--hc-radius); transition: filter var(--hc-ease), background var(--hc-ease), transform .06s ease, box-shadow var(--hc-ease);
}
.hc-btn:hover { filter: var(--hc-hover); }
.hc-btn:active { transform: translateY(1px); }
.hc-btn:focus-visible { outline: none; box-shadow: var(--hc-ring); }
.hc-btn[disabled], .hc-btn.is-disabled { opacity: .5; cursor: not-allowed; filter: none; transform: none; }
.hc-btn svg { width: 16px; height: 16px; }

.hc-btn--primary   { --_bg: var(--hc-brand); --_fg: var(--hc-on-brand); --_bd: transparent; }
.hc-btn--secondary { --_bg: var(--hc-surface-2); --_fg: var(--hc-text); --_bd: transparent; }
.hc-btn--ghost     { --_bg: transparent; --_fg: var(--hc-text); --_bd: var(--hc-line-strong); }
.hc-btn--danger    { --_bg: var(--hc-high); --_fg: var(--hc-on-status); --_bd: transparent; }
.hc-btn--success   { --_bg: var(--hc-good); --_fg: var(--hc-on-status); --_bd: transparent; }
.hc-btn--subtle    { --_bg: var(--hc-brand-soft); --_fg: var(--hc-brand); --_bd: transparent; }

.hc-btn--sm { height: 32px; font-size: var(--hc-fs-sm); padding: 0 11px; }
.hc-btn--lg { height: 48px; font-size: var(--hc-fs-lg); padding: 0 22px; }
.hc-btn--icon { width: var(--hc-control-h); padding: 0; }
.hc-btn--block { display: flex; width: 100%; }

/* ---- Forms ---- */
.hc-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--hc-space-4); }
.hc-label { font-size: var(--hc-fs-sm); font-weight: 600; color: var(--hc-text); }
.hc-label .hc-req { color: var(--hc-high); }
.hc-hint { font-size: var(--hc-fs-xs); color: var(--hc-muted); }
.hc-error { font-size: var(--hc-fs-xs); color: var(--hc-high); }

.hc-input, .hc-textarea, .hc-select {
    width: 100%; font-family: var(--hc-font); font-size: var(--hc-fs-md); color: var(--hc-text);
    background: var(--hc-surface); border: 1px solid var(--hc-line-strong); border-radius: var(--hc-radius);
    height: var(--hc-control-h); padding: var(--hc-control-pad);
    transition: border-color var(--hc-ease), box-shadow var(--hc-ease), background var(--hc-ease);
}
.hc-textarea { height: auto; min-height: 96px; padding: 10px 14px; resize: vertical; line-height: 1.5; }
.hc-input::placeholder, .hc-textarea::placeholder { color: var(--hc-faint); }
.hc-input:focus, .hc-textarea:focus, .hc-select:focus { outline: none; border-color: var(--hc-brand); box-shadow: var(--hc-ring); }
.hc-input:disabled, .hc-textarea:disabled, .hc-select:disabled { opacity: .55; cursor: not-allowed; }
.hc-input.is-invalid, .hc-textarea.is-invalid, .hc-select.is-invalid { border-color: var(--hc-high); box-shadow: 0 0 0 3px var(--hc-high-soft); }
.hc-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237E83A0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px;
}

/* input group (addon + field) */
.hc-input-group { display: flex; }
.hc-input-group .hc-input { border-radius: 0 var(--hc-radius) var(--hc-radius) 0; }
.hc-input-group .hc-addon { display: inline-flex; align-items: center; padding: 0 12px; font-size: var(--hc-fs-sm); color: var(--hc-muted); background: var(--hc-surface-2); border: 1px solid var(--hc-line-strong); border-right: 0; border-radius: var(--hc-radius) 0 0 var(--hc-radius); }

/* checkbox / radio */
.hc-check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: var(--hc-fs-md); color: var(--hc-text); }
.hc-check input { appearance: none; width: 18px; height: 18px; flex: none; background: var(--hc-surface); border: 1px solid var(--hc-line-strong); border-radius: var(--hc-radius); display: grid; place-content: center; transition: background var(--hc-ease), border-color var(--hc-ease); }
.hc-check input[type="radio"] { border-radius: 999px; }
.hc-check input:checked { background: var(--hc-brand); border-color: var(--hc-brand); }
.hc-check input:checked::after { content: ""; width: 10px; height: 10px; }
.hc-check input[type="checkbox"]:checked::after { width: 6px; height: 10px; border: solid var(--hc-light); border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-1px); }
.hc-check input[type="radio"]:checked::after { width: 8px; height: 8px; border-radius: 999px; background: var(--hc-light); }
.hc-check input:focus-visible { outline: none; box-shadow: var(--hc-ring); }

/* switch */
.hc-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.hc-switch input { appearance: none; width: 40px; height: 22px; background: var(--hc-line-strong); border-radius: 999px; position: relative; transition: background var(--hc-ease); flex: none; }
.hc-switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 999px; background: var(--hc-light); transition: transform var(--hc-ease); }
.hc-switch input:checked { background: var(--hc-brand); }
.hc-switch input:checked::after { transform: translateX(18px); }
.hc-switch input:focus-visible { outline: none; box-shadow: var(--hc-ring); }

/* ---- Badges (pills; tinted fill + matching text, never colour-only — pair with a label) ---- */
.hc-badge { display: inline-flex; align-items: center; gap: 6px; font-size: var(--hc-fs-xs); font-weight: 700; line-height: 1; padding: 5px 10px; border-radius: var(--hc-radius-pill); color: var(--hc-text); background: var(--hc-surface-2); }
.hc-badge .hc-dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; }
.hc-badge--brand   { color: var(--hc-brand);  background: var(--hc-brand-soft); }
.hc-badge--good    { color: var(--hc-good);   background: var(--hc-good-soft); }
.hc-badge--low     { color: var(--hc-low);    background: var(--hc-low-soft); }
.hc-badge--medium  { color: var(--hc-medium); background: var(--hc-medium-soft); }
.hc-badge--high    { color: var(--hc-high);   background: var(--hc-high-soft); }
.hc-badge--info    { color: var(--hc-info);   background: var(--hc-info-soft); }
/* solid brand pills: Blue → white text, Green / Orange → dark text (the brand's badge rule) */
.hc-badge--solid-blue   { color: var(--hc-light); background: var(--hc-blue); }
.hc-badge--solid-green  { color: var(--hc-dark);  background: var(--hc-green); }
.hc-badge--solid-orange { color: var(--hc-dark);  background: var(--hc-orange); }

/* RAG pill (the canonical score band look) */
.hc-rag { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: var(--hc-fs-sm); padding: 6px 12px; border-radius: var(--hc-radius-pill); }
.hc-rag--good   { color: var(--hc-good);   background: var(--hc-good-soft); }
.hc-rag--low    { color: var(--hc-low);    background: var(--hc-low-soft); }
.hc-rag--medium { color: var(--hc-medium); background: var(--hc-medium-soft); }
.hc-rag--high   { color: var(--hc-high);   background: var(--hc-high-soft); }

/* ---- Cards (solid fill, 2px corners, no border, no shadow) ---- */
.hc-card { background: var(--hc-card-bg); border-radius: var(--hc-radius); }
.hc-card__header { padding: var(--hc-space-4) var(--hc-space-5); border-bottom: 1px solid var(--hc-line); font-family: var(--hc-font-heading); font-weight: 700; }
.hc-card__body { padding: var(--hc-space-5); }
.hc-card__footer { padding: var(--hc-space-4) var(--hc-space-5); border-top: 1px solid var(--hc-line); display: flex; gap: var(--hc-space-3); justify-content: flex-end; }

/* ---- Alerts (tinted fill, no accent line) ---- */
.hc-alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--hc-radius); background: var(--hc-surface-2); font-size: var(--hc-fs-sm); color: var(--hc-text); }
.hc-alert__title { font-weight: 700; margin: 0 0 2px; }
.hc-alert--info    { background: var(--hc-info-soft); }
.hc-alert--success { background: var(--hc-good-soft); }
.hc-alert--warning { background: var(--hc-low-soft); }
.hc-alert--danger  { background: var(--hc-high-soft); }

/* ---- Table ---- */
.hc-table { width: 100%; border-collapse: collapse; font-size: var(--hc-fs-sm); }
.hc-table th { text-align: left; font-weight: 700; font-size: var(--hc-fs-xs); letter-spacing: .04em; text-transform: uppercase; color: var(--hc-muted); padding: 10px 14px; border-bottom: 1px solid var(--hc-line); white-space: nowrap; }
.hc-table td { padding: 11px 14px; border-bottom: 1px solid var(--hc-line); color: var(--hc-text); }
.hc-table tr:hover td { background: var(--hc-surface-3); }

/* ---- Helpers ---- */
.hc-divider { height: 1px; background: var(--hc-line); border: 0; margin: var(--hc-space-5) 0; }
.hc-swatch { height: 56px; border-radius: var(--hc-radius); border: 1px solid var(--hc-line); }
.hc-stack { display: flex; flex-direction: column; gap: var(--hc-space-3); }
.hc-row { display: flex; flex-wrap: wrap; gap: var(--hc-space-3); align-items: center; }
.hc-grid { display: grid; gap: var(--hc-space-4); }
