/* Lion Chatbot - design tokens and base styles.
   Shared by the admin panel (admin.css) and the sign-in pages (auth.css).
   Dark is the default; data-theme="light" on <html> swaps the token values and
   nothing else - no component is written twice. */

:root {
    /* type */
    --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Code", "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

    /* shape */
    --r-xs: 6px;
    --r-sm: 8px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 18px;
    --r-2xl: 24px;
    --r-pill: 999px;

    /* motion */
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --fast: 0.16s;
    --base: 0.24s;

    /* layout */
    --side-w: 264px;
    --side-w-mini: 76px;
    --topbar-h: 68px;
    --tabbar-h: 62px;
    --page-pad: 28px;

    /* the colours of the Lion Vision mark, used for accents and avatars */
    --c-green: #2fd08a;
    --c-cyan: #38d6f5;
    --c-blue: #6f8cff;
    --c-violet: #a78bfa;
    --c-pink: #e15ad6;
    --c-amber: #fbbf24;
    --c-orange: #fb923c;
    --c-rose: #fb7185;

    /* the same colours as channels, for tints: rgba(var(--rgb-green), 0.15) */
    --rgb-green: 47, 208, 138;
    --rgb-cyan: 56, 214, 245;
    --rgb-blue: 111, 140, 255;
    --rgb-violet: 167, 139, 250;
    --rgb-pink: 225, 90, 214;
    --rgb-amber: 251, 191, 36;
    --rgb-orange: 251, 146, 60;
    --rgb-rose: 251, 113, 133;

    --grad-brand: linear-gradient(135deg, #4aeaa8 0%, #24bb75 52%, #14a79d 100%);
    --grad-aurora: linear-gradient(90deg, #2fd08a 0%, #38d6f5 38%, #6f8cff 68%, #e15ad6 100%);

    /* the primary action is the same in both themes: bright emerald, near-black label */
    --brand: #2fd08a;
    --brand-2: #22b872;
    --brand-ink: #04140c;
}

/* ---------- dark (default) ---------- */

:root,
:root[data-theme="dark"] {
    color-scheme: dark;

    --bg: #060a11;
    --bg-glass: rgba(6, 10, 17, 0.74);
    --side-bg: rgba(10, 15, 23, 0.82);
    --panel: rgba(17, 26, 39, 0.72);
    --panel-solid: #101926;
    --raised: #141f2f;
    --field: rgba(255, 255, 255, 0.045);
    --field-hover: rgba(255, 255, 255, 0.075);
    --hover: rgba(255, 255, 255, 0.055);
    --active: rgba(255, 255, 255, 0.095);
    --line: rgba(255, 255, 255, 0.085);
    --line-2: rgba(255, 255, 255, 0.15);

    --text: #e9eff7;
    --text-2: #a3b1c2;
    --text-3: #7c8a9d;

    --brand-text: #49e3a3;
    --brand-soft: rgba(47, 208, 138, 0.13);
    --brand-line: rgba(47, 208, 138, 0.34);
    --brand-glow: rgba(47, 208, 138, 0.36);

    --info-text: #7fe3f8;
    --info-soft: rgba(56, 214, 245, 0.13);
    --info-line: rgba(56, 214, 245, 0.32);
    --warn-text: #fcd34d;
    --warn-soft: rgba(251, 191, 36, 0.13);
    --warn-line: rgba(251, 191, 36, 0.32);
    --danger-text: #fda4af;
    --danger-soft: rgba(251, 113, 133, 0.13);
    --danger-line: rgba(251, 113, 133, 0.34);
    --danger-fill: #e11d48;

    --shadow-sm: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 40px -24px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 32px 80px -20px rgba(0, 0, 0, 0.85);
    --scrim: rgba(3, 6, 10, 0.68);

    --code-bg: #04070c;
    --code-text: #c9d6e6;
    --bubble-in: #152131;

    /* the spectrum, at a strength that reads as text on this ground */
    --grad-aurora-text: linear-gradient(90deg, #4aeaa8 0%, #5fe0fb 45%, #93a5ff 100%);

    --grid-dot: rgba(255, 255, 255, 0.055);
    --aurora-1: rgba(47, 208, 138, 0.17);
    --aurora-2: rgba(56, 214, 245, 0.12);
    --aurora-3: rgba(111, 140, 255, 0.11);
}

/* ---------- light ---------- */

:root[data-theme="light"] {
    color-scheme: light;

    --bg: #f1f4f8;
    --bg-glass: rgba(241, 244, 248, 0.8);
    --side-bg: rgba(255, 255, 255, 0.9);
    --panel: #ffffff;
    --panel-solid: #ffffff;
    --raised: #ffffff;
    --field: #ffffff;
    --field-hover: #fbfcfe;
    --hover: rgba(16, 24, 40, 0.045);
    --active: rgba(16, 24, 40, 0.085);
    --line: #e2e8ef;
    --line-2: #c9d3de;

    --text: #152030;
    --text-2: #52627a;
    --text-3: #64748b;

    --brand-text: #0a6b42; /* 4.5:1 or better even on the light green tints */
    --brand-soft: rgba(32, 164, 97, 0.11);
    --brand-line: rgba(32, 164, 97, 0.36);
    --brand-glow: rgba(32, 164, 97, 0.26);

    --info-text: #0e7490;
    --info-soft: rgba(14, 116, 144, 0.1);
    --info-line: rgba(14, 116, 144, 0.3);
    --warn-text: #92400e;
    --warn-soft: rgba(217, 119, 6, 0.12);
    --warn-line: rgba(217, 119, 6, 0.34);
    --danger-text: #be123c;
    --danger-soft: rgba(225, 29, 72, 0.09);
    --danger-line: rgba(225, 29, 72, 0.3);
    --danger-fill: #e11d48;

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-md: 0 1px 2px rgba(16, 24, 40, 0.04), 0 14px 34px -18px rgba(16, 24, 40, 0.18);
    --shadow-lg: 0 0 0 1px rgba(16, 24, 40, 0.06), 0 32px 80px -24px rgba(16, 24, 40, 0.36);
    --scrim: rgba(15, 23, 42, 0.46);

    /* code stays on a dark ground in both themes: it reads as "copy this exactly" */
    --code-bg: #0b1220;
    --code-text: #d5deea;
    --bubble-in: #ffffff;

    --grad-aurora-text: linear-gradient(90deg, #0c7a4b 0%, #0e7490 45%, #4338ca 100%);

    --grid-dot: rgba(16, 24, 40, 0.055);
    --aurora-1: rgba(47, 208, 138, 0.13);
    --aurora-2: rgba(56, 214, 245, 0.1);
    --aurora-3: rgba(111, 140, 255, 0.08);
}

/* ---------- base ---------- */

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

/*
 * Must beat every display rule in the panel. Many components are toggled with the
 * hidden attribute, and an author `display: grid/flex` otherwise wins over the
 * browser's own `[hidden] { display: none }` and leaves the thing on screen.
 */
[hidden] {
    display: none !important;
}

html {
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Ambient light: three soft pools of the brand colours, fixed behind everything.
   On its own layer rather than background-attachment: fixed, which repaints on scroll. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(1100px 620px at -8% -14%, var(--aurora-1), transparent 62%),
        radial-gradient(900px 560px at 108% -10%, var(--aurora-2), transparent 62%),
        radial-gradient(1000px 720px at 62% 120%, var(--aurora-3), transparent 60%);
}

/* A faint dot grid that fades out down the page. */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: radial-gradient(var(--grid-dot) 1px, transparent 1.4px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 0%, transparent 78%);
    mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 0%, transparent 78%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
h4,
p {
    margin: 0;
}

code,
kbd {
    font-family: var(--mono);
    font-size: 0.92em;
}

::selection {
    background: rgba(47, 208, 138, 0.32);
    color: inherit;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--line-2);
    border: 3px solid transparent;
    border-radius: 99px;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-3);
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
    background: transparent;
}

/* One focus treatment everywhere; components only override the offset. */
:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* Icons: geometry comes from the sprite, the look from here. */
.i {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    overflow: visible;
}

.i--sm { width: 15px; height: 15px; }
.i--lg { width: 22px; height: 22px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    /* iteration-count is what actually stops a looping animation; a tiny duration on
       its own just makes it cycle too fast to see as anything but a flicker. */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: -1ms !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
        scroll-behavior: auto !important;
    }
}
