/* ==========================================================================
   Linea skin for auth-space.

   Loaded after the vendored kit's tokens (static/clearspace/styles/tokens.css)
   on the admin, and on its own by the sign-in and directory pages. It keeps the
   kit's --cs-* custom-property NAMES and gives them Linea's VALUES, so the kit
   and the screens need no changes and upstream's kit can still be picked.

   Copied from the Conduit fork (Linea-AI/conduit-dashboard-v2,
   frontend/src/styles/tokens.css), itself from Linea's Brand Guidelines design
   system (V3, 2026-06). Keep the two in step.

   Non-negotiables from the brand guide:
     · #2e5dff is the only brand color
     · Outfit (UI) + DM Serif Display (display/emphasis)
     · status colors are Linea-tuned
     · application surface = white cards on off-white, pill buttons
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* ══════════════════════════════════════════════════════════════════
       COLOR — PRIMARY PALETTE  (Brand Guidelines p.19)
       ══════════════════════════════════════════════════════════════════ */
    --cs-light-blue:    #2e5dff;   /* PMS 299 · hero blue · primary brand */
    --cs-dark-blue:     #0a0a0a;   /* PMS 431 C · dark blue · structural */

    /* BRAND NEUTRALS */
    --cs-spatial-white: #FFFFFF;
    --cs-charcoal:      #0a0a0a;   /* PMS Neutral Black C */

    /* SECONDARY PALETTE — accents, use sparingly, always with pairing */
    --cs-light-red:     #d4351c;   /* PMS 178 C */
    --cs-dark-red:      #862112;   /* PMS 7594 C */
    --cs-light-green:   #1a8f59;   /* PMS 390 C */
    --cs-dark-green:    #115c39;   /* PMS 5753 C */

    /* Button-hover blue — the only legacy alias still referenced. */
    --cs-blue-hover:    #1a3fb3;

    /* COLOR SCALES */
    --cs-blue-50:   #f4f6fe;
    --cs-blue-100:  #eaeffe;
    --cs-blue-200:  #c9d5ff;
    --cs-blue-300:  #a3b8ff;
    --cs-blue-400:  #6b8bff;
    --cs-blue-500:  #2e5dff;   /* hero */
    --cs-blue-600:  #234ad1;
    --cs-blue-700:  #1a3fb3;
    --cs-blue-800:  #142f85;
    --cs-blue-900:  #12276b;   /* dark blue */

    --cs-green-50:  #eaf6f0;
    --cs-green-100: #d0ebde;
    --cs-green-200: #a3d8c0;
    --cs-green-300: #6bbf9b;
    --cs-green-400: #38a677;
    --cs-green-500: #1a8f59;   /* hero */
    --cs-green-600: #157348;
    --cs-green-700: #115c39;
    --cs-green-800: #0e4a2f;
    --cs-green-900: #0b3a25;

    --cs-red-50:    #fdf0ee;
    --cs-red-100:   #fadbd5;
    --cs-red-200:   #f5b7ab;
    --cs-red-300:   #ee8b78;
    --cs-red-400:   #e2604a;
    --cs-red-500:   #d4351c;   /* hero */
    --cs-red-600:   #ab2a17;
    --cs-red-700:   #862112;
    --cs-red-800:   #6b1a0e;
    --cs-red-900:   #55150b;

    /* NEUTRAL RAMP — runs from spatial-white to charcoal */
    --cs-n-0:    #FFFFFF;
    --cs-n-50:   #fafafa;
    --cs-n-100:  #f2f2f0;
    --cs-n-200:  #e8e8e6;
    --cs-n-300:  #d4d4d0;
    --cs-n-400:  #a3a3a0;
    --cs-n-500:  #737370;
    --cs-n-600:  #52524f;
    --cs-n-700:  #2a2c30;
    --cs-n-800:  #1a1b1e;
    --cs-n-900:  #0a0a0a;   /* near-black */

    /* ══════════════════════════════════════════════════════════════════
       SEMANTIC FG / BG
       ══════════════════════════════════════════════════════════════════ */
    --fg-1:          var(--cs-charcoal);
    --fg-2:          var(--cs-n-500);
    --fg-muted:      var(--cs-n-400);
    --fg-disabled:   var(--cs-n-300);
    --fg-link:       var(--cs-light-blue);
    --fg-danger:     var(--cs-light-red);
    --fg-success:    var(--cs-dark-green);
    --fg-on-dark:    rgba(255, 255, 255, 0.85);
    --fg-on-dark-strong: #FFFFFF;

    --bg-app:        var(--cs-n-50);
    --bg-surface:    var(--cs-spatial-white);
    --bg-sunken:     var(--cs-n-50);
    --bg-sidebar:    var(--cs-dark-blue);
    --bg-selected:   var(--cs-light-blue);

    --border-default: var(--cs-n-200);
    --border-input:   var(--cs-n-300);
    --border-divider: var(--cs-n-100);

    --focus-ring: 0 0 0 3px rgba(46, 93, 255, 0.10);
    --focus-ring-on-dark: 0 0 0 2px var(--cs-light-blue);
    /* Used by the directory pages (upstream kept these in a second token file). */
    --tint-blue:      rgba(46, 93, 255, 0.14);
    --tint-blue-soft: rgba(46, 93, 255, 0.08);

    /* Color-pairing cues (Brand Guidelines p.20) */
    --pair-blue-bg:    var(--cs-dark-blue);
    --pair-blue-fg:    var(--cs-light-blue);
    --pair-red-bg:     var(--cs-dark-red);
    --pair-red-fg:     var(--cs-spatial-white);
    --pair-green-bg:   var(--cs-dark-green);
    --pair-green-fg:   var(--cs-spatial-white);

    --surface-light:        var(--cs-spatial-white);
    --surface-dark:         var(--cs-dark-blue);
    --surface-accent-green: var(--cs-dark-green);
    --surface-accent-red:   var(--cs-dark-red);

    /* ══════════════════════════════════════════════════════════════════
       TYPOGRAPHY
       ══════════════════════════════════════════════════════════════════ */
    --font-primary:  'Outfit', 'Inter', -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-serif:    'DM Serif Display', 'Cormorant Garamond', Georgia, serif;
    --font-sans:     var(--font-primary);
    --font-fallback: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:     ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    --fw-light:    300;
    --fw-regular:  400;
    --fw-medium:   500;
    --fw-semibold: 600;

    --text-base: 16px;
    --lh-base:   1.3;
    --lh-head:   1.1;

    --text-xs:    12px;
    --text-sm:    14px;
    --text-md:    16px;
    --text-lg:    18px;
    --text-xl:    22px;
    --text-2xl:   28px;
    --text-3xl:   40px;
    --text-h2:    56px;
    --text-h1:    80px;
    --text-hero:  128px;

    --tracking-display: -0.02em;
    --tracking-body:     0;
    --tracking-eyebrow:  0.08em;
    --tracking-ui:      -0.01em;

    /* ══════════════════════════════════════════════════════════════════
       LAYOUT — grid anchored to logo-bar height = 1X (Brand p.24)
       ══════════════════════════════════════════════════════════════════ */
    --unit-x:     8px;
    --gutter:     calc(var(--unit-x) * 2);
    --margin-h:   calc(var(--unit-x) * 6);
    --margin-v:   calc(var(--unit-x) * 4);
    --block-gap:  calc(var(--unit-x) * 9);
    --clearspace: calc(var(--unit-x) * 3);
    --logo-min:   80px;

    --space-1:  4px;
    --space-2:  8px;
    --space-3:  12px;
    --space-4:  16px;
    --space-5:  20px;
    --space-6:  24px;
    --space-7:  28px;
    --space-8:  32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* ══════════════════════════════════════════════════════════════════
       BREAKPOINTS — the canonical responsive scale. NON-NEGOTIABLE.
       ══════════════════════════════════════════════════════════════════ */
    --bp-mobile:    768px;
    --bp-tablet:    1024px;
    --bp-mobile-max:  767.98px;
    --bp-tablet-max:  1023.98px;
    --touch-min:    44px;

    --bp-compact:     640px;
    --bp-compact-max: 639.98px;
    --container-max:    1200px;
    --container-narrow: 800px;
    --measure:          65ch;
    --fluid-h1: clamp(var(--text-3xl), 6vw,   var(--text-h1));
    --fluid-h2: clamp(var(--text-2xl), 4.5vw, var(--text-h2));
    --fluid-h3: clamp(var(--text-xl),  3vw,   var(--text-3xl));

    /* ══════════════════════════════════════════════════════════════════
       BUTTON HEIGHTS — the canonical sizes. NON-NEGOTIABLE.
       ══════════════════════════════════════════════════════════════════ */
    --btn-h-sm:     28px;
    --btn-h-md:     36px;
    --btn-h-lg:     44px;
    --btn-px-sm:    10px;
    --btn-px-md:    14px;
    --btn-px-lg:    20px;
    --btn-radius:   100px;   /* Linea application surface = pill */
    --btn-weight:   500;
    --btn-fs-sm:    12px;
    --btn-fs-md:    14px;
    --btn-fs-lg:    15px;

    --radius-md:    8px;
    --radius-sm:    6px;
    --radius-lg:    12px;   /* form inputs */
    --radius-xl:    16px;   /* cards */
    --radius-pill:  100px;
    --radius-none:  0;

    --shadow-card:     0 1px 4px rgba(22, 25, 26, 0.06);
    --shadow-hover:    0 1px 6px rgba(22, 25, 26, 0.07);
    --shadow-dropdown: 0 4px 16px rgba(22, 25, 26, 0.08);
    --shadow-modal:    0 20px 40px rgba(22, 25, 26, 0.15);

    --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
    --dur-fast:  0.15s;
    --dur-med:   0.3s;

    --line-thickness: 6px;
}

/* ==========================================================================
   TYPE STYLES — semantic element styles
   ========================================================================== */

html, body {
    font-family: var(--font-primary);
    font-weight: var(--fw-light);
    font-size: var(--text-base);
    line-height: var(--lh-base);
    color: var(--fg-1);
    background: var(--bg-app);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.cs-h1 {
    font-family: var(--font-primary);
    font-weight: var(--fw-light);
    font-size: var(--text-h1);
    line-height: var(--lh-head);
    letter-spacing: var(--tracking-display);
    text-transform: uppercase;
    text-wrap: balance;
}
.cs-h1--hero { font-size: var(--text-hero); }

.cs-h2 {
    font-family: var(--font-primary);
    font-weight: var(--fw-light);
    font-size: var(--text-h2);
    line-height: var(--lh-head);
    letter-spacing: var(--tracking-display);
}

.cs-subline {
    font-family: var(--font-primary);
    font-weight: var(--fw-light);
    font-size: var(--text-2xl);
    line-height: var(--lh-head);
}

.cs-body {
    font-family: var(--font-primary);
    font-weight: var(--fw-light);
    font-size: var(--text-md);
    line-height: 1.3;
}

blockquote + cite,
.cs-caption,
figure figcaption {
    font-family: var(--font-primary);
    font-weight: var(--fw-light);
    font-size: var(--text-xl);
    line-height: 1.35;
    letter-spacing: 0;
    text-transform: none;
    font-style: normal;
    color: var(--fg-2);
    display: block;
}

.cs-title-quote {
    font-family: var(--font-primary);
    font-weight: var(--fw-light);
    line-height: 1.1;
    letter-spacing: var(--tracking-display);
    text-transform: uppercase;
    text-wrap: balance;
}

.cs-label {
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--cs-light-blue);
}
.cs-label--green { color: var(--cs-green-700); }
.cs-label--red   { color: var(--cs-red-600); }
.cs-label--muted { color: var(--cs-n-500); }

.cs-section-title,
.cs-footer-text,
.cs-eyebrow {
    font-family: var(--font-primary);
    font-weight: var(--fw-regular);
    font-size: var(--text-xs);
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: var(--tracking-eyebrow);
}

h1 { font-size: var(--text-2xl); font-weight: var(--fw-medium); letter-spacing: var(--tracking-ui); line-height: 1.2; }
h2 { font-size: var(--text-xl); font-weight: var(--fw-medium); letter-spacing: var(--tracking-ui); line-height: 1.25; }
h3 { font-size: var(--text-lg); font-weight: var(--fw-medium); letter-spacing: var(--tracking-ui); }

.card-title, .detail-label, .stat-label {
    font-size: 11px;
    font-weight: var(--fw-semibold);
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: var(--tracking-eyebrow);
}

.cs-emphasis        { color: var(--cs-light-blue); }
.cs-emphasis--green { color: var(--cs-light-green); }
.cs-emphasis--red   { color: var(--cs-light-red); }
.cs-emphasis--white { color: var(--cs-spatial-white); }

a, .cs-link { color: var(--fg-link); text-decoration: none; }
a:hover, .cs-link:hover { text-decoration: underline; }

.cs-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

.cs-line {
    display: block;
    height: var(--line-thickness);
    background: currentColor;
    width: 100%;
}
.cs-line--blue    { color: var(--cs-light-blue); }
.cs-line--red     { color: var(--cs-light-red); }
.cs-line--green   { color: var(--cs-light-green); }
.cs-line--dark    { color: var(--cs-charcoal); }
.cs-line--white   { color: var(--cs-spatial-white); }

/* ==========================================================================
   BUTTONS — canonical height contract (non-negotiable).
   ========================================================================== */
.cs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
    height: var(--btn-h-md);
    min-height: var(--btn-h-md);
    padding: 0 var(--btn-px-md);
    font-family: var(--font-primary);
    font-weight: var(--btn-weight);
    font-size: var(--btn-fs-md);
    line-height: 1;
    letter-spacing: -0.005em;
    white-space: nowrap;
    background: transparent;
    color: var(--cs-charcoal);
    border: 1px solid transparent;
    border-radius: var(--btn-radius);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out),
                color      var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
    -webkit-appearance: none;
            appearance: none;
}
.cs-btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}
.cs-btn:disabled, .cs-btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
}
.cs-btn > svg { width: 16px; height: 16px; flex-shrink: 0; }

.cs-btn--sm { height: var(--btn-h-sm); min-height: var(--btn-h-sm); padding: 0 var(--btn-px-sm); font-size: var(--btn-fs-sm); }
.cs-btn--lg { height: var(--btn-h-lg); min-height: var(--btn-h-lg); padding: 0 var(--btn-px-lg); font-size: var(--btn-fs-lg); }
.cs-btn--sm > svg { width: 14px; height: 14px; }
.cs-btn--lg > svg { width: 18px; height: 18px; }

.cs-btn--icon            { width: var(--btn-h-md); padding: 0; }
.cs-btn--icon.cs-btn--sm { width: var(--btn-h-sm); }
.cs-btn--icon.cs-btn--lg { width: var(--btn-h-lg); }

.cs-btn--primary {
    background: var(--cs-light-blue);
    color: #fff;
    border-color: var(--cs-light-blue);
}
.cs-btn--primary:hover { background: var(--cs-blue-hover); border-color: var(--cs-blue-hover); }

.cs-btn--secondary {
    background: #fff;
    color: var(--cs-charcoal);
    border-color: var(--cs-n-200);
}
.cs-btn--secondary:hover { background: var(--cs-n-50); border-color: var(--cs-n-300); }

.cs-btn--ghost {
    background: transparent;
    color: var(--cs-n-600);
    border-color: transparent;
}
.cs-btn--ghost:hover { background: var(--cs-n-100); color: var(--cs-charcoal); }

.cs-btn--danger {
    background: var(--cs-light-red);
    color: #fff;
    border-color: var(--cs-light-red);
}
.cs-btn--danger:hover { background: var(--cs-red-600); border-color: var(--cs-red-600); }

/* ==========================================================================
   FORM FIELDS — required-field marker (non-negotiable).
   ========================================================================== */
.cs-required::after,
label.cs-required::after,
[data-required] > label::after,
label[data-required]::after {
    content: "*";
    color: var(--cs-light-red);
    margin-left: 4px;
    font-weight: var(--fw-medium);
    line-height: 1;
}
