/* =====================================================================
   theme.css — Customer Portal design tokens
   All visual primitives live here as CSS custom properties. Component
   styling consumes these tokens only (see components.css).
   ===================================================================== */

/* Inter and DM Sans are loaded from Google Fonts in head.php (no local font files needed). */

/* ---------------------------------------------------------------------
   Root tokens
   --------------------------------------------------------------------- */
:root {
    --color-brand: #1E3A8A;

    /* Primary scale */
    --primary-900: #050B1F;
    --primary-800: #0A1233;
    --primary-700: #0F1B4C;
    --primary-600: #15296B;
    --primary-500: #1E3A8A;
    --primary-400: #2E52B8;
    --primary-300: #5B7FD6;
    --primary-200: #9CB4EA;
    --primary-100: #D3DEF7;
    --primary-50:  #F0F4FE;

    /* Accent */
    --accent-600: #D98E1F;
    --accent-500: #F2A93B;
    --accent-100: #FDF1DB;

    /* Map markers */
    --map-pickup: #1FA97A;
    --map-drop:   #E14B4B;
    --map-stop:   #E0A72E;

    /* Feedback */
    --success-500: #1FA97A;
    --success-100: #DCF5EC;
    --warning-500: #E0A72E;
    --warning-100: #FDF1DB;
    --error-500:   #E14B4B;
    --error-100:   #FBE3E3;
    --info-500:    #2E52B8;
    --info-100:    #D3DEF7;

    /* Neutrals */
    --neutral-50:  #F8FAFC;
    --neutral-100: #F1F5F9;
    --neutral-200: #E2E8F0;
    --neutral-300: #CBD5E1;
    --neutral-400: #94A3B8;
    --neutral-500: #64748B;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1E293B;
    --neutral-900: #0F172A;

    /* Dark theme bases */
    --dark-bg-base: #080D1F;
    --dark-surface: #111B38;
    --dark-border: #243357;

    /* Glass */
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.14);

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, var(--primary-900), var(--primary-600));
    --gradient-card-accent: linear-gradient(120deg, var(--primary-800), var(--primary-500));

    /* Radii */
    --radius-8: 8px;
    --radius-14: 14px;
    --radius-20: 20px;
    --radius-28: 28px;
    --radius-pill: 999px;

    /* Shadows */
    --shadow-1: 0 1px 2px rgba(6, 12, 30, 0.08);
    --shadow-2: 0 6px 18px rgba(6, 12, 30, 0.12);
    --shadow-3: 0 18px 48px rgba(6, 12, 30, 0.22);

    /* Spacing scale */
    --space-4: 4px;
    --space-8: 8px;
    --space-12: 12px;
    --space-16: 16px;
    --space-20: 20px;
    --space-24: 24px;
    --space-32: 32px;
    --space-40: 40px;
    --space-48: 48px;
    --space-64: 64px;

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-display: 'DM Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    /* Focus ring */
    --focus-ring: 0 0 0 3px color-mix(in srgb, var(--primary-400) 45%, transparent);

    /* Semantic surfaces (light) */
    --surface: #ffffff;
    --surface-2: var(--neutral-50);
    --surface-3: var(--neutral-100);
    --surface-inverse: var(--primary-900);
    --text: var(--neutral-900);
    --text-muted: #4B5B73;
    --text-inverse: #ffffff;
    --border: var(--neutral-200);

    /* Brand-derived helper (overridable per company at runtime) */
    --brand: var(--color-brand);
    --brand-contrast: #ffffff;
    --link: #1D4ED8;
    --success-text: #0B6B4B;
    --warning-text: #7A5200;
    --error-text: #B42323;
    --accent-text: #0369A1;
}

/* ---------------------------------------------------------------------
   Dark theme overrides
   --------------------------------------------------------------------- */
[data-theme="dark"] {
    --surface: var(--dark-surface);
    --surface-2: color-mix(in srgb, var(--dark-surface) 80%, #000000);
    --surface-3: var(--dark-bg-base);
    --surface-inverse: var(--primary-50);
    --text: #E7ECF7;
    --text-muted: #A9B8DA;
    --text-inverse: var(--dark-bg-base);
    --border: var(--dark-border);
    --link: #7DD3FC;
    --success-text: #7FE3BF;
    --warning-text: #FFD98A;
    --error-text: #FF9B9B;
    --accent-text: #7DD3FC;
    --brand-contrast: #ffffff;

    --neutral-50:  #0B1226;
    --neutral-100: #111B38;
    --neutral-200: #1B2748;
    --neutral-300: #243357;
    --neutral-400: #45567F;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 6px 18px rgba(0, 0, 0, 0.5);
    --shadow-3: 0 18px 48px rgba(0, 0, 0, 0.6);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body.customer-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--surface-2);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img,
svg,
video {
    max-width: 100%;
    display: block;
}

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

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    line-height: 1.2;
    color: var(--text);
}

:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: var(--radius-8);
}
