/* Contacts' sign-in styles, for /login (login.html).
 *
 * btrade's sign-in stylesheet (bsi: src/btrade/static/login.css, itself
 * generated there from Bayes-Sharpe's invest.css and invest-dark.css), copied
 * unchanged so this page renders exactly as bsitrade.site's sign-in does.
 * When btrade's changes, take a new copy rather than editing this one.
 */

/* ── From invest.css ── */

/* The light theme. Every colour is a token: html.dark (invest-dark.css) swaps
   the same tokens for the dark theme, and the *-rgb ones ("r g b") are used
   with an alpha as rgb(var(--brand-rgb) / 0.1). */
:root {
    color-scheme: light;

    --bg: #f3f5f8;
    --bg-deep: #e9edf2;
    --surface: #ffffff;
    --surface-strong: #ffffff;
    --surface-muted: #f8fafc;
    --nav-bg: #ffffff;
    --ink: #111827;
    --ink-2: #374151;
    --ink-soft: #5b6474;
    --ink-faint: #8a93a3;
    --line: rgb(var(--ink-rgb) / 0.1);
    --line-strong: rgb(var(--ink-rgb) / 0.16);
    --brand: #1d63d8;
    --brand-deep: #174ea6;
    --brand-text: #1d63d8;
    --brand-soft: #dbe7fb;
    --on-brand: #ffffff;
    --accent: #c2570c;
    --up: #1a7f37;
    --down: #cf222e;
    --danger: #cf222e;

    --brand-rgb: 29 99 216;
    --brand-deep-rgb: 23 78 166;
    --ink-rgb: 17 24 39;
    --paper-rgb: 255 255 255;
    --paper-2-rgb: 248 250 252;
    --wash-rgb: 236 240 245;
    --up-rgb: 26 127 55;
    --down-rgb: 207 34 46;
    --shadow-rgb: 17 24 39;

    --shadow: 0 1px 2px rgb(var(--shadow-rgb) / 0.05), 0 1px 3px rgb(var(--shadow-rgb) / 0.06);
    --shadow-pop: 0 10px 30px rgb(var(--shadow-rgb) / 0.14);
    --radius-xl: 10px;
    --radius-lg: 8px;
    --radius-md: 6px;
    --radius-sm: 5px;
    --control-h: 36px;
    --nav-h: 44px;
    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-serif: var(--font-sans);
    --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-feature-settings: "cv11", "ss01";
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    scrollbar-gutter: stable;
}

body {
    position: relative;
}

.page-shell {
    min-height: 100vh;
    padding: 0 0 40px;
    position: relative;
}

.viewport {
    margin: 0 auto;
    max-width: 1440px;
    padding: 0 24px;
    position: relative;
}

/* Login page: a centered rounded card split 70/30 — banner panel on the
   left, login dialog on the right, each with its own background. */
.auth-layout {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: calc(100vh - 56px);
    padding: 24px 0;
}

.auth-card-shell {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 66.7% 33.3%;
    max-width: 1180px;
    overflow: hidden;
    width: 100%;
}

/* Left panel — banner */
.auth-layout .hero-card {
    background: linear-gradient(160deg, rgb(var(--paper-2-rgb)), rgb(var(--wash-rgb)));
    border: none;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: auto;
    overflow: visible;
    padding: 60px 56px;
}

.auth-layout .hero-card::before {
    display: none;
}

/* Right panel — login dialog (distinct, lighter background + divider) */
.auth-panel {
    align-items: center;
    background: var(--surface-strong);
    border-left: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 40px;
}

.auth-panel-inner {
    max-width: 400px;
    width: 100%;
}

.auth-form-stack {
    display: grid;
}

.auth-form-stack > * {
    align-self: start;
    grid-area: 1 / 1;
}

.auth-form-stack > .auth-form-reserve.hidden {
    display: grid !important;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* Login banner — bold, high-performance presentation. */
.auth-layout .hero-card h1 {
    font-size: clamp(2.4rem, 3.4vw, 3.4rem);
    letter-spacing: -0.02em;
    line-height: 1.04;
    margin: 14px 0 6px;
    max-width: none;
}

.accent-word {
    background: linear-gradient(120deg, var(--brand-deep), var(--brand-text));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.auth-layout .hero-copy {
    font-size: 1.06rem;
    line-height: 1.6;
    margin: 0;
    max-width: none;
}

.hero-highlights-label {
    color: var(--ink-soft);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    margin: 36px 0 16px;
    text-transform: uppercase;
}

.hero-highlights {
    display: grid;
    gap: 14px;
    list-style: none;
    margin: 0;
    max-width: 72ch;
    padding: 0;
}

.hero-highlights li {
    align-items: center;
    color: var(--ink);
    display: flex;
    font-size: 1.02rem;
    gap: 14px;
    line-height: 1.45;
    text-align: justify;
}

.hero-highlights .hl-icon {
    align-items: center;
    background: rgb(var(--brand-rgb) / 0.12);
    background: color-mix(in srgb, var(--brand) 15%, transparent);
    border: 1px solid rgb(var(--brand-rgb) / 0.2);
    border-color: color-mix(in srgb, var(--brand) 24%, transparent);
    border-radius: 9px;
    color: var(--brand);
    display: inline-flex;
    flex-shrink: 0;
    height: 28px;
    justify-content: center;
    width: 28px;
}

@media (max-width: 1160px) {
    .auth-card-shell {
        grid-template-columns: 1fr;
        max-width: 540px;
    }

    .auth-layout .hero-card {
        padding: 40px 30px;
    }

    .auth-panel {
        border-left: none;
        border-top: 1px solid var(--line);
        justify-content: flex-start;
        padding: 36px 30px;
    }
}

.hero-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}

.hero-card {
    min-height: 720px;
    padding: 42px;
}

.hero-card::before {
    background: none;
    content: none;
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.eyebrow {
    color: var(--ink-soft);
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-card h1 {
    font-family: var(--font-serif);
    font-weight: 650;
    line-height: 1.2;
    margin: 14px 0;
    letter-spacing: -0.01em;
}

.hero-card h1 {
    font-size: clamp(2.8rem, 5vw, 4.7rem);
    max-width: 12ch;
}

.hero-copy,
.form-message {
    color: var(--ink-soft);
}

.hero-copy {
    font-size: 1.08rem;
    line-height: 1.7;
    max-width: 64ch;
}

.auth-tab,
.primary-button,
input {
    font: inherit;
}

.auth-tab {
    background: transparent;
    border: 0;
    border-radius: var(--radius-md);
    color: var(--ink-soft);
    cursor: pointer;
    padding: 12px 14px;
    transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.auth-tab.active {
    background: var(--brand);
    color: var(--on-brand);
}

.auth-form {
    align-content: start;
    display: grid;
    gap: 16px;
}

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

.auth-form span {
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

input {
    background: rgb(var(--paper-rgb) / 0.95);
    border: 1px solid rgb(var(--ink-rgb) / 0.12);
    border-radius: var(--radius-md);
    color: var(--ink);
    min-height: var(--control-h);
    outline: none;
    padding: 0 12px;
    transition: border-color 120ms ease, box-shadow 120ms ease;
    font-size: 14px;
}

input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgb(var(--brand-rgb) / 0.18);
}

.password-field {
    position: relative;
}

.password-field input {
    display: block;
    padding-right: 52px;
    width: 100%;
}

.password-toggle {
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 999px;
    color: var(--ink-soft);
    cursor: pointer;
    display: inline-flex;
    height: 36px;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    transition: background 180ms ease, color 180ms ease;
    width: 36px;
}

.password-toggle:hover {
    background: rgb(var(--brand-rgb) / 0.08);
    color: var(--brand-deep);
}

.password-toggle:focus-visible {
    outline: 2px solid rgb(var(--brand-rgb) / 0.34);
    outline-offset: 2px;
}

.password-toggle .icon-eye-off {
    display: none;
}

.password-toggle.is-visible .icon-eye {
    display: none;
}

.password-toggle.is-visible .icon-eye-off {
    display: block;
}

.password-toggle:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.primary-button {
    border-radius: var(--radius-md);
    cursor: pointer;
    min-height: var(--control-h);
    padding: 0 14px;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
    font-size: 13.5px;
    font-weight: 600;
}

.primary-button {
    background: var(--brand);
    border: 0;
    box-shadow: none;
    color: var(--on-brand);
    font-weight: 600;
}

.primary-button:hover,
.auth-tab:hover {
    transform: none;
}

.primary-button:hover:not(:disabled) {
    background: var(--brand-deep);
}

.primary-button:disabled {
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.58;
    transform: none;
}

.form-message {
    font-size: 0.92rem;
    min-height: 1.4em;
    padding-top: 6px;
}

.auth-panel-inner #authMessage {
    margin-bottom: 0;
    padding-bottom: 0;
    text-align: center;
}

#authView[data-auth-stage="signup"] #authMessage:empty {
    visibility: hidden;
}

.form-message.error {
    color: var(--danger);
}

.form-message.success {
    color: var(--brand-deep);
}

/* Verification confirmation — the TEXT glyphs glow left→right (the box hugs
   the text via fit-content so the gradient clips to the letters, not a box). */
.form-message.verify-success {
    animation: verify-glow 2.2s linear infinite;
    background: linear-gradient(90deg, var(--brand) 0%, var(--brand) 40%, var(--brand-soft) 50%, var(--brand) 60%, var(--brand) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    background-size: 200% 100%;
    color: transparent;
    font-weight: 600;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    text-align: center;
    -webkit-text-fill-color: transparent;
    width: fit-content;
}

@keyframes verify-glow {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.hidden {
    display: none !important;
}

@media (max-width: 1160px) {
    .auth-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .page-shell {
        padding: 0 0 24px;
    }

    .viewport {
        padding: 0 12px;
    }

    .hero-card {
        padding: 22px;
    }

    .hero-card {
        min-height: auto;
    }

    .hero-card h1 {
        font-size: 2.6rem;
    }
}

.auth-info-text {
    color: var(--ink-soft);
    font-size: 0.95rem;
    margin: 0 0 4px;
}

.auth-email-hint {
    font-weight: 600;
    margin: 0 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-dropdown-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-deep, #f4efe7);
    border-radius: var(--radius-md);
    padding: 3px;
    margin-bottom: 1.1rem;
}

.auth-dropdown-tabs .auth-tab {
    flex: 1;
    padding: 0.35rem 0.5rem;
    border-radius: 0.45rem;
    border: none;
    background: transparent;
    color: var(--ink-soft, #64748b);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.auth-dropdown-tabs .auth-tab.active {
    background: var(--brand, #6366f1);
    color: #fff;
}

.auth-forgot-link {
    border: none;
    background: transparent;
    color: var(--brand, #6366f1);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

.auth-forgot-link:hover {
    color: var(--accent, #818cf8);
}

.auth-passkey-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

/* Login form — heading, remember-me / forgot row */
.auth-form-title {
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
}

.auth-options-row {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
}

#signupForm {
    gap: 14px;
}

/* Submit-button loading state ("Signing up …" with animated dots). */
.primary-button.btn-loading {
    cursor: progress;
    opacity: 1;
}

.loading-dots {
    align-items: center;
    display: inline-flex;
    gap: 4px;
    margin-left: 7px;
}

.loading-dots i {
    animation: loading-dot 1.2s infinite ease-in-out both;
    background: currentColor;
    border-radius: 50%;
    display: inline-block;
    height: 5px;
    width: 5px;
}

.loading-dots i:nth-child(1) { animation-delay: -0.32s; }

.loading-dots i:nth-child(2) { animation-delay: -0.16s; }

@keyframes loading-dot {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.7); }
    40% { opacity: 1; transform: scale(1); }
}

/* Higher specificity so display:flex beats `.auth-form label { display:grid }`,
   otherwise the checkbox and its text stack on separate lines. */
.auth-options-row .auth-remember {
    align-items: center;
    color: var(--ink-soft);
    cursor: pointer;
    display: flex;
    flex-direction: row;
    font-size: 0.8125rem;
    gap: 8px;
    user-select: none;
    white-space: nowrap;
}

.auth-options-row .auth-remember input[type="checkbox"] {
    accent-color: var(--brand);
    background: none;
    border: 0;
    border-radius: 0;
    cursor: pointer;
    flex: none;
    height: 15px;
    margin: 0;
    min-height: 0;
    padding: 0;
    width: 15px;
}

/* ─── Auth divider ──────────────────────────────────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ink-soft, #64748b);
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0.25rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--line, rgba(0,0,0,0.1));
}

/* ─── Auth signup prompt ─────────────────────────────────────────────────── */
.auth-signup-prompt {
    font-size: 0.8125rem;
    text-align: center;
    color: var(--ink-soft, #64748b);
    margin: 0.25rem 0 0;
}

.auth-signup-link {
    border: none;
    background: transparent;
    color: var(--brand, #6366f1);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

.auth-signup-link:hover {
    color: var(--accent, #818cf8);
}

.auth-signup-link:disabled {
    cursor: default;
    opacity: 0.6;
}

/* ── From invest-dark.css ── */

/* The dark theme (the default): graphite surfaces, an azure accent, and green
   and red kept for gains and losses. It swaps the tokens invest.css's :root
   sets, and overrides what the light theme draws with literal colours. */
html.dark {
    color-scheme: dark;

    --bg: #0b0d11;
    --bg-deep: #08090c;
    --surface: #12151b;
    --surface-strong: #181c23;
    --surface-muted: #0f1217;
    --nav-bg: #0e1015;
    --ink: #e6e8ec;
    --ink-2: #c5cad3;
    --ink-soft: #8d95a3;
    --ink-faint: #636b78;
    --line: #242931;
    --line-strong: #333a46;
    --brand: #2f81f7;
    --brand-deep: #1f6feb;
    --brand-text: #58a6ff;
    --brand-soft: #a5cdff;
    --on-brand: #ffffff;
    --accent: #f0a53a;
    --up: #3fb950;
    --down: #f85149;
    --danger: #f85149;

    --brand-rgb: 47 129 247;
    --brand-deep-rgb: 31 111 235;
    --brand-text-rgb: 88 166 255;
    --ink-rgb: 230 232 236;
    --paper-rgb: 24 28 35;
    --paper-2-rgb: 18 21 27;
    --wash-rgb: 11 13 17;
    --line-rgb: 72 79 92;
    --panel-rgb: 26 30 38;
    --deep-rgb: 14 16 21;
    --up-rgb: 63 185 80;
    --down-rgb: 248 81 73;
    --shadow-rgb: 0 0 0;

    --shadow: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow-pop: 0 12px 32px rgb(0 0 0 / 0.55);
}

html.dark,
html.dark body {
    background: var(--bg);
}

html.dark .hero-card::before {

    background: none;
}

html.dark .hero-card {

    background: rgb(var(--panel-rgb) / 0.6);
    border-color: rgb(var(--line-rgb) / 0.5);
}

/* Login card panels — distinct dark backgrounds (banner left, dialog right). */
html.dark .auth-layout .hero-card {
    background: linear-gradient(160deg, var(--surface), var(--surface-muted));
    border: none;
    box-shadow: none;
}

html.dark .auth-panel {
    background: var(--surface-strong);
    border-left-color: rgb(var(--line-rgb) / 0.55);
}

html.dark .auth-card-shell {
    border-color: rgb(var(--line-rgb) / 0.6);
    box-shadow: none;
}

html.dark .auth-tab {

    color: var(--ink-soft);
}

html.dark .auth-tab.active {

    background: var(--brand-deep);
    color: #fff;
}

html.dark .auth-tab:hover {

    color: var(--ink);
}

html.dark input {

    background: var(--surface-strong);
    border-color: var(--line-strong);
    color: var(--ink);
}

html.dark input::placeholder {

    color: var(--ink-faint);
}

html.dark input:focus {

    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgb(var(--brand-rgb) / 0.2);
}

html.dark .primary-button {

    background: var(--brand-deep);
    background-image: none;
    box-shadow: none;
    color: #fff;
}

html.dark .primary-button:hover {

    background: var(--brand);
    box-shadow: none;
    transform: none;
}

html.dark .primary-button:disabled {

    background: var(--brand-deep);
    box-shadow: none;
}

html.dark .form-message.error {
 color: var(--down); }

html.dark .form-message.success {
 color: var(--brand-text); }

html.dark .form-message.verify-success {
    background: linear-gradient(90deg, var(--brand-text) 0%, var(--brand-text) 42%, #ffffff 50%, var(--brand-text) 58%, var(--brand-text) 100%);
    background-size: 200% 100%;
}

html.dark ::-webkit-scrollbar-track {
 background: var(--surface-strong); }

html.dark ::-webkit-scrollbar-thumb {
 background: var(--ink-faint); border-radius: 9999px; }

html.dark ::-webkit-scrollbar-thumb:hover {
 background: var(--ink-faint); }

html.dark .auth-dropdown-tabs {
    background: rgb(var(--deep-rgb) / 0.8);
}

html.dark .auth-dropdown-tabs .auth-tab {
    color: var(--ink-soft);
}

html.dark .auth-dropdown-tabs .auth-tab.active {
    background: var(--brand-deep);
    color: #fff;
}

html.dark .auth-dropdown-tabs .auth-tab:hover:not(.active) {
    color: var(--brand-soft);
}

html.dark .auth-forgot-link {
    color: var(--brand-text);
}

html.dark .auth-forgot-link:hover {
    color: var(--brand-soft);
}

html.dark .auth-divider {
    color: var(--ink-faint);
}

html.dark .auth-divider::before,
html.dark .auth-divider::after {
    border-top-color: rgb(var(--line-rgb) / 0.5);
}

html.dark .auth-signup-prompt {
    color: var(--ink-soft);
}

html.dark .auth-signup-link {
    color: var(--brand-text);
}

html.dark .auth-signup-link:hover {
    color: var(--brand-soft);
}
