/*
 * Design tokens for the fiber brand graphic profile.
 * All component styling in ui.css reads from these variables — changing the
 * profile should only require edits in this file.
 *
 * Structure: the raw profile palette (--palette-*) first, then role tokens
 * that components use. Components never reference --palette-* directly.
 *
 * Verified contrast (WCAG 2.1):
 *   #ffffff on #021425 ≈ 18.6:1     #021425 on #fed9d9 ≈ 14.3:1
 *   #021425 on #e79c9c ≈  8.5:1     #021425 on #dcecff ≈ 15.5:1
 *   #021425 on #ededed ≈ 15.9:1     #51606e on #fed9d9/#ededed ≥ 5.0:1
 *   #6e7a86 (input border) on #ffffff ≈ 4.4:1
 *
 * Constraints from the palette:
 *  - The "Komp" colors and the greys are below 3:1 against white (1.4–2.2:1).
 *    Use them for fills, hover states and decorative borders only — never for
 *    input borders, focus rings or anything that must be perceived on its own.
 *  - Mörkblå and Mörkblå-Komp are ~1:1 against each other, so the primary
 *    button's hover is a derived lighter tint instead of the Komp color.
 *
 * Semantic colors (not from the profile, chosen here) — measured 2026-10-27 on
 * white / Ljusrosa / Ljusblå / grey-light / error-surface:
 *   --error   #b3223a  6.6 / 5.0 / 5.5 / 5.6 / 5.8:1   (text: AA on all)
 *   --success #1d7044  6.1 / 4.7 / 5.1 / 5.2 / 5.4:1   (text: AA on all)
 *   --warning #a05a00  5.3 / 4.1 / 4.4 / 4.5 / 4.7:1   (unused; text on white/grey
 *                                                       only — fails 4.5:1 on pink/blue)
 * Replacing one with a profile value: re-verify 4.5:1 text / 3:1 UI components.
 */

/* Poppins, self-hosted (SIL Open Font License, see ../fonts/OFL.txt).
   Latin subset — covers å, ä, ö and é. */
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 100;
    font-display: swap;
    src: url('../fonts/poppins-latin-100-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/poppins-latin-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/poppins-latin-600-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/poppins-latin-700-normal.woff2') format('woff2');
}

:root {
    /* Profile palette */
    --palette-pink: #fed9d9;          /* Ljusrosa */
    --palette-pink-komp: #e79c9c;     /* Ljusrosa-Komp */
    --palette-blue: #dcecff;          /* Ljusblå */
    --palette-blue-komp: #96b4d7;     /* Ljusblå-Komp */
    --palette-navy: #021425;          /* Mörkblå */
    --palette-navy-komp: #0c1420;     /* Mörkblå-Komp */
    --palette-grey-light: #ededed;
    --palette-grey: #dadada;

    /* Brand */
    --brand-primary: var(--palette-navy);
    --brand-primary-hover: color-mix(in srgb, var(--palette-navy) 82%, #ffffff);
    --brand-primary-active: var(--palette-navy-komp);
    --brand-on-primary: #ffffff;
    --brand-secondary: var(--palette-pink);
    --brand-secondary-hover: var(--palette-pink-komp);
    --brand-on-secondary: var(--palette-navy);
    --brand-tertiary: var(--palette-blue);
    --brand-tertiary-hover: var(--palette-blue-komp);
    --brand-on-tertiary: var(--palette-navy);

    /* Surfaces */
    --surface: #ffffff;
    --surface-alt: var(--palette-grey-light);
    --border: var(--palette-grey);            /* decorative only (<3:1 on white) */
    --border-strong: #6e7a86;                 /* input borders — 4.4:1 on white */

    /* Text */
    --text: var(--palette-navy);
    --text-muted: #51606e;
    --text-disabled: #8d99a5;

    /* Semantic */
    --success: #1d7044;
    --error: #b3223a;
    --error-surface: #fbeef0;
    --warning: #a05a00;
    --info: var(--palette-blue-komp);         /* used as decorative accent border */
    --info-surface: var(--palette-blue);

    /* Focus — must keep 3:1 contrast against adjacent colors */
    --focus-ring: var(--palette-navy);
    --focus-ring-width: 3px;
    --focus-ring-offset: 2px;

    /* Typography */
    --font-body: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-weight-thin: 100;       /* large display text only — too faint for body copy */
    --font-weight-regular: 400;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;

    /* Shape & spacing */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-pill: 999px;
    --radius-button: 8px;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
}
