/* ============================================================
   Trellia Analytics — Sign-in
   Selectors required by templates/login.html:
   .auth-body / .auth-shell / .auth-panel / .auth-brand /
   .auth-brand-glyph / #auth-title / .auth-form / .auth-label /
   .auth-input / .auth-error / .auth-submit
   ============================================================ */

@font-face {
    font-family: "Aeonik";
    src: url("/static/fonts/Aeonik-Light.woff2?v=85a636dcaac11ca9") format("woff2"),
         url("/static/fonts/Aeonik-Light.otf?v=d35e8cdca0b54583") format("opentype");
    font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Aeonik";
    src: url("/static/fonts/Aeonik-Regular.woff2?v=7ebabfba08aff260") format("woff2"),
         url("/static/fonts/Aeonik-Regular.otf?v=cdd8de1c7cb7a759") format("opentype");
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Aeonik";
    src: url("/static/fonts/Aeonik-Bold.woff2?v=88c041e9df7f3631") format("woff2"),
         url("/static/fonts/Aeonik-Bold.otf?v=0b9aa117448147a6") format("opentype");
    font-weight: 700; font-style: normal; font-display: swap;
}

:root {
    color-scheme: light;

    --brand-dark-teal: #26474F;
    --brand-deep:      #0E2227;
    --brand-teal:      #89B5BA;
    --brand-teal-hot:  #B6E1E6;
    --brand-warm-bg:   #FAF7F6;
    --brand-warm-gray: #F0EDEB;
    --brand-text-dark: #2A2B2C;
    --brand-gray:      #545454;
    --brand-white:     #FFFFFF;
    --border-subtle:   #E5E1DE;
    --border-default:  #D6D2CF;
    --danger:          #C0252A;

    --font-sans: "Aeonik", "Helvetica Neue", Arial, system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body { min-height: 100%; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-weight: 300;
    font-size: 15px;
    line-height: 1.5;
    color: var(--brand-text-dark);
    background: var(--brand-warm-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ============================================================
   Shell — single-column credentials card centred on warm bg
   ============================================================ */
.auth-body {
    min-height: 100vh;
    background: var(--brand-warm-bg);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* ============================================================
   Background — slow-rotating neural orb, extremely faint
   ============================================================ */
.auth-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    display: grid;
    place-items: center;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 30%, transparent 90%);
    -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 30%, transparent 90%);
}
.auth-bg-canvas {
    display: block;
    width: min(900px, 92vmin);
    height: min(900px, 92vmin);
    opacity: 0.8;
}

.auth-topbar,
.auth-shell,
.auth-footnote,
.auth-stripe { position: relative; z-index: 1; }
.auth-stripe { z-index: 10; }

/* ============================================================
   Floating market-data labels — extremely faded, on warm bg
   ============================================================ */
.float-numbers {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.float-num {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em;
    white-space: nowrap;
    color: rgba(38, 71, 79, 0.32);
    border-left: 1px solid rgba(38, 71, 79, 0.22);
    background: transparent;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: float-drift var(--life, 6s) cubic-bezier(0.35, 0, 0.65, 1) forwards;
    will-change: transform, opacity;
}
.float-num.sm { font-size: 9.5px; color: rgba(38, 71, 79, 0.26); }
.float-num.md { font-size: 11px;  color: rgba(38, 71, 79, 0.34); }
.float-num.lg { font-size: 12.5px; color: rgba(38, 71, 79, 0.42);
                border-left-color: var(--brand-teal); }
.float-num .arrow { font-size: 0.78em; line-height: 1; opacity: 0.55; }
.float-num .arrow.up   { color: var(--positive, #2C8D2C); }
.float-num .arrow.down { color: var(--danger); }
.float-num .lbl { letter-spacing: 0.08em; }

@keyframes float-drift {
    0%   { opacity: 0; transform: translate(-50%, -50%); }
    50%  { opacity: 1; }
    100% { opacity: 0;
           transform: translate(calc(-50% + var(--dx, 0px)),
                                calc(-50% + var(--dy, -60px))); }
}

/* ============================================================
   Floating mini-charts — fade in, animate, fade out
   ============================================================ */
.float-charts {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.float-chart {
    position: absolute;
    padding: 8px 10px 6px;
    background: transparent;
    border: none;
    opacity: 0;
    animation: chart-fade var(--life, 6s) cubic-bezier(0.35, 0, 0.65, 1) forwards;
    will-change: opacity;
}
.float-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}
.float-chart-head .lbl {
    font-size: 9.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(38, 71, 79, 0.55);
}
.float-chart-head .tag {
    font-family: var(--font-mono);
    font-size: 8.5px;
    letter-spacing: 0.14em;
    color: rgba(38, 71, 79, 0.45);
    padding: 1px 5px;
    border: 1px solid rgba(38, 71, 79, 0.18);
    border-radius: 2px;
}

@keyframes chart-fade {
    0%   { opacity: 0; }
    50%  { opacity: 0.55; }
    100% { opacity: 0; }
}

/* ============================================================
   Top bar — logo + eyebrow
   ============================================================ */
.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 40px;
    gap: 24px;
}
.auth-topbar .auth-logo {
    height: 26px;
    width: auto;
    display: block;
}
.auth-topbar .auth-eyebrow {
    font-size: 10.5px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brand-gray);
    font-weight: 400;
}

/* ============================================================
   Footnote — tiny meta strip above the stripe
   ============================================================ */
.auth-footnote {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px 28px;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--brand-gray);
}

.auth-shell {
    position: relative;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;
}

/* ============================================================
   RIGHT — credentials column
   ============================================================ */
.auth-side {
    position: relative;
    display: grid;
    place-items: center;
    padding: 24px 40px 80px;
    background: transparent;
}

.auth-panel {
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: #FFFFFF;
    box-shadow: 0 1px 0 rgba(38, 71, 79, 0.02),
                0 20px 50px -30px rgba(38, 71, 79, 0.18);
    padding: 48px 44px 44px;
    position: relative;
}

/* Tiny diagonal-arrow stamped in the top-right corner of the card */
.auth-panel::after {
    content: "";
    position: absolute;
    top: 22px; right: 22px;
    width: 18px; height: 18px;
    background: url("/static/img/icon-diagonal-arrow.png") center/contain no-repeat;
    opacity: 0.45;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--brand-dark-teal);
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.auth-brand-glyph {
    width: 6px; height: 6px;
    border-radius: 0;
    background: var(--brand-teal);
    transform: rotate(45deg);
    display: inline-block;
}

.auth-panel h1#auth-title {
    margin: 0 0 32px;
    font-family: var(--font-sans);
    font-size: 30px;
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--brand-dark-teal);
}

.auth-subtitle {
    margin: 0 0 32px;
    color: var(--brand-gray);
    font-size: 14px;
    line-height: 1.55;
    max-width: 36ch;
}

.auth-form {
    display: grid;
    gap: 8px;
    position: relative;
}

.auth-label {
    color: var(--brand-dark-teal);
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.auth-input {
    width: 100%;
    height: 48px;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    background: #FFFFFF;
    color: var(--brand-text-dark);
    padding: 10px 14px;
    font: inherit;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.05em;
    transition: border-color 200ms var(--ease-out),
                box-shadow 200ms var(--ease-out);
}
.auth-input::placeholder {
    color: #B5AFAB;
    letter-spacing: 0;
}
.auth-input:hover {
    border-color: #B5AFAB;
}
.auth-input:focus {
    outline: none;
    border-color: var(--brand-dark-teal);
    box-shadow:
        0 0 0 3px rgba(137, 181, 186, 0.30),
        inset 0 0 0 1px var(--brand-dark-teal);
}

/* Sub-label under the sign-in button: sets the expectation that a one-time
   code arrives by email, so nobody waits on a password prompt that never
   comes. Muted so it reads as guidance, not as an error. */
.auth-hint {
    color: var(--muted, rgba(38, 71, 79, 0.62));
    font-size: 11.5px;
    font-weight: 300;
    margin-top: 8px;
    text-align: center;
}

.auth-error {
    color: var(--danger);
    font-size: 12px;
    font-weight: 400;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.auth-error[hidden] { display: none; }
.auth-error::before {
    content: "";
    width: 4px; height: 4px;
    background: var(--danger);
    border-radius: 50%;
    flex-shrink: 0;
}

.auth-submit {
    width: 100%;
    height: 48px;
    margin-top: 18px;
    border: 1px solid var(--brand-dark-teal);
    border-radius: 4px;
    background: var(--brand-dark-teal);
    color: var(--brand-white);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 200ms var(--ease-out),
                transform 200ms var(--ease-out),
                box-shadow 200ms var(--ease-out);
}
.auth-submit-arrow {
    width: 14px;
    height: 14px;
    background: url("/static/img/icon-diagonal-arrow.png") center/contain no-repeat;
    filter: brightness(0) invert(1);
    opacity: 0.9;
    transition: transform 200ms var(--ease-out);
}
.auth-submit:hover .auth-submit-arrow {
    transform: translate(2px, -2px);
}
.auth-submit:hover {
    background: #1A3940;
    box-shadow: 0 8px 24px -10px rgba(38, 71, 79, 0.55);
}
.auth-submit:active {
    transform: translateY(1px);
}

/* Sweep highlight on the submit button — subtle */
.auth-submit::after {
    content: "";
    position: absolute;
    top: 0; left: -30%;
    width: 30%; height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(182, 225, 230, 0.22) 50%,
        transparent 100%);
    transform: skewX(-20deg);
    animation: btn-sweep 4.5s var(--ease-out) infinite;
    pointer-events: none;
}
@keyframes btn-sweep {
    0%, 60%  { left: -30%; }
    100%     { left: 130%; }
}

/* Trellia signature 8 px teal stripe across the very bottom */
.auth-stripe {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 8px;
    background: var(--brand-teal);
    z-index: 10;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
    .auth-topbar { padding: 24px 24px; }
    .auth-side { padding: 16px 24px 60px; }
    .auth-footnote { padding: 0 24px 24px; }
}

@media (max-width: 520px) {
    .auth-panel { padding: 36px 28px 32px; }
    .auth-panel h1#auth-title { font-size: 26px; }
    .auth-footnote span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-submit::after { animation: none; }
}
