/* =========================================================================
   Brand "vibe" presets
   -------------------------------------------------------------------------
   Per-company theming layer, applied via <html data-brand="..."> (set from
   the resolved brand_theme in quiz/context_processors.py).

   'default' = the original .org look. It has NO rules here, so every existing
   domain renders byte-for-byte as before. Only non-default brands are
   restyled, via the html:not([data-brand="default"]) guard below.

   Each preset changes FOUR things so the site reads as a different company:
     - typography: a distinct display font AND body font (a serif on 'dusk')
     - colour:     accent + hero gradient + badges unified to the brand hue
     - surface:    a tinted page background and alternating section tint
     - shape:      button corner radius

   Deliberately preserved: the multi-colour category tiles on the career
   landing (their rainbow from-/to- gradient utilities are a real design
   feature) and all body/neutral text colours (readability).

   To add a preset: add its slug to BRAND_THEMES in quiz/config.py and a
   variable block here. Nothing else to touch.
   ========================================================================= */

/* --- dusk: premium & editorial — indigo, serif display, soft & rounded --- */
html[data-brand="dusk"] {
    --brand: #6366f1;
    --brand-hover: #4f46e5;
    --brand-soft: #eef2ff;
    --brand-bg: #f7f7fd;
    --brand-bg-alt: #eef0fb;
    --brand-hero: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 45%, #ede9fe 100%);
    --hero-from: #eef2ff;
    --hero-via: #f5f3ff;
    --hero-to: #ede9fe;
    --brand-display: 'Fraunces';
    --brand-body: 'Inter';
    --brand-heading-weight: 600;
    --brand-heading-tracking: -0.01em;
    --brand-radius: 0.9rem;
}

/* --- sunset: warm & friendly — coral/orange, rounded geometric ---------- */
html[data-brand="sunset"] {
    --brand: #f97316;
    --brand-hover: #ea580c;
    --brand-soft: #fff2e8;
    --brand-bg: #fff9f4;
    --brand-bg-alt: #fdeee2;
    --brand-hero: linear-gradient(135deg, #fff1f2 0%, #fff7ed 45%, #ffedd5 100%);
    --hero-from: #fff1f2;
    --hero-via: #fff7ed;
    --hero-to: #ffedd5;
    --brand-display: 'Poppins';
    --brand-body: 'Poppins';
    --brand-heading-weight: 700;
    --brand-heading-tracking: -0.02em;
    --brand-radius: 0.75rem;
}

/* --- mono: techy & sharp — electric blue, grotesk, square corners ------- */
html[data-brand="mono"] {
    --brand: #2563eb;
    --brand-hover: #1d4ed8;
    --brand-soft: #eef4ff;
    --brand-bg: #f6f8fb;
    --brand-bg-alt: #eef1f6;
    --brand-hero: linear-gradient(135deg, #eff4ff 0%, #f1f5f9 50%, #e6edf7 100%);
    --hero-from: #eff4ff;
    --hero-via: #f1f5f9;
    --hero-to: #e6edf7;
    --brand-display: 'Space Grotesk';
    --brand-body: 'Space Grotesk';
    --brand-heading-weight: 700;
    --brand-heading-tracking: -0.03em;
    --brand-radius: 0.2rem;
}

/* --- ivyquiz: research-led — violet action colour, warm-neutral canvas,
       serif display over Sora body. Violet is ACTION-ONLY (CTA + logo); the
       page canvas stays warm-neutral (bone/sand), never violet. --------- */
html[data-brand="ivyquiz"] {
    --brand: #6D5DF6;
    --chart-accent: #6D5DF6;           /* result ring + radar; see bottom of file */
    --chart-accent-rgb: 109, 93, 246;
    --brand-hover: #5546E0;
    --brand-soft: #EFEDFF;
    --brand-bg: #F7F6F3;               /* bone — page background */
    --brand-bg-alt: #EDEBE5;           /* sand — alternating sections */
    --brand-hero: linear-gradient(135deg, #FFFFFF 0%, #F7F6F3 50%, #EDEBE5 100%);
    --hero-from: #FFFFFF;
    --hero-via: #F7F6F3;
    --hero-to: #EDEBE5;
    --brand-display: 'Source Serif 4';
    --brand-body: 'Sora';
    --brand-heading-weight: 700;
    --brand-heading-tracking: -0.025em;
    --brand-radius: 0.85rem;

    /* Content accents ("Playground") — colour icons/tiles so the page isn't
       all violet. base = tile fill, tint = tile background, text = AA-safe on
       white. Violet stays ACTION-ONLY (CTAs, links, logo); see ivyquiz icon
       overrides below. */
    --iq-aqua:#00B3A4;      --iq-aqua-tint:#DEF5F2;      --iq-aqua-text:#00877C;
    --iq-punch:#FF4F81;     --iq-punch-tint:#FFE6ED;     --iq-punch-text:#D42F62;
    --iq-tangerine:#FF8A3D; --iq-tangerine-tint:#FFEEE1; --iq-tangerine-text:#C25A14;
    --iq-cobalt:#3D6BFF;    --iq-cobalt-tint:#E3EAFF;    --iq-cobalt-text:#2A4FCC;
    --iq-sunflower:#FFC93D; --iq-sunflower-tint:#FFF4DA; --iq-sunflower-text:#B98A00;
}

/* =========================================================================
   Shared reskin — turns the variables above into the actual look.
   Applies to any non-default brand.
   ========================================================================= */

/* --- Typography ------------------------------------------------------- */
html:not([data-brand="default"]) body,
html:not([data-brand="default"]) .font-sans {
    font-family: var(--brand-body), ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
html:not([data-brand="default"]) h1,
html:not([data-brand="default"]) h2,
html:not([data-brand="default"]) h3,
html:not([data-brand="default"]) h4 {
    font-family: var(--brand-display), ui-sans-serif, Georgia, serif;
    font-weight: var(--brand-heading-weight);
    letter-spacing: var(--brand-heading-tracking);
}

/* --- Surface / background --------------------------------------------- */
html:not([data-brand="default"]) body { background-color: var(--brand-bg) !important; }
/* Alternating light sections pick up a brand tint; white cards stay white. */
html:not([data-brand="default"]) .bg-gray-50,
html:not([data-brand="default"]) .bg-slate-50 { background-color: var(--brand-bg-alt) !important; }

/* --- Shape ------------------------------------------------------------ */
/* rounded-full is left alone so avatars, pills and dots stay circular. */
html:not([data-brand="default"]) .rounded-lg,
html:not([data-brand="default"]) .rounded-xl,
html:not([data-brand="default"]) .rounded-2xl,
html:not([data-brand="default"]) .rounded-3xl,
html:not([data-brand="default"]) .btn { border-radius: var(--brand-radius); }

/* --- Career landing (index-career-v3) signature classes --------------- */
/* These are hardcoded green in the template's own <style>, so the brand vars
   can't reach them without an explicit override here. */
html:not([data-brand="default"]) .v4-hero { background: var(--brand-hero) !important; }
html:not([data-brand="default"]) .v4-cta { background-color: var(--brand) !important; border-color: var(--brand) !important; }
html:not([data-brand="default"]) .v4-cta:hover { background-color: var(--brand-hover) !important; border-color: var(--brand-hover) !important; }
html:not([data-brand="default"]) .v4-gradient-text { background: linear-gradient(135deg, var(--brand), var(--brand-hover)) !important; -webkit-background-clip: text; background-clip: text; }
html:not([data-brand="default"]) .v4-step-line { background: linear-gradient(180deg, var(--brand), var(--brand-hover)) !important; }

/* --- Accent unification ---------------------------------------------- */
/* Solid + soft accents (CTAs, badges, icons, links) across the accent
   families move to the brand hue. Gradient stop utilities (from-, to-, via-)
   are intentionally NOT touched, so the rainbow category tiles keep colour. */
html:not([data-brand="default"]) .bg-emerald-50,  html:not([data-brand="default"]) .bg-emerald-100,
html:not([data-brand="default"]) .bg-green-50,    html:not([data-brand="default"]) .bg-green-100,
html:not([data-brand="default"]) .bg-blue-50,     html:not([data-brand="default"]) .bg-blue-100,
html:not([data-brand="default"]) .bg-indigo-50,   html:not([data-brand="default"]) .bg-indigo-100,
html:not([data-brand="default"]) .bg-teal-50,     html:not([data-brand="default"]) .bg-teal-100 { background-color: var(--brand-soft) !important; }

html:not([data-brand="default"]) .bg-emerald-500, html:not([data-brand="default"]) .bg-emerald-600,
html:not([data-brand="default"]) .bg-green-500,   html:not([data-brand="default"]) .bg-green-600,
html:not([data-brand="default"]) .bg-blue-500,    html:not([data-brand="default"]) .bg-blue-600,
html:not([data-brand="default"]) .bg-indigo-500,  html:not([data-brand="default"]) .bg-indigo-600 { background-color: var(--brand) !important; }

html:not([data-brand="default"]) .hover\:bg-emerald-600:hover, html:not([data-brand="default"]) .hover\:bg-emerald-700:hover,
html:not([data-brand="default"]) .hover\:bg-green-600:hover,   html:not([data-brand="default"]) .hover\:bg-green-700:hover,
html:not([data-brand="default"]) .hover\:bg-blue-700:hover,    html:not([data-brand="default"]) .hover\:bg-indigo-700:hover { background-color: var(--brand-hover) !important; }

html:not([data-brand="default"]) .text-emerald-500, html:not([data-brand="default"]) .text-emerald-600, html:not([data-brand="default"]) .text-emerald-700,
html:not([data-brand="default"]) .text-green-500,   html:not([data-brand="default"]) .text-green-600,   html:not([data-brand="default"]) .text-green-700,
html:not([data-brand="default"]) .text-blue-600,    html:not([data-brand="default"]) .text-blue-700,
html:not([data-brand="default"]) .text-indigo-600,  html:not([data-brand="default"]) .text-indigo-700,
html:not([data-brand="default"]) .text-teal-600,    html:not([data-brand="default"]) .text-teal-700 { color: var(--brand) !important; }

html:not([data-brand="default"]) .border-emerald-500, html:not([data-brand="default"]) .border-emerald-600,
html:not([data-brand="default"]) .border-green-500,   html:not([data-brand="default"]) .border-green-600,
html:not([data-brand="default"]) .border-blue-500,    html:not([data-brand="default"]) .border-blue-600,
html:not([data-brand="default"]) .border-indigo-500,  html:not([data-brand="default"]) .border-indigo-600 { border-color: var(--brand) !important; }

/* Ring/focus accents used on inputs and CTAs. */
html:not([data-brand="default"]) .ring-emerald-500, html:not([data-brand="default"]) .ring-green-500,
html:not([data-brand="default"]) .ring-blue-500,    html:not([data-brand="default"]) .ring-indigo-500 { --tw-ring-color: var(--brand) !important; }

/* index_v2 (enneagram/default landing) defines its own local brand-green
   helper classes with hardcoded green — re-point them to the brand hue too. */
html:not([data-brand="default"]) .text-brand-green,
html:not([data-brand="default"]) .hover\:text-brand-green:hover { color: var(--brand) !important; }
html:not([data-brand="default"]) .border-brand-green,
html:not([data-brand="default"]) .hover\:border-brand-green:hover { border-color: var(--brand) !important; }
html:not([data-brand="default"]) .bg-brand-green\/5,
html:not([data-brand="default"]) .hover\:bg-brand-green\/5:hover,
html:not([data-brand="default"]) .bg-brand-green\/10 { background-color: var(--brand-soft) !important; }

/* Quiz page (quiz-v2): the green accent (#4caf50 — progress bar, loading,
   analysis, JS-set circles) now reads var(--quiz-accent); point it at the brand.
   The Likert answer bars keep a positive→negative scale, but the "agree" side is
   tinted to the brand instead of green. */
html:not([data-brand="default"]) { --quiz-accent: var(--brand); }
html:not([data-brand="default"]) .v2-option-bar.strongly-agree { background-color: color-mix(in srgb, var(--brand) 26%, #fff) !important; }
html:not([data-brand="default"]) .v2-option-bar.agree { background-color: color-mix(in srgb, var(--brand) 13%, #fff) !important; }

/* DaisyUI "success" utilities are green (e.g. the mid-quiz interstitial
   "Continue" button and the "90%" percentage text). Theme the whole family. */
html:not([data-brand="default"]) .btn-success {
    background-color: var(--brand) !important;
    border-color: var(--brand) !important;
    color: #fff !important;
}
html:not([data-brand="default"]) .btn-success:hover {
    background-color: var(--brand-hover) !important;
    border-color: var(--brand-hover) !important;
}
html:not([data-brand="default"]) .text-success { color: var(--brand) !important; }
html:not([data-brand="default"]) .bg-success { background-color: var(--brand) !important; }
html:not([data-brand="default"]) .border-success { border-color: var(--brand) !important; }

/* payment_v2 uses Tailwind arbitrary-value classes for the brand green
   (bg-[#10B981] etc.) — those can't be var-swapped in markup, so re-point the
   compiled utilities to the brand hue for non-default brands. */
html:not([data-brand="default"]) .bg-\[\#10B981\]     { background-color: var(--brand) !important; }
html:not([data-brand="default"]) .border-\[\#10B981\] { border-color: var(--brand) !important; }
html:not([data-brand="default"]) .text-\[\#10B981\]   { color: var(--brand) !important; }
html:not([data-brand="default"]) .bg-\[\#059669\],
html:not([data-brand="default"]) .hover\:bg-\[\#059669\]:hover { background-color: var(--brand-hover) !important; }

/* ── Full emerald/green shade coverage (portal: dashboard/upsell/review) ──
   The portal leans on emerald-* across every shade, so every shade is listed.
   `~=` (whole class token), NOT `*=` (substring): a substring also matches
   `hover:text-green-600`, which repainted links that are only green ON HOVER —
   that is what turned the portal nav brand-coloured at rest. Shade coverage is
   unchanged; only variant utilities (hover:/focus:/group-hover:) drop out.
   bg shades stay split light->soft, strong->brand so light backgrounds don't
   turn dark; those already use plain class selectors, which are token-exact. */
html:not([data-brand="default"]) [class~="text-emerald-50"],
html:not([data-brand="default"]) [class~="text-emerald-100"],
html:not([data-brand="default"]) [class~="text-emerald-200"],
html:not([data-brand="default"]) [class~="text-emerald-300"],
html:not([data-brand="default"]) [class~="text-emerald-400"],
html:not([data-brand="default"]) [class~="text-emerald-500"],
html:not([data-brand="default"]) [class~="text-emerald-600"],
html:not([data-brand="default"]) [class~="text-emerald-700"],
html:not([data-brand="default"]) [class~="text-emerald-800"],
html:not([data-brand="default"]) [class~="text-emerald-900"],
html:not([data-brand="default"]) [class~="text-emerald-950"],
html:not([data-brand="default"]) [class~="text-green-50"],
html:not([data-brand="default"]) [class~="text-green-100"],
html:not([data-brand="default"]) [class~="text-green-200"],
html:not([data-brand="default"]) [class~="text-green-300"],
html:not([data-brand="default"]) [class~="text-green-400"],
html:not([data-brand="default"]) [class~="text-green-500"],
html:not([data-brand="default"]) [class~="text-green-600"],
html:not([data-brand="default"]) [class~="text-green-700"],
html:not([data-brand="default"]) [class~="text-green-800"],
html:not([data-brand="default"]) [class~="text-green-900"],
html:not([data-brand="default"]) [class~="text-green-950"] { color: var(--brand) !important; }
html:not([data-brand="default"]) [class~="border-emerald-50"],
html:not([data-brand="default"]) [class~="border-emerald-100"],
html:not([data-brand="default"]) [class~="border-emerald-200"],
html:not([data-brand="default"]) [class~="border-emerald-300"],
html:not([data-brand="default"]) [class~="border-emerald-400"],
html:not([data-brand="default"]) [class~="border-emerald-500"],
html:not([data-brand="default"]) [class~="border-emerald-600"],
html:not([data-brand="default"]) [class~="border-emerald-700"],
html:not([data-brand="default"]) [class~="border-emerald-800"],
html:not([data-brand="default"]) [class~="border-emerald-900"],
html:not([data-brand="default"]) [class~="border-emerald-950"],
html:not([data-brand="default"]) [class~="border-green-50"],
html:not([data-brand="default"]) [class~="border-green-100"],
html:not([data-brand="default"]) [class~="border-green-200"],
html:not([data-brand="default"]) [class~="border-green-300"],
html:not([data-brand="default"]) [class~="border-green-400"],
html:not([data-brand="default"]) [class~="border-green-500"],
html:not([data-brand="default"]) [class~="border-green-600"],
html:not([data-brand="default"]) [class~="border-green-700"],
html:not([data-brand="default"]) [class~="border-green-800"],
html:not([data-brand="default"]) [class~="border-green-900"],
html:not([data-brand="default"]) [class~="border-green-950"] { border-color: var(--brand) !important; }
html:not([data-brand="default"]) [class~="from-emerald-50"],
html:not([data-brand="default"]) [class~="from-emerald-100"],
html:not([data-brand="default"]) [class~="from-emerald-200"],
html:not([data-brand="default"]) [class~="from-emerald-300"],
html:not([data-brand="default"]) [class~="from-emerald-400"],
html:not([data-brand="default"]) [class~="from-emerald-500"],
html:not([data-brand="default"]) [class~="from-emerald-600"],
html:not([data-brand="default"]) [class~="from-emerald-700"],
html:not([data-brand="default"]) [class~="from-emerald-800"],
html:not([data-brand="default"]) [class~="from-emerald-900"],
html:not([data-brand="default"]) [class~="from-emerald-950"],
html:not([data-brand="default"]) [class~="from-green-50"],
html:not([data-brand="default"]) [class~="from-green-100"],
html:not([data-brand="default"]) [class~="from-green-200"],
html:not([data-brand="default"]) [class~="from-green-300"],
html:not([data-brand="default"]) [class~="from-green-400"],
html:not([data-brand="default"]) [class~="from-green-500"],
html:not([data-brand="default"]) [class~="from-green-600"],
html:not([data-brand="default"]) [class~="from-green-700"],
html:not([data-brand="default"]) [class~="from-green-800"],
html:not([data-brand="default"]) [class~="from-green-900"],
html:not([data-brand="default"]) [class~="from-green-950"] { --tw-gradient-from: var(--brand) !important; }
html:not([data-brand="default"]) [class~="to-emerald-50"],
html:not([data-brand="default"]) [class~="to-emerald-100"],
html:not([data-brand="default"]) [class~="to-emerald-200"],
html:not([data-brand="default"]) [class~="to-emerald-300"],
html:not([data-brand="default"]) [class~="to-emerald-400"],
html:not([data-brand="default"]) [class~="to-emerald-500"],
html:not([data-brand="default"]) [class~="to-emerald-600"],
html:not([data-brand="default"]) [class~="to-emerald-700"],
html:not([data-brand="default"]) [class~="to-emerald-800"],
html:not([data-brand="default"]) [class~="to-emerald-900"],
html:not([data-brand="default"]) [class~="to-emerald-950"],
html:not([data-brand="default"]) [class~="to-green-50"],
html:not([data-brand="default"]) [class~="to-green-100"],
html:not([data-brand="default"]) [class~="to-green-200"],
html:not([data-brand="default"]) [class~="to-green-300"],
html:not([data-brand="default"]) [class~="to-green-400"],
html:not([data-brand="default"]) [class~="to-green-500"],
html:not([data-brand="default"]) [class~="to-green-600"],
html:not([data-brand="default"]) [class~="to-green-700"],
html:not([data-brand="default"]) [class~="to-green-800"],
html:not([data-brand="default"]) [class~="to-green-900"],
html:not([data-brand="default"]) [class~="to-green-950"] { --tw-gradient-to: var(--brand) !important; }
html:not([data-brand="default"]) [class~="via-emerald-50"],
html:not([data-brand="default"]) [class~="via-emerald-100"],
html:not([data-brand="default"]) [class~="via-emerald-200"],
html:not([data-brand="default"]) [class~="via-emerald-300"],
html:not([data-brand="default"]) [class~="via-emerald-400"],
html:not([data-brand="default"]) [class~="via-emerald-500"],
html:not([data-brand="default"]) [class~="via-emerald-600"],
html:not([data-brand="default"]) [class~="via-emerald-700"],
html:not([data-brand="default"]) [class~="via-emerald-800"],
html:not([data-brand="default"]) [class~="via-emerald-900"],
html:not([data-brand="default"]) [class~="via-emerald-950"],
html:not([data-brand="default"]) [class~="via-green-50"],
html:not([data-brand="default"]) [class~="via-green-100"],
html:not([data-brand="default"]) [class~="via-green-200"],
html:not([data-brand="default"]) [class~="via-green-300"],
html:not([data-brand="default"]) [class~="via-green-400"],
html:not([data-brand="default"]) [class~="via-green-500"],
html:not([data-brand="default"]) [class~="via-green-600"],
html:not([data-brand="default"]) [class~="via-green-700"],
html:not([data-brand="default"]) [class~="via-green-800"],
html:not([data-brand="default"]) [class~="via-green-900"],
html:not([data-brand="default"]) [class~="via-green-950"] { --tw-gradient-via: var(--brand) !important; }

html:not([data-brand="default"]) .bg-emerald-50,  html:not([data-brand="default"]) .bg-emerald-100,
html:not([data-brand="default"]) .bg-emerald-200, html:not([data-brand="default"]) .bg-green-50,
html:not([data-brand="default"]) .bg-green-100,   html:not([data-brand="default"]) .bg-green-200 { background-color: var(--brand-soft) !important; }
html:not([data-brand="default"]) .bg-emerald-300, html:not([data-brand="default"]) .bg-emerald-400,
html:not([data-brand="default"]) .bg-emerald-500, html:not([data-brand="default"]) .bg-emerald-600,
html:not([data-brand="default"]) .bg-emerald-700, html:not([data-brand="default"]) .bg-emerald-800,
html:not([data-brand="default"]) .bg-emerald-900, html:not([data-brand="default"]) .bg-green-300,
html:not([data-brand="default"]) .bg-green-400,   html:not([data-brand="default"]) .bg-green-500,
html:not([data-brand="default"]) .bg-green-600,   html:not([data-brand="default"]) .bg-green-700,
html:not([data-brand="default"]) .bg-green-800,   html:not([data-brand="default"]) .bg-green-900 { background-color: var(--brand) !important; }

/* Portal workbook badge / stat greens (upsell_v2 local classes). */
html:not([data-brand="default"]) .wb-badge { background: var(--brand) !important; }
html:not([data-brand="default"]) .wb-stat.green .wb-stat-num,
html:not([data-brand="default"]) .wb-stat.green .wb-stat-label { color: var(--brand) !important; }

/* =========================================================================
   ivyquiz — icon accents (must follow the shared reskin to win the cascade)
   -------------------------------------------------------------------------
   The reskin above flattens every accent family to the brand hue, which is
   right for the generic vibe presets but leaves ivyquiz all-violet. The
   ivyquiz brand keeps violet for ACTION ONLY and colours decorative icons
   with the Playground accents. Here we re-point the DECORATIVE utilities —
   icon glyph colours (text-*) and light icon-tile tints (bg-*-50/100) — back
   to a Playground accent, mapped by the template's original family:
       green / emerald / teal  -> aqua     (growth, learning, positive)
       blue                    -> cobalt   (data, methodology)
       indigo                  -> punch    (types, relationships)
   Solid strong fills (bg-*-500/600) are deliberately left to the reskin
   (violet), because those double as CTA buttons and buttons must stay violet.
   ========================================================================= */

/* icon glyph colours -> AA-safe accent text.
   `~=` matches a whole class token, NOT a substring. A substring also matches
   `hover:text-green-600`, repainting links that are only accented ON HOVER.
   Only the 400-950 steps are listed: the 50-300 steps are near-white tints
   used as muted text ON a coloured surface (e.g. `text-indigo-100` on the
   violet dashboard banner), not icon glyphs — remapping those to a saturated
   accent made them unreadable. */
html[data-brand="ivyquiz"] [class~="text-green-400"],
html[data-brand="ivyquiz"] [class~="text-green-500"],
html[data-brand="ivyquiz"] [class~="text-green-600"],
html[data-brand="ivyquiz"] [class~="text-green-700"],
html[data-brand="ivyquiz"] [class~="text-green-800"],
html[data-brand="ivyquiz"] [class~="text-green-900"],
html[data-brand="ivyquiz"] [class~="text-green-950"],
html[data-brand="ivyquiz"] [class~="text-emerald-400"],
html[data-brand="ivyquiz"] [class~="text-emerald-500"],
html[data-brand="ivyquiz"] [class~="text-emerald-600"],
html[data-brand="ivyquiz"] [class~="text-emerald-700"],
html[data-brand="ivyquiz"] [class~="text-emerald-800"],
html[data-brand="ivyquiz"] [class~="text-emerald-900"],
html[data-brand="ivyquiz"] [class~="text-emerald-950"],
html[data-brand="ivyquiz"] [class~="text-teal-400"],
html[data-brand="ivyquiz"] [class~="text-teal-500"],
html[data-brand="ivyquiz"] [class~="text-teal-600"],
html[data-brand="ivyquiz"] [class~="text-teal-700"],
html[data-brand="ivyquiz"] [class~="text-teal-800"],
html[data-brand="ivyquiz"] [class~="text-teal-900"],
html[data-brand="ivyquiz"] [class~="text-teal-950"] { color: var(--iq-aqua-text) !important; }
html[data-brand="ivyquiz"] [class~="text-blue-400"],
html[data-brand="ivyquiz"] [class~="text-blue-500"],
html[data-brand="ivyquiz"] [class~="text-blue-600"],
html[data-brand="ivyquiz"] [class~="text-blue-700"],
html[data-brand="ivyquiz"] [class~="text-blue-800"],
html[data-brand="ivyquiz"] [class~="text-blue-900"],
html[data-brand="ivyquiz"] [class~="text-blue-950"] { color: var(--iq-cobalt-text) !important; }
html[data-brand="ivyquiz"] [class~="text-indigo-400"],
html[data-brand="ivyquiz"] [class~="text-indigo-500"],
html[data-brand="ivyquiz"] [class~="text-indigo-600"],
html[data-brand="ivyquiz"] [class~="text-indigo-700"],
html[data-brand="ivyquiz"] [class~="text-indigo-800"],
html[data-brand="ivyquiz"] [class~="text-indigo-900"],
html[data-brand="ivyquiz"] [class~="text-indigo-950"] { color: var(--iq-punch-text) !important; }

/* light icon-tile backgrounds -> accent tint */
html[data-brand="ivyquiz"] .bg-green-50,   html[data-brand="ivyquiz"] .bg-green-100,
html[data-brand="ivyquiz"] .bg-emerald-50, html[data-brand="ivyquiz"] .bg-emerald-100,
html[data-brand="ivyquiz"] .bg-teal-50,    html[data-brand="ivyquiz"] .bg-teal-100 { background-color: var(--iq-aqua-tint) !important; }
html[data-brand="ivyquiz"] .bg-blue-50,    html[data-brand="ivyquiz"] .bg-blue-100 { background-color: var(--iq-cobalt-tint) !important; }
html[data-brand="ivyquiz"] .bg-indigo-50,  html[data-brand="ivyquiz"] .bg-indigo-100 { background-color: var(--iq-punch-tint) !important; }

/* Per-card feature-icon accents — one accent per card (handoff feature-card
   spec). Applied via explicit classes in the landing templates so they no-op
   on the default brand. Each colours the icon tile (tint) + glyph (AA-safe). */
html[data-brand="ivyquiz"] .iq-accent-aqua       { background-color: var(--iq-aqua-tint) !important; }
html[data-brand="ivyquiz"] .iq-accent-aqua i     { color: var(--iq-aqua-text) !important; }
html[data-brand="ivyquiz"] .iq-accent-punch      { background-color: var(--iq-punch-tint) !important; }
html[data-brand="ivyquiz"] .iq-accent-punch i    { color: var(--iq-punch-text) !important; }
html[data-brand="ivyquiz"] .iq-accent-cobalt     { background-color: var(--iq-cobalt-tint) !important; }
html[data-brand="ivyquiz"] .iq-accent-cobalt i   { color: var(--iq-cobalt-text) !important; }
html[data-brand="ivyquiz"] .iq-accent-sunflower  { background-color: var(--iq-sunflower-tint) !important; }
html[data-brand="ivyquiz"] .iq-accent-sunflower i{ color: var(--iq-sunflower-text) !important; }

/* =========================================================================
   ivyquiz — animated logo lockup (handoff assets/code/brand.css + logo.html)
   -------------------------------------------------------------------------
   Full primary lockup (tile + wordmark + "Scientific Assessments" tagline)
   that collapses to the stacked square icon on scroll. Geometry is derived
   from --iq-logo-h. Header is pinned so the collapse is actually visible;
   all motion is gated behind prefers-reduced-motion.
   ========================================================================= */
.iq-logo {
    --iq-logo-h: 44px;
    --iq-violet: #6D5DF6;
    --iq-hairline: #D8DAE3;
    --iq-slate: #5B6070;
    display: inline-flex; align-items: center;
    gap: calc(var(--iq-logo-h) * .275);
    text-decoration: none;
}
.iq-logo__tile {
    display: flex; align-items: center;
    height: var(--iq-logo-h);
    border-radius: calc(var(--iq-logo-h) * .30);
    background: var(--iq-violet);
    padding-right: calc(var(--iq-logo-h) * .35);
    overflow: hidden;
    transition: transform .35s cubic-bezier(.2,.9,.25,1);
}
.iq-logo:hover .iq-logo__tile { transform: translateY(-3px) rotate(-6deg); }
.iq-logo__mark {
    position: relative; flex: none; width: var(--iq-logo-h);
    display: grid; place-items: center;
    font: 800 calc(var(--iq-logo-h) * .45)/1 Sora, sans-serif;
    letter-spacing: -.07em; color: rgba(255,255,255,.92);
}
.iq-logo__rule {
    flex: none; width: 1px; height: calc(var(--iq-logo-h) * .475);
    background: rgba(255,255,255,.28); margin-right: calc(var(--iq-logo-h) * .30);
}
.iq-logo__word {
    font: 800 calc(var(--iq-logo-h) * .525)/1 Sora, sans-serif;
    letter-spacing: -.045em; color: #fff; white-space: nowrap;
}
.iq-logo__divider { width: 1px; height: calc(var(--iq-logo-h) * .775); background: var(--iq-hairline); }
.iq-logo__tagline {
    font: 400 calc(var(--iq-logo-h) * .30)/1.25 Newsreader, Georgia, serif;
    color: var(--iq-slate); width: calc(var(--iq-logo-h) * 2.05);
}
.iq-logo__word-wrap, .iq-logo__tag-wrap {
    display: flex; align-items: center; overflow: hidden;
    transition: width .52s cubic-bezier(.5,0,.2,1), opacity .3s ease;
}
.iq-logo__word-wrap { width: var(--iq-word-w, 118px); }
.iq-logo__tag-wrap  { width: var(--iq-tag-w, 120px); gap: calc(var(--iq-logo-h) * .28); }
.iq-logo__stack {
    position: absolute; opacity: 0; transition: opacity .28s ease;
    display: flex; flex-direction: column; align-items: center; line-height: 1.02;
}
.iq-logo__stack span {
    font: 800 calc(var(--iq-logo-h) * .265)/1.02 Sora, sans-serif;
    letter-spacing: -.05em; color: #fff;
}
.iq-logo__glyph { transition: opacity .28s ease; }
.iq-logo.is-collapsed .iq-logo__word-wrap,
.iq-logo.is-collapsed .iq-logo__tag-wrap { width: 0; opacity: 0; }
.iq-logo.is-collapsed .iq-logo__glyph { opacity: 0; }
.iq-logo.is-collapsed .iq-logo__stack { opacity: 1; }

/* Page-load build-in (motion study 7a): badge pops, glyph rises, wordmark
   wipes open, the rule draws, then the tagline arrives (~900ms). Plays once
   on load via the .iq-logo--intro class; `backwards` fill hides each piece
   until its turn and hands control back to the resting styles afterwards, so
   hover + scroll-collapse keep working. */
.iq-logo--intro .iq-logo__tile      { animation: iqPop .42s cubic-bezier(.2,.9,.25,1) backwards; }
.iq-logo--intro .iq-logo__glyph     { animation: iqRise .40s ease .12s backwards; }
.iq-logo--intro .iq-logo__rule      { animation: iqDraw .30s ease .34s backwards; transform-origin: top; }
.iq-logo--intro .iq-logo__word-wrap { animation: iqWipeWord .50s cubic-bezier(.5,0,.2,1) .30s backwards; }
.iq-logo--intro .iq-logo__tag-wrap  { animation: iqWipeTag  .50s cubic-bezier(.5,0,.2,1) .60s backwards; }
@keyframes iqPop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.05); } 100% { transform: scale(1); opacity: 1; } }
@keyframes iqRise { from { transform: translateY(45%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes iqDraw { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes iqWipeWord { from { width: 0; opacity: 0; } to { width: var(--iq-word-w, 118px); opacity: 1; } }
@keyframes iqWipeTag  { from { width: 0; opacity: 0; } to { width: var(--iq-tag-w, 120px); opacity: 1; } }

/* Pin the ivyquiz header so the collapse is visible on scroll. */
html[data-brand="ivyquiz"] .header-container { position: sticky; top: 0; }
html[data-brand="ivyquiz"] .header-container.is-stuck { box-shadow: 0 6px 16px rgba(34,36,46,.07); }

@media (prefers-reduced-motion: reduce) {
    .iq-logo__word-wrap, .iq-logo__tag-wrap, .iq-logo__stack,
    .iq-logo__glyph, .iq-logo__mark, .iq-logo__tile { transition: none; }
    .iq-logo--intro .iq-logo__tile, .iq-logo--intro .iq-logo__glyph,
    .iq-logo--intro .iq-logo__rule, .iq-logo--intro .iq-logo__word-wrap,
    .iq-logo--intro .iq-logo__tag-wrap { animation: none; }
}

/* =========================================================================
   Result charts — brand-aware accent
   -------------------------------------------------------------------------
   The enneagram/big5 result partials paint their progress ring
   (conic-gradient) and radar chart directly, so the [data-brand] utility
   overrides above cannot reach them. They read --chart-accent instead, which
   DEFAULTS to the blue they were already hardcoding — every .org domain is
   unchanged, and only a brand that sets the token gets its own hue.
   --chart-accent-rgb is the same colour as an "r, g, b" triple, for the
   Chart.js datasets that need alpha variants. Keep the two in sync.
   ========================================================================= */
:root { --chart-accent: #3b82f6; --chart-accent-rgb: 59, 130, 246; }

/* =========================================================================
   Dashboard (portal_base) — brand alignment
   -------------------------------------------------------------------------
   The dashboard predates the brand layer and hardcodes a generic indigo/purple
   hero gradient and a near-black primary button. Scoped to non-default brands,
   so the .org dashboard keeps the look it has today.
   ========================================================================= */
html:not([data-brand="default"]) .dash-hero {
    background-image: linear-gradient(to right, var(--brand), var(--brand-hover)) !important;
}
html:not([data-brand="default"]) .dash-cta { background-color: var(--brand) !important; }
html:not([data-brand="default"]) .dash-cta:hover { background-color: var(--brand-hover) !important; }
