/*
 * tokens.css
 *
 * Soft Float design tokens: neutrals, status colours, accent palettes,
 * radii, type scale and shadows. Every other stylesheet reads these.
 *
 * Accent palettes are selected with data-accent="…" on <html> (saved with the
 * other settings). The palette selectors are not tied to :root, so any element
 * can carry its own data-accent to preview a palette locally.
 */

:root {
    /* Neutrals */
    --ground: #ECEEF2;
    --surface: #FFFFFF;
    --surface-2: #F5F6F8;
    --control: #F1F3F6;
    --hover: #E6E9EE;
    --hairline: #EBEDF0;
    --track-off: #D7DAE0;
    --scrim: #C9CDD5;
    --ink: #14161B;
    --text-2: #3A3E47;
    --muted: #5E626C;
    --muted-on-ink: #B9BDC7;

    /* Status (never themed) */
    --success: #16A34A;
    --success-tint: #E3F5E9;
    --success-text: #14532D;
    --warning: #E8A33A;
    --warning-tint: #FFF1D6;
    --warning-text: #8A5300;
    --error: #B42318;
    --error-tint: #FDECEC;
    --error-text: #B42318;

    /* Solid-fill companions */
    --on-fill: #FFFFFF;          /* text and icons on ink, accent or status fills */
    --ink-hover: #2A2D35;
    --error-strong: #941C13;
    --error-tint-hover: #F9D9D7;
    --warning-surface: #FFF8E6;
    --warning-text-strong: #5C4410;
    --border-strong: #C3C7CF;
    --card-chip: #D9C27A;        /* EMV chip on the card illustrations */

    /* Radii */
    --r-4: 4px;
    --r-6: 6px;
    --r-12: 12px;
    --r-14: 14px;
    --r-16: 16px;
    --r-18: 18px;
    --r-20: 20px;
    --r-22: 22px;
    --r-24: 24px;
    --r-26: 26px;
    --r-28: 28px;
    --r-32: 32px;
    --r-pill: 999px;

    /* Type */
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
    --fs-amount-xl: 44px;
    --fs-amount: 34px;
    --fs-title: 22px;
    --fs-section: 20px;
    --fs-card: 17px;
    --fs-lead: 16px;             /* large buttons, tile labels, prices; also the iOS no-zoom input size */
    --fs-button: 15px;           /* buttons, row labels, inputs */
    --fs-body: 14px;
    --fs-secondary: 13px;
    --fs-caption: 12px;
    --fs-micro: 11px;            /* badges, mobile nav labels, Dev panel meta */

    /* Shadows */
    --shadow-float: 0 8px 28px rgba(20, 22, 27, .08), 0 1px 2px rgba(20, 22, 27, .05);
    --shadow-sheet: 0 24px 60px rgba(20, 22, 27, .12), 0 2px 6px rgba(20, 22, 27, .05);
    --shadow-dialog: 0 30px 80px rgba(20, 22, 27, .25);
    --shadow-hover: 0 14px 30px rgba(20, 22, 27, .08);

    /* Motion: every transition uses --ease. Presses stay quick so taps feel instant. */
    --ease: cubic-bezier(.2, .8, .2, 1);
    --dur-press: .1s;
    --dur-fast: .2s;
    --dur-enter: .25s;

    /* Stacking layers (component-internal stacking keeps small literals) */
    --z-mobile-nav: 900;
    --z-cart-backdrop: 940;
    --z-cart: 950;
    --z-detail: 980;
    --z-dialog: 1000;
    --z-void-confirm: 1050;
    --z-gb-ui: 1100;
    --z-receipt: 1500;
    --z-dev-panel: 1600;
    --z-toast: 2000;

    /* Code (Dev panel JSON viewer; never themed by the accent) */
    --code-bg: #F5F6F8;
    --code-line: #E2E5EA;
    --code-key: #2B4FA3;
    --code-string: #17794A;
    --code-number: #B4530B;
    --code-bool: #7B3FC4;
    --code-null: #8A8F99;
    --code-punct: #9AA0AA;
}

/* Accent palettes: --accent, --accent-strong, --accent-tint, --accent-ring, --accent-on-muted */
:root,
[data-accent="violet"] {
    --accent: #5B3FE0;
    --accent-strong: #4128B8;
    --accent-tint: #EFEBFF;
    --accent-ring: #C9BEFF;
    --accent-on-muted: #E4DDFF;
}

[data-accent="emerald"] {
    --accent: #0F7A55;
    --accent-strong: #0A5C40;
    --accent-tint: #E3F4EC;
    --accent-ring: #A9DCC6;
    --accent-on-muted: #DDF3E9;
}

[data-accent="teal"] {
    --accent: #0E6E6D;
    --accent-strong: #0A5150;
    --accent-tint: #E2F3F2;
    --accent-ring: #A6D9D7;
    --accent-on-muted: #D9F0EF;
}

[data-accent="blue"] {
    --accent: #0A62E8;
    --accent-strong: #0A4FBF;
    --accent-tint: #E8F0FE;
    --accent-ring: #B3CCF8;
    --accent-on-muted: #E6EFFE;
}

[data-accent="rose"] {
    --accent: #C2255C;
    --accent-strong: #9C1C4A;
    --accent-tint: #FCE7EF;
    --accent-ring: #F3B6CB;
    --accent-on-muted: #FBDDE8;
}
