/* Copyright 2026 Akamai Technologies, Inc. */
/* Licensed under the Apache License, Version 2.0 */

/* Risk Flex Group portal — design tokens + layout (single CSS file). */

:root {
    /* Color — brand (teal) */
    --color-brand-50:  oklch(96% 0.020 175);
    --color-brand-100: oklch(92% 0.040 175);
    --color-brand-300: oklch(78% 0.110 175);
    --color-brand-500: oklch(62% 0.135 175);
    --color-brand-600: oklch(54% 0.130 175);
    --color-brand-700: oklch(48% 0.120 175);   /* primary */
    --color-brand-800: oklch(42% 0.105 175);
    --color-brand-900: oklch(34% 0.085 175);

    /* Color — neutral (slate, tinted toward teal) */
    --color-slate-50:  oklch(98.0% 0.005 200);
    --color-slate-100: oklch(96.0% 0.007 200);
    --color-slate-200: oklch(92.0% 0.010 215);
    --color-slate-300: oklch(85.0% 0.014 215);
    --color-slate-400: oklch(70.0% 0.018 215);
    --color-slate-500: oklch(58.0% 0.020 220);
    --color-slate-600: oklch(48.0% 0.022 225);
    --color-slate-700: oklch(38.0% 0.022 230);
    --color-slate-800: oklch(28.0% 0.022 230);
    --color-slate-900: oklch(20.0% 0.020 230);

    /* Semantic — surface */
    --color-bg:           var(--color-slate-50);
    --color-surface:      oklch(99.5% 0.003 200);
    --color-surface-alt:  var(--color-slate-100);
    --color-border:       var(--color-slate-200);
    --color-border-strong:var(--color-slate-300);

    /* Semantic — text */
    --color-text:         var(--color-slate-900);
    --color-text-muted:   var(--color-slate-600);
    --color-text-subtle:  var(--color-slate-500);
    --color-text-on-dark: oklch(98% 0.005 175);

    /* Semantic — interactive */
    --color-primary:      var(--color-brand-700);
    --color-primary-hover:var(--color-brand-800);
    --color-primary-active:var(--color-brand-900);
    --color-primary-fg:   oklch(99% 0.003 175);

    /* Semantic — feedback */
    --color-success:    oklch(58% 0.15 145);
    --color-success-bg: oklch(95% 0.04 145);
    --color-success-bd: oklch(80% 0.10 145);
    --color-error:      oklch(55% 0.22 27);
    --color-error-bg:   oklch(95% 0.04 27);
    --color-error-bd:   oklch(80% 0.12 27);
    --color-warn-bg:    oklch(96% 0.05 80);
    --color-warn-bd:    oklch(80% 0.13 80);
    --color-warn-text:  oklch(36% 0.10 70);

    /* Akamai brand orange — used by the footer demo attribution banner. */
    --color-akamai:        #F47C00;
    --color-akamai-hover:  #FF9933;
    --color-info-bg:    oklch(95% 0.04 230);
    --color-info-bd:    oklch(80% 0.10 230);

    /* Focus */
    --color-focus:      var(--color-brand-700);
    --shadow-focus:     0 0 0 3px oklch(62% 0.135 175 / 0.30);

    /* Spacing — 4pt scale */
    --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
    --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10:40px;
    --space-12:48px; --space-16:64px; --space-20:80px; --space-24:96px;

    /* Type — system stack only (per project constraint) */
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Type — modular scale, ratio 1.333 (perfect fourth) */
    --text-xs:   0.75rem;
    --text-sm:   0.875rem;
    --text-base: 1rem;
    --text-md:   1.125rem;
    --text-lg:   1.333rem;
    --text-xl:   1.777rem;
    --text-2xl:  2.369rem;
    --text-3xl:  3.157rem;
    --text-4xl:  4.209rem;

    --leading-tight:  1.15;
    --leading-snug:   1.35;
    --leading-normal: 1.55;
    --leading-relaxed:1.65;

    --tracking-tight: -0.02em;
    --tracking-normal: 0;
    --tracking-wide:  0.04em;

    /* Radius */
    --radius-sm:  4px;
    --radius-md:  8px;
    --radius-lg:  12px;
    --radius-xl:  20px;
    --radius-pill:999px;

    /* Elevation */
    --shadow-xs: 0 1px 2px oklch(20% 0.020 230 / 0.05);
    --shadow-sm: 0 1px 3px oklch(20% 0.020 230 / 0.08), 0 1px 2px oklch(20% 0.020 230 / 0.04);
    --shadow-md: 0 4px 12px oklch(20% 0.020 230 / 0.08), 0 2px 4px oklch(20% 0.020 230 / 0.04);
    --shadow-lg: 0 12px 28px oklch(20% 0.020 230 / 0.10), 0 4px 8px oklch(20% 0.020 230 / 0.04);

    /* Motion */
    --ease-out:    cubic-bezier(.2, .7, .3, 1);
    --ease-out-fast: cubic-bezier(.2, .8, .2, 1);
    --duration-fast: 120ms;
    --duration-base: 200ms;
    --duration-slow: 320ms;

    /* Layout */
    --container-narrow: 640px;
    --container-base:   1024px;
    --container-wide:   1200px;
    --header-height:    64px;
}

/* ------- Reset / base ------- */

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: var(--leading-normal);
    font-size: var(--text-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--color-text);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
    font-weight: 600;
    color: var(--color-slate-900);
    letter-spacing: var(--tracking-tight);
    line-height: var(--leading-tight);
    margin: 0;
}
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-md); }

p { margin: 0; }
.prose p { max-width: 70ch; }

:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ------- Header ------- */

.site-header {
    background: var(--color-slate-900);
    color: var(--color-text-on-dark);
    border-bottom: 1px solid var(--color-slate-800);
    position: relative;
}
.site-header::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: var(--color-primary);
}
.site-header .nav {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: var(--space-3) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: var(--header-height);
    flex-wrap: nowrap;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--color-text-on-dark);
    text-decoration: none;
    flex: 0 0 auto;
    min-width: 0;
}
.brand:hover { text-decoration: none; }
.brand .logo { width: 36px; height: 36px; flex-shrink: 0; }
.brand-stack {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.brand-name {
    font-weight: 600;
    letter-spacing: var(--tracking-tight);
    font-size: var(--text-md);
    line-height: 1.1;
    white-space: nowrap;
}
.brand-tag {
    color: var(--color-slate-400);
    font-size: var(--text-xs);
    line-height: 1.1;
    display: none;
    white-space: nowrap;
}
@media (min-width: 640px) {
    .brand-tag { display: inline; }
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex: 0 0 auto;
}
.nav-links a, .nav-links button.linklike {
    color: var(--color-text-on-dark);
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-2);
    font-family: inherit;
}
.nav-links a:hover, .nav-links button.linklike:hover {
    color: var(--color-brand-300);
    text-decoration: none;
}
.nav-links .nav-cta {
    background: var(--color-primary);
    color: var(--color-primary-fg);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-pill);
    font-weight: 600;
}
.nav-links .nav-cta:hover {
    background: var(--color-primary-hover);
    color: var(--color-primary-fg);
}

.user-pill {
    background: oklch(28% 0.022 230 / 0.6);
    border: 1px solid oklch(38% 0.022 230);
    color: var(--color-text-on-dark);
    border-radius: var(--radius-pill);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
}

/* Collapsing menu under 640px */
.nav-extras {
    display: none;
}
@media (min-width: 640px) {
    .nav-extras {
        display: inline-flex;
        gap: var(--space-3);
        align-items: center;
    }
}
.nav-mobile {
    position: relative;
}
.nav-mobile > summary {
    list-style: none;
    cursor: pointer;
    padding: var(--space-2);
    color: var(--color-text-on-dark);
    font-size: var(--text-sm);
    border-radius: var(--radius-sm);
}
.nav-mobile > summary::-webkit-details-marker { display: none; }
.nav-mobile[open] > summary { color: var(--color-brand-300); }
.nav-mobile-panel {
    position: absolute;
    right: 0;
    top: calc(100% + var(--space-2));
    background: var(--color-slate-900);
    border: 1px solid var(--color-slate-800);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    box-shadow: var(--shadow-md);
    z-index: 20;
}
.nav-mobile-panel a, .nav-mobile-panel button.linklike {
    color: var(--color-text-on-dark);
    text-align: left;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
}
.nav-mobile-panel a:hover, .nav-mobile-panel button.linklike:hover {
    background: var(--color-slate-800);
    color: var(--color-brand-300);
    text-decoration: none;
}
@media (min-width: 640px) {
    .nav-mobile { display: none; }
}

/* ------- Footer ------- */

.site-footer {
    background: var(--color-slate-900);
    color: var(--color-slate-300);
    margin-top: var(--space-20);
    font-size: var(--text-sm);
}
.site-footer .footer-inner {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: var(--space-12) var(--space-6) var(--space-6);
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
}
@media (min-width: 640px) {
    .site-footer .footer-inner {
        grid-template-columns: 1.4fr 1fr 1fr;
        gap: var(--space-10);
    }
}
.site-footer h4 {
    color: var(--color-text-on-dark);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    margin: 0 0 var(--space-3);
    font-weight: 600;
}
.site-footer .footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    color: var(--color-text-on-dark);
}
.site-footer .footer-brand .logo { width: 32px; height: 32px; }
.site-footer .footer-brand .brand-name { font-size: var(--text-md); }
.site-footer .footer-tag {
    color: var(--color-slate-400);
    margin-bottom: var(--space-3);
}
.site-footer ul {
    list-style: none;
    padding: 0; margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.site-footer ul a {
    color: var(--color-slate-300);
    font-size: var(--text-sm);
}
.site-footer ul a:hover { color: var(--color-brand-300); text-decoration: none; }
.site-footer .footer-bottom {
    border-top: 1px solid var(--color-slate-800);
    padding: var(--space-4) var(--space-6);
    text-align: center;
    color: var(--color-slate-400);
    font-size: var(--text-xs);
}

/* Akamai API Security demo attribution — shown in the footer of every page.
 * Single sentence, inline link. Calm slate-700 hairline above so the orange
 * link is the only attention-grabbing element. */
.site-footer .demo-attribution {
    background: var(--color-slate-800);
    border-top: 1px solid var(--color-slate-700);
    color: var(--color-slate-200);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
}
.site-footer .demo-attribution-inner {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: var(--space-3) var(--space-6);
}
.site-footer .demo-attribution-text {
    margin: 0;
}
.site-footer .demo-attribution-text strong {
    color: var(--color-text-on-dark);
    font-weight: 600;
}
.site-footer .demo-attribution-link {
    color: var(--color-akamai-hover, #FF9933);
    font-weight: 600;
    text-decoration: none;
    margin-left: var(--space-1);
    white-space: nowrap;
}
.site-footer .demo-attribution-link:hover {
    text-decoration: underline;
}
.site-footer .demo-attribution-link:focus-visible {
    outline: 2px solid var(--color-akamai-hover, #FF9933);
    outline-offset: 2px;
    border-radius: 2px;
}
.site-footer .footer-contact {
    color: var(--color-slate-300);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
}
.site-footer .footer-contact a {
    color: var(--color-slate-300);
}

/* ------- Layout containers ------- */

.container {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
}
.narrow {
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
}
@media (min-width: 960px) {
    .container { padding: var(--space-12) var(--space-6); }
    .narrow { padding: var(--space-12) var(--space-6); }
}

/* ------- Hero ------- */

.hero {
    background:
        radial-gradient(ellipse at 70% 30%, oklch(48% 0.120 175 / 0.55) 0%, transparent 60%),
        linear-gradient(155deg, var(--color-slate-900) 0%, var(--color-slate-800) 60%, var(--color-brand-900) 100%);
    color: var(--color-text-on-dark);
    padding: var(--space-16) var(--space-6) var(--space-20);
}
.hero-inner {
    max-width: var(--container-base);
    margin: 0 auto;
    text-align: center;
}
.hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    font-weight: 600;
    color: var(--color-text-on-dark);
    font-size: var(--text-sm);
    opacity: 0.85;
    margin: 0 0 var(--space-3);
}
.hero h1 {
    font-size: clamp(var(--text-2xl), 2vw + 1.5rem, var(--text-4xl));
    color: var(--color-text-on-dark);
    margin: 0 0 var(--space-5);
    letter-spacing: var(--tracking-tight);
    line-height: var(--leading-tight);
}
.hero p.lead {
    font-size: var(--text-md);
    max-width: 60ch;
    margin: 0 auto var(--space-8);
    color: var(--color-slate-300);
    line-height: var(--leading-relaxed);
}
.hero-cta {
    display: inline-flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    justify-content: center;
}

/* ------- Buttons ------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--text-base);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: background-color var(--duration-fast) var(--ease-out),
                color var(--duration-fast) var(--ease-out),
                transform var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

.btn-primary, .btn--primary {
    background: var(--color-primary);
    color: var(--color-primary-fg);
}
.btn-primary:hover, .btn--primary:hover {
    background: var(--color-primary-hover);
    color: var(--color-primary-fg);
}
.btn-primary:active, .btn--primary:active {
    background: var(--color-primary-active);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-slate-900);
    border-color: var(--color-surface);
}
.btn-secondary:hover {
    background: var(--color-slate-100);
    color: var(--color-slate-900);
}

.btn-ghost {
    background: transparent;
    color: var(--color-slate-700);
    border-color: var(--color-border-strong);
}
.btn-ghost:hover {
    background: var(--color-surface-alt);
    color: var(--color-slate-900);
}

.btn-block { display: flex; width: 100%; text-align: center; }

/* ------- Section headings ------- */

.section-title {
    text-align: center;
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--color-slate-900);
    margin: 0 0 var(--space-2);
    letter-spacing: var(--tracking-tight);
}
.section-sub {
    text-align: center;
    color: var(--color-text-muted);
    margin: 0 auto var(--space-10);
    max-width: 60ch;
    font-size: var(--text-base);
}

/* ------- LOB tile grid ------- */

.lob-grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: 1fr;
}
@media (min-width: 640px) {
    .lob-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-5); }
}
@media (min-width: 960px) {
    .lob-grid { grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
}
@media (min-width: 1200px) {
    .lob-grid { grid-template-columns: repeat(4, 1fr); }
}
/* On 4-col layouts, dashboard's 7th tile becomes a centred orphan row.
   We accept the orphan and leave it left-aligned in the row — cleaner
   than special-casing per page. */

.lob-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-xs);
    text-decoration: none;
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    transition: transform var(--duration-base) var(--ease-out),
                box-shadow var(--duration-base) var(--ease-out),
                border-color var(--duration-base) var(--ease-out);
}
.lob-card:hover {
    transform: translateY(-2px);
    border-color: var(--color-border-strong);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}
.lob-card .lob-icon {
    color: var(--color-slate-700);
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color var(--duration-base) var(--ease-out);
}
.lob-card:hover .lob-icon,
.lob-card:focus-within .lob-icon {
    color: var(--color-primary);
}
.lob-card h3 {
    margin: var(--space-1) 0 0;
    color: var(--color-slate-900);
    font-size: var(--text-md);
    letter-spacing: var(--tracking-tight);
}
.lob-card p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    line-height: var(--leading-snug);
}
.lob-card .lob-cta {
    margin-top: var(--space-2);
    color: var(--color-primary);
    font-weight: 600;
    font-size: var(--text-sm);
}

/* ------- Cards / panels ------- */

.panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow-sm);
    container-type: inline-size;
}
.panel h2 {
    color: var(--color-slate-900);
    margin: 0 0 var(--space-1);
    font-size: var(--text-lg);
}
.panel .lede {
    color: var(--color-text-muted);
    margin: 0 0 var(--space-6);
    font-size: var(--text-sm);
}

/* ------- Forms ------- */

form fieldset {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5) var(--space-5);
    margin: 0 0 var(--space-5);
}
form legend {
    color: var(--color-slate-900);
    font-weight: 600;
    padding: 0 var(--space-2);
    font-size: var(--text-sm);
    letter-spacing: var(--tracking-tight);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}
@container (min-width: 540px) {
    .form-row { grid-template-columns: repeat(2, 1fr); }
}
.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    margin-bottom: var(--space-3);
}
.form-field label {
    font-weight: 500;
    color: var(--color-slate-800);
    font-size: var(--text-sm);
}
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"],
.form-field input[type="number"],
.form-field select {
    width: 100%;
    padding: var(--space-3) var(--space-3);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-strong);
    background: var(--color-surface);
    font-size: var(--text-base);
    font-family: inherit;
    color: var(--color-text);
    transition: border-color var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
}
.form-field input::placeholder {
    color: var(--color-text-subtle);
}
.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}
.form-field input[aria-invalid="true"],
.form-field select[aria-invalid="true"] {
    border-color: var(--color-error);
}
.form-field .field-error {
    color: var(--color-error);
    font-size: var(--text-xs);
    margin-top: 2px;
}
.form-field .check {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 500;
    color: var(--color-text);
}
.form-field .check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}
.help {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}
.form-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-2);
    flex-wrap: wrap;
}

/* ------- Alerts ------- */

.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    margin: 0 0 var(--space-4);
    font-size: var(--text-sm);
    border: 1px solid transparent;
}
.alert-error {
    background: var(--color-error-bg);
    color: var(--color-error);
    border-color: var(--color-error-bd);
}
.alert-info {
    background: var(--color-info-bg);
    color: var(--color-slate-800);
    border-color: var(--color-info-bd);
}
.alert-success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border-color: var(--color-success-bd);
}

/* ------- Result page ------- */

.premium-display {
    text-align: center;
    padding: var(--space-8) var(--space-5);
    background: linear-gradient(155deg, var(--color-slate-900) 0%, var(--color-brand-800) 100%);
    color: var(--color-text-on-dark);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.premium-display.is-pulse { animation: rfg-pulse 200ms var(--ease-out) 1; }
@keyframes rfg-pulse {
    0%   { box-shadow: var(--shadow-sm); }
    50%  { box-shadow: 0 0 0 6px oklch(62% 0.135 175 / 0.20), var(--shadow-md); }
    100% { box-shadow: var(--shadow-sm); }
}
.premium-display .label {
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    font-size: var(--text-xs);
    color: var(--color-slate-300);
    margin: 0;
    font-weight: 600;
}
.premium-display .amount-row {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: var(--space-2) 0 0;
    justify-content: center;
}
.premium-display .amount {
    font-size: var(--text-3xl);
    font-weight: 600;
    margin: 0;
    letter-spacing: var(--tracking-tight);
    font-variant-numeric: tabular-nums;
    line-height: 1.0;
}
.premium-display .amount-suffix {
    color: var(--color-slate-300);
    font-size: var(--text-md);
    font-weight: 500;
}
.premium-display .check-tick {
    color: var(--color-brand-300);
    width: 14px;
    height: 14px;
    opacity: 0;
    transition: opacity var(--duration-base) var(--ease-out);
}
.premium-display .check-tick.is-visible { opacity: 1; }
.premium-display .lob-tag {
    display: inline-block;
    margin-top: var(--space-3);
    background: var(--color-primary);
    color: var(--color-primary-fg);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    font-weight: 600;
}

/* Period toggle (annual / monthly) */
.period-toggle {
    display: inline-flex;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    padding: 3px;
    margin: var(--space-4) auto 0;
    gap: 0;
}
.period-toggle button {
    border: none;
    background: transparent;
    padding: var(--space-2) var(--space-4);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background-color var(--duration-fast) var(--ease-out),
                color var(--duration-fast) var(--ease-out);
}
.period-toggle button[aria-pressed="true"] {
    background: var(--color-surface);
    color: var(--color-slate-900);
    box-shadow: var(--shadow-xs);
}
.result-reason {
    text-align: center;
    color: var(--color-text-muted);
    margin: var(--space-4) auto 0;
    max-width: 50ch;
    font-size: var(--text-sm);
}

table.breakdown {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--space-3);
}
table.breakdown th, table.breakdown td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--text-sm);
}
table.breakdown th {
    background: var(--color-surface-alt);
    color: var(--color-slate-700);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    font-weight: 600;
}
table.breakdown td.amount {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}
table.breakdown tr.total td {
    border-top: 2px solid var(--color-slate-800);
    border-bottom: none;
    font-weight: 600;
    color: var(--color-slate-900);
    font-size: var(--text-base);
}
table.breakdown tr.discount td.amount {
    color: var(--color-success);
}

/* ------- Page title ------- */

.page-title {
    color: var(--color-slate-900);
    font-size: var(--text-xl);
    font-weight: 600;
    margin: 0 0 var(--space-1);
    letter-spacing: var(--tracking-tight);
}
.page-sub {
    color: var(--color-text-muted);
    margin: 0 0 var(--space-6);
    font-size: var(--text-base);
}

/* ------- Demo creds box (hidden by default — Wave B) ------- */

.demo-creds {
    background: var(--color-warn-bg);
    border: 1px solid var(--color-warn-bd);
    color: var(--color-warn-text);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    margin: var(--space-4) 0;
    display: none;
}
html.show-demo .demo-creds { display: block; }
.demo-creds code {
    background: oklch(20% 0.020 230 / 0.06);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.95em;
}

/* ------- Trust strip (Wave D) ------- */

.trust-strip {
    border-block: 1px solid var(--color-border);
    color: var(--color-slate-600);
    font-size: var(--text-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-5) var(--space-6);
    text-align: center;
    max-width: var(--container-wide);
    margin: 0 auto;
}
.trust-strip > div {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-weight: 500;
}
@media (min-width: 640px) {
    .trust-strip {
        flex-direction: row;
        justify-content: space-around;
        gap: var(--space-6);
    }
}

/* ------- Testimonials ------- */

.testimonials {
    display: grid;
    gap: var(--space-5);
    grid-template-columns: 1fr;
    margin-top: var(--space-6);
}
@media (min-width: 640px) {
    .testimonials { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
    .testimonials { grid-template-columns: repeat(3, 1fr); }
}
.testimonial {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.testimonial .stars {
    color: var(--color-brand-700);
    display: inline-flex;
    gap: 2px;
}
.testimonial .stars svg { width: 16px; height: 16px; }
.testimonial blockquote {
    margin: 0;
    color: var(--color-slate-900);
    font-size: var(--text-md);
    line-height: var(--leading-snug);
    letter-spacing: var(--tracking-tight);
}
.testimonial .attribution {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: auto;
}
.testimonial .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-brand-100);
    color: var(--color-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--text-sm);
    flex-shrink: 0;
}
.testimonial .meta {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    line-height: 1.3;
}
.testimonial .meta strong {
    color: var(--color-slate-800);
    font-weight: 600;
    font-size: var(--text-sm);
    display: block;
}

/* ------- Why RFG strip ------- */

.why-rfg {
    display: grid;
    gap: var(--space-6);
    grid-template-columns: 1fr;
    margin-top: var(--space-10);
}
@media (min-width: 640px) {
    .why-rfg { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
    .why-rfg { grid-template-columns: repeat(3, 1fr); }
}
.why-rfg .pitch {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4) 0;
}
.why-rfg .pitch svg {
    width: 28px;
    height: 28px;
    color: var(--color-slate-700);
}
.why-rfg .pitch h3 {
    color: var(--color-slate-900);
    font-size: var(--text-md);
    margin: 0;
}
.why-rfg .pitch p {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    margin: 0;
    line-height: var(--leading-relaxed);
    max-width: 40ch;
}

/* ------- Login security note ------- */

.security-note {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    margin: var(--space-4) 0 0;
}
.security-note svg { width: 14px; height: 14px; }
.login-helper-links {
    display: inline-flex;
    gap: var(--space-4);
    margin-top: var(--space-4);
}
.login-helper-links a {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}
.login-helper-links a:hover { color: var(--color-primary); }

/* ------- Login tabs (Wave E) ------- */

.login-tablist {
    display: inline-flex;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-6);
    gap: var(--space-2);
}
.login-tablist [role="tab"] {
    border: none;
    background: transparent;
    padding: var(--space-2) var(--space-4);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color var(--duration-fast) var(--ease-out),
                border-color var(--duration-fast) var(--ease-out);
}
.login-tablist [role="tab"][aria-selected="true"] {
    color: var(--color-slate-900);
    border-bottom-color: var(--color-primary);
}
.login-tablist [role="tab"]:hover {
    color: var(--color-slate-900);
}

/* ------- Calculating overlay (Wave C) ------- */

.calc-overlay {
    position: fixed;
    inset: 0;
    background: oklch(98% 0.005 200 / 0.94);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-base) var(--ease-out);
}
.calc-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}
.calc-overlay .calc-inner {
    text-align: center;
    max-width: 420px;
    padding: var(--space-6);
}
.calc-overlay .calc-spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    margin: 0 auto var(--space-5);
    animation: rfg-spin 800ms linear infinite;
}
@keyframes rfg-spin {
    to { transform: rotate(360deg); }
}
.calc-overlay .calc-step {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--duration-slow) var(--ease-out),
                opacity var(--duration-slow) var(--ease-out);
    opacity: 0;
}
.calc-overlay .calc-step.is-visible {
    grid-template-rows: 1fr;
    opacity: 1;
}
.calc-overlay .calc-step > span {
    overflow: hidden;
    color: var(--color-slate-700);
    font-size: var(--text-md);
    padding: var(--space-1) 0;
    line-height: var(--leading-snug);
}

/* ------- Empty state ------- */

.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}
.empty-state h2 {
    margin: 0 0 var(--space-2);
    color: var(--color-slate-900);
}
.empty-state p {
    color: var(--color-text-muted);
    margin: 0 0 var(--space-5);
    max-width: 50ch;
    margin-inline: auto;
}

/* ------- Sticky CTA (Wave F) ------- */

.sticky-cta {
    position: fixed;
    right: var(--space-6);
    bottom: var(--space-6);
    z-index: 30;
    background: var(--color-primary);
    color: var(--color-primary-fg);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: var(--text-sm);
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-base) var(--ease-out),
                transform var(--duration-base) var(--ease-out);
    transform: translateY(8px);
    text-decoration: none;
}
.sticky-cta.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.sticky-cta:hover {
    background: var(--color-primary-hover);
    color: var(--color-primary-fg);
    text-decoration: none;
}

/* ------- Utility ------- */

.text-center { text-align: center; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.hidden { display: none !important; }

/* ── Quote list (M11) ── */

.quotes-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    align-items: end;
    margin-bottom: var(--space-6);
}
.quotes-header-titles { min-width: 0; }
.quotes-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}
@media (min-width: 640px) {
    .quotes-header {
        grid-template-columns: 1fr auto;
        gap: var(--space-6);
    }
    .quotes-header-actions { justify-content: flex-end; }
}
.quotes-sort {
    display: inline-flex;
    align-items: center;
}
.quotes-sort select {
    appearance: auto;
    border: 1px solid var(--color-border-strong);
    background: var(--color-surface);
    color: var(--color-text);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-3);
    cursor: pointer;
}
.quotes-sort select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}
[aria-current="page"] {
    color: var(--color-brand-300);
}

.quote-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.quote-row {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: border-color var(--duration-base) var(--ease-out),
                box-shadow var(--duration-base) var(--ease-out),
                transform var(--duration-base) var(--ease-out);
}
.quote-row:hover {
    border-color: var(--color-border-strong);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}
.quote-row-link {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-lg);
}
.quote-row-link:hover { text-decoration: none; color: var(--color-text); }
.quote-row-link:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}
.quote-row-icon {
    color: var(--color-slate-700);
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.quote-row-icon svg { width: 100%; height: 100%; }
.quote-row:hover .quote-row-icon,
.quote-row:focus-within .quote-row-icon {
    color: var(--color-primary);
}
.quote-row-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.quote-row-title {
    font-weight: 600;
    color: var(--color-slate-900);
    font-size: var(--text-md);
    letter-spacing: var(--tracking-tight);
    line-height: 1.2;
}
.quote-row-meta {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    line-height: var(--leading-snug);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.quote-row-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-align: right;
}
.quote-row-price {
    font-weight: 600;
    color: var(--color-slate-900);
    font-size: var(--text-base);
    font-variant-numeric: tabular-nums;
}
.quote-row-period {
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: var(--text-xs);
    margin-left: 2px;
}
.quote-row-chevron {
    color: var(--color-text-subtle);
    font-size: var(--text-lg);
    line-height: 1;
    width: 16px;
    text-align: center;
}
.quote-row-action {
    color: var(--color-primary);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}
.quote-row--expired .quote-row-title,
.quote-row--expired .quote-row-price {
    color: var(--color-text-muted);
}

/* Skeleton state */
.quote-row.is-skeleton .quote-row-link {
    pointer-events: none;
}
.quote-row.is-skeleton .quote-row-icon,
.quote-row.is-skeleton .skel {
    background: var(--color-surface-alt);
    border-radius: var(--radius-sm);
    animation: rfg-quote-pulse 1.4s var(--ease-out) infinite;
    color: transparent;
}
.quote-row.is-skeleton .quote-row-icon { width: 24px; height: 24px; }
.quote-row.is-skeleton .skel-title { display: block; height: 14px; width: 80px; margin-bottom: 6px; }
.quote-row.is-skeleton .skel-meta  { display: block; height: 12px; width: 220px; max-width: 100%; }
.quote-row.is-skeleton .skel-price { display: block; height: 14px; width: 80px; margin-bottom: 6px; margin-left: auto; }
.quote-row.is-skeleton .skel-badge { display: block; height: 16px; width: 56px; border-radius: var(--radius-pill); margin-left: auto; }
@keyframes rfg-quote-pulse {
    0%   { opacity: 1.0; }
    50%  { opacity: 0.6; }
    100% { opacity: 1.0; }
}

/* First-paint stagger (≤6 rows). */
.quote-list[data-loaded] .quote-row {
    animation: rfg-row-fade var(--duration-base) var(--ease-out) both;
}
.quote-list[data-loaded] .quote-row:nth-child(1) { animation-delay: 0ms; }
.quote-list[data-loaded] .quote-row:nth-child(2) { animation-delay: 20ms; }
.quote-list[data-loaded] .quote-row:nth-child(3) { animation-delay: 40ms; }
.quote-list[data-loaded] .quote-row:nth-child(4) { animation-delay: 60ms; }
.quote-list[data-loaded] .quote-row:nth-child(5) { animation-delay: 80ms; }
.quote-list[data-loaded] .quote-row:nth-child(6) { animation-delay: 100ms; }
@keyframes rfg-row-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.quote-list-footer {
    display: flex;
    justify-content: center;
    margin-top: var(--space-5);
    font-size: var(--text-sm);
}
.quote-list-footer a {
    color: var(--color-primary);
    font-weight: 600;
}

/* Status badges (pill only — no left-stripe per design rules) */
.badge {
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    border-radius: var(--radius-pill);
    padding: 2px var(--space-2);
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
    line-height: 1.4;
}
.badge--active {
    background: var(--color-success-bg);
    color: var(--color-success);
    border-color: var(--color-success-bd);
}
.badge--warn {
    background: var(--color-warn-bg);
    color: var(--color-warn-text);
    border-color: var(--color-warn-bd);
}
.badge--muted {
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
    border-color: var(--color-border);
}

/* Block button helper used by "Load 10 more". */
.btn--block {
    display: flex;
    width: 100%;
    text-align: center;
    justify-content: center;
}
.btn--ghost {
    background: transparent;
    color: var(--color-slate-700);
    border-color: var(--color-border-strong);
}
.btn--ghost:hover {
    background: var(--color-surface-alt);
    color: var(--color-slate-900);
}

/* Compact dashboard "Recent quotes" section header */
.recent-quotes-heading {
    font-size: var(--text-md);
    color: var(--color-slate-900);
    margin: 0 0 var(--space-3);
    letter-spacing: var(--tracking-tight);
}
.recent-quotes-empty {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    margin: 0 0 var(--space-6);
}

/* Mobile: collapse the row to two columns; amount drops below.
   Chevron is suppressed on the narrowest phones. */
@media (max-width: 639px) {
    .quote-row-link {
        grid-template-columns: auto 1fr auto;
        grid-template-areas:
            "icon main chevron"
            "icon amount chevron";
        column-gap: var(--space-3);
        row-gap: var(--space-2);
        padding: var(--space-3) var(--space-4);
    }
    .quote-row-icon { grid-area: icon; align-self: start; }
    .quote-row-main { grid-area: main; }
    .quote-row-amount {
        grid-area: amount;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: var(--space-3);
        text-align: left;
    }
    .quote-row-chevron, .quote-row-action { grid-area: chevron; align-self: center; }
    .quote-row-meta { white-space: normal; }
}
@media (max-width: 559px) {
    .quote-row-link {
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "icon main"
            "icon amount";
    }
    .quote-row-chevron { display: none; }
    .quote-row-action {
        grid-area: amount;
        align-self: end;
        margin-left: auto;
    }
}

/* ------- Reduced motion ------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
