/* =========================================================
   EVHUB DESIGN TOKENS
   Single source of truth for color and type, loaded before
   account.css and lcd.css. Change a color here, not in the
   page stylesheets.

   Contrast (WCAG 2.1, on white unless noted):
     --ev-brand   #1D4ED8  6.7:1   labels, links, highlights
     --ev-accent  #2563EB  5.2:1   primary buttons (white text)
     --ev-ink     #1A1D23 16.6:1   body text
     --ev-muted   #5F6672  5.9:1   secondary text (5.3:1 on faded white)
   ========================================================= */

/* Fonts are stored with the app, so the Pi's LCD works without internet.
   Chakra Petch: titles, numbers, port stickers and buttons (tech, cut corners).
   Saira: everything else (readable text in the same squared family feel).
   Both are SIL Open Font License fonts from Google Fonts. */
@font-face{
    font-family:"Chakra Petch";
    src:url("fonts/chakrapetch-500-latin.woff2") format("woff2");
    font-weight:500;font-style:normal;font-display:swap;
}
@font-face{
    font-family:"Chakra Petch";
    src:url("fonts/chakrapetch-600-latin.woff2") format("woff2");
    font-weight:600;font-style:normal;font-display:swap;
}
@font-face{
    font-family:"Chakra Petch";
    src:url("fonts/chakrapetch-700-latin.woff2") format("woff2");
    font-weight:700 900;font-style:normal;font-display:swap;
}
@font-face{
    font-family:"Saira";
    src:url("fonts/saira-400-700-latin.woff2") format("woff2");
    font-weight:400 700;font-style:normal;font-display:swap;
}

:root{
    /* Brand */
    --ev-brand:#1D4ED8;          /* EVHUB blue: labels, links, highlights */
    --ev-brand-hover:#1E3A8A;
    --ev-brand-soft:#E8EEFC;
    --ev-brand-rgb:29,78,216;

    /* Action (primary buttons, active nav) */
    --ev-accent:#2563EB;         /* blue: main buttons, white text 5.2:1 */
    --ev-accent-hover:#1D4ED8;
    --ev-accent-bright:#3B82F6;  /* decoration only: bars, icons, never text */
    --ev-accent-soft:#EEF1F5;    /* faded white */
    --ev-accent-rgb:37,99,235;

    /* Night: top bars and tab bar */
    --ev-night:#0E0F12;
    --ev-night-2:#1B1E24;

    /* Neutrals */
    --ev-ink:#1A1D23;
    --ev-ink-strong:#0E0F12;
    --ev-muted:#5F6672;
    --ev-line:#E1E5EB;
    --ev-surface:#FFFFFF;
    --ev-surface-warm:#F7F8FA;
    --ev-page:#EEF1F5;

    /* Feedback */
    --ev-danger:#B42318;
    --ev-danger-soft:#FDECEA;

    /* Port identity: same colours as the stickers on the station hardware.
       --ev-port-N fills a sticker-style label (white text);
       --ev-port-N-ink is the text-safe shade for text on white. */
    --ev-port-1:#0F766E;   --ev-port-1-ink:#0F766E;   --ev-port-1-soft:#E3F2F0;   /* teal,   48 V  */
    --ev-port-2:#4E7A27;   --ev-port-2-ink:#45691F;   --ev-port-2-soft:#ECF2E4;   /* green,  51.2 V */
    --ev-port-3:#D9800B;   --ev-port-3-ink:#A85F00;   --ev-port-3-soft:#FCF1E2;   /* orange, 60 V  */

    /* Charging status: one meaning per color, used on LCD, portal and admin */
    /* Charging (ring, ● CHARGING word, charging port panel). Kept apart from the
       port sticker colours, which are fixed on the hardware. */
    --ev-charging:#15803D;   /* vivid green: kept apart from Port 2's olive sticker */
    --ev-status-complete:#15803D;      --ev-status-complete-bg:#E3F1E4;
    --ev-status-charging:#1D4ED8;      --ev-status-charging-bg:#E8EEFC;
    --ev-status-attention:#92400E;     --ev-status-attention-bg:#FEF3C7;
    --ev-status-stopped:#4B5160;       --ev-status-stopped-bg:#EEF0F2;
    --ev-status-error:#B42318;         --ev-status-error-bg:#FDECEA;

    /* Type */
    --ev-font-display:"Chakra Petch","Segoe UI",Arial,sans-serif;
    --ev-font-body:"Saira","Segoe UI",Arial,sans-serif;
}

/* Shared status: a coloured word with a dot (no filled badge).
   Green = charging/available/done, red = a problem, grey = everything else.
   Set data-status to the session or port status. */
.ev-status{
    display:inline-flex;align-items:center;gap:6px;
    font:700 12px/1.4 var(--ev-font-body);letter-spacing:.06em;text-transform:uppercase;
    color:var(--ev-muted);white-space:nowrap;
}
.ev-status::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor;flex:none}
.ev-status[data-status="COMPLETE"],.ev-status[data-status="AVAILABLE"],.ev-status[data-status="READY"],
.ev-status[data-status="FINISHED"],
.ev-status[data-status="REGISTERED"],.ev-status[data-status="VERIFIED"]{color:var(--ev-status-complete)}
.ev-status[data-status="CHARGING"],.ev-status[data-status="ACTIVE"]{color:var(--ev-charging)}
.ev-status[data-status="DISCONNECTED"],.ev-status[data-status="ERROR"],.ev-status[data-status="FAULT"],
.ev-status[data-status="CONTROLLER_OFFLINE"],.ev-status[data-status="WRONG_PORT"],.ev-status[data-status="WRONG_BATTERY"]{color:var(--ev-status-error)}

/* Port label: a copy of the coloured sticker on the station hardware.
   <span class="ev-port-tag" data-port="1">PORT 1 – 48V</span> */
.ev-port-tag{
    display:inline-flex;align-items:center;
    padding:2px 10px;border-radius:6px;
    font:700 13px/1.4 var(--ev-font-display);letter-spacing:.02em;white-space:nowrap;
    color:#fff;background:var(--ev-muted);
}
.ev-port-tag[data-port="1"]{background:var(--ev-port-1)}
.ev-port-tag[data-port="2"]{background:var(--ev-port-2)}
.ev-port-tag[data-port="3"]{background:var(--ev-port-3)}

/* Type scale. Portal: nothing below 12px. LCD: nothing below 16px. */
:root{
    --ev-text-xs:12px;   /* labels, badges */
    --ev-text-sm:14px;   /* secondary text */
    --ev-text-md:16px;   /* body */
    --ev-text-lg:20px;   /* card titles */
    --ev-text-xl:24px;   /* page titles */
    --ev-text-2xl:32px;  /* hero, LCD headings */
    --ev-weight-regular:400;
    --ev-weight-semibold:600;
    --ev-weight-bold:700;

    /* Spacing: the only gaps used on the LCD, portal and admin.
       4 lines inside one item · 8 label to its text · 16 between items
       24 between sections / panel padding · 32 large separations */
    --ev-s1:4px;--ev-s2:8px;--ev-s3:16px;--ev-s4:24px;--ev-s5:32px;
}

/* Shared icon set (static/shared/icons.svg) */
.ev-icon{width:1em;height:1em;fill:currentColor;flex:none;display:inline-block;vertical-align:middle}
