/* ============================================================================
   AUTH PAGES  ·  Adiox Copier
   ----------------------------------------------------------------------------
   Linked by _AuthLayout only (sign in, register, password and e-mail pages).

   The page is one picture of the product: signals arrive on the left, pass
   through the card in the middle, and fan out to several trading accounts on
   the right. The card is the copier. The side chips and the wires between
   them are decoration (aria-hidden) and only show on wide screens; below
   that the card stands alone, with a small emblem carrying the same idea.

   Wires are drawn by wwwroot/js/auth-stage.js, which measures the chips.
   Green and red here mean buy / sell / copied — never chrome.
   ============================================================================ */

:root {
    --auth-accent:        #8b5cf6;
    --auth-accent-mid:    #7c3aed;
    --auth-accent-bright: #a78bfa;
    --auth-accent-pale:   #c4b5fd;
    --auth-pink:          #ec4899;
    --auth-bg:            #080912;
    --auth-card:          rgba(15,19,32,.90);
    --auth-border:        rgba(139,92,246,.18);
    --auth-text:          #eef2f7;
    --auth-body:          #c3cedb;
    --auth-muted:         #8e9db0;
    --auth-dim:           #64748b;
    --auth-field-bg:      rgba(255,255,255,.055);
    --auth-field-hover:   rgba(255,255,255,.085);
    --auth-field-focus:   rgba(139,92,246,.07);
    --auth-buy:           #22d39b;
    --auth-sell:          #f87171;
    --auth-mono:          'IBM Plex Mono', 'SFMono-Regular', Consolas, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow-x: hidden; }

body {
    background: var(--auth-bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--auth-text);
}

/* ── Backdrop: dot grid + one glow behind the hub ────────────────────────── */
.auth-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.auth-bg::before {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 28px 28px;
    -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, #000 30%, transparent 100%);
            mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, #000 30%, transparent 100%);
}
.auth-bg::after {
    content: '';
    position: absolute; top: 50%; left: 50%;
    width: 980px; height: 760px;
    transform: translate(-50%, -50%);
    background:
        radial-gradient(ellipse 46% 50% at 50% 50%, rgba(139,92,246,.17) 0%, transparent 70%),
        radial-gradient(ellipse 30% 34% at 22% 40%, rgba(56,189,248,.05) 0%, transparent 70%),
        radial-gradient(ellipse 30% 34% at 80% 62%, rgba(236,72,153,.06) 0%, transparent 70%);
}

/* ── Page shell ──────────────────────────────────────────────────────────── */
.auth-page {
    position: relative; z-index: 1;
    min-height: 100vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 2.25rem 1rem 1.75rem;
}

.auth-brand-row {
    display: flex; flex-direction: column; align-items: center;
    margin-bottom: 1.6rem;
}
.auth-brand {
    display: inline-flex; align-items: center;
    text-decoration: none; color: var(--auth-accent);
    font-size: 1.3rem; font-weight: 800; letter-spacing: .04em;
}
.auth-brand-tagline {
    margin-top: .4rem;
    font-size: .64rem; letter-spacing: .16em; text-transform: uppercase;
    color: var(--auth-dim);
}

/* ══ STAGE: sources │ hub (the card) │ accounts ══════════════════════════ */
.auth-stage {
    position: relative;
    width: 100%; max-width: 1240px;
    display: grid;
    grid-template-columns: minmax(0, 440px);
    justify-content: center;
    align-items: center;
}
.auth-side  { display: none; }
.auth-wires { display: none; }

.auth-hub { position: relative; width: 100%; z-index: 2; }

/* Ports — where the wires meet the card */
.auth-port {
    display: none;
    position: absolute; top: 50%;
    width: 11px; height: 11px; margin-top: -5.5px;
    border-radius: 50%;
    background: #0d1020;
    border: 2px solid var(--auth-accent-bright);
    box-shadow: 0 0 0 4px rgba(139,92,246,.14), 0 0 14px rgba(139,92,246,.55);
    z-index: 3;
    transition: box-shadow .3s, background .3s;
}
.auth-port-in  { left: -6px; }
.auth-port-out { right: -6px; }
.auth-port.is-live {
    background: var(--auth-accent-pale);
    box-shadow: 0 0 0 7px rgba(139,92,246,.20), 0 0 26px rgba(167,139,250,.95);
}

@media (min-width: 1160px) {
    .auth-stage {
        grid-template-columns: minmax(0, 1fr) minmax(0, 440px) minmax(0, 1fr);
        justify-content: stretch;
        padding: 0 1.5rem;
    }
    .auth-side {
        display: flex; flex-direction: column;
        position: relative; z-index: 2;
    }
    .auth-side-in  { align-items: flex-start; gap: 3.4rem; }
    .auth-side-out { align-items: flex-end;   gap: 1.15rem; }
    /* Outer accounts sit a little closer, so the fan reads as an arc */
    .auth-side-out .cp-node:first-child,
    .auth-side-out .cp-node:last-child { margin-right: 26px; }

    .auth-wires {
        display: block;
        position: absolute; inset: 0;
        width: 100%; height: 100%;
        overflow: visible; pointer-events: none; z-index: 1;
    }
    .auth-port { display: block; }
}

/* Just past the breakpoint the columns are narrow: slimmer chips keep room for the wires */
@media (min-width: 1160px) and (max-width: 1279.98px) {
    .cp-node { width: 222px; }
    .auth-side-out .cp-node:first-child,
    .auth-side-out .cp-node:last-child { margin-right: 18px; }
}

/* ── Wires ───────────────────────────────────────────────────────────────── */
.auth-wire {
    fill: none;
    stroke: rgba(167,139,250,.24);
    stroke-width: 1.25;
}
.auth-wire-pulse {
    fill: none;
    stroke: var(--auth-accent-pale);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 12 120;      /* pathLength is normalised to 100 */
    stroke-dashoffset: 12;
    opacity: 0;
    filter: drop-shadow(0 0 5px rgba(167,139,250,.95));
}
.auth-wire-end { fill: #0d1020; stroke: rgba(167,139,250,.55); stroke-width: 1.5; }

/* ── Chips: signal sources and trading accounts ──────────────────────────── */
.cp-node {
    width: 238px;
    padding: .8rem .9rem;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(23,27,48,.94) 0%, rgba(14,17,32,.94) 100%);
    border: 1px solid rgba(255,255,255,.09);
    box-shadow: 0 14px 34px rgba(0,0,0,.46), inset 0 1px 0 rgba(255,255,255,.05);
    transition: border-color .35s ease, box-shadow .35s ease;
    user-select: none;
}
.cp-node.is-live {
    border-color: rgba(167,139,250,.60);
    box-shadow: 0 14px 34px rgba(0,0,0,.46), 0 0 0 3px rgba(139,92,246,.13), 0 0 36px rgba(139,92,246,.26), inset 0 1px 0 rgba(255,255,255,.06);
}
.cp-node.is-hit {
    border-color: rgba(34,211,155,.50);
    box-shadow: 0 14px 34px rgba(0,0,0,.46), 0 0 0 3px rgba(34,211,155,.10), 0 0 30px rgba(34,211,155,.16), inset 0 1px 0 rgba(255,255,255,.06);
}

.cp-source { display: flex; align-items: flex-start; gap: .7rem; }
.cp-ico {
    width: 36px; height: 36px; flex-shrink: 0;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem;
}
.cp-ico-tg     { color: #38bdf8; background: rgba(56,189,248,.12); border: 1px solid rgba(56,189,248,.26); }
.cp-ico-master { color: var(--auth-accent-bright); background: rgba(139,92,246,.14); border: 1px solid rgba(139,92,246,.30); }

.cp-body { display: flex; flex-direction: column; min-width: 0; }
.cp-eyebrow {
    font-size: .6rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--auth-muted); margin-bottom: .28rem;
}
.cp-line {
    font-family: var(--auth-mono);
    font-size: .8rem; font-weight: 600; color: #e6ecf4;
    white-space: nowrap; line-height: 1.35;
}
.cp-sub {
    font-family: var(--auth-mono);
    font-size: .68rem; color: var(--auth-muted);
    white-space: nowrap; margin-top: .18rem;
}
.cp-dim  { color: var(--auth-muted); font-weight: 500; }
.cp-side { font-weight: 700; }
.cp-side.buy  { color: var(--auth-buy); }
.cp-side.sell { color: var(--auth-sell); }
.cp-node.is-live .cp-line,
.cp-node.is-hit  .cp-line { animation: cpSwap .45s ease; }
@keyframes cpSwap {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}

.cp-acc-head { display: flex; align-items: center; gap: .45rem; margin-bottom: .42rem; }
.cp-plat {
    font-family: var(--auth-mono);
    font-size: .6rem; font-weight: 600; letter-spacing: .04em;
    color: var(--auth-accent-pale);
    background: rgba(139,92,246,.16); border: 1px solid rgba(139,92,246,.30);
    border-radius: 6px; padding: .08rem .36rem;
}
.cp-accno { font-family: var(--auth-mono); font-size: .7rem; color: var(--auth-muted); }
.cp-status {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: .32rem;
    font-size: .64rem; font-weight: 600; color: var(--auth-buy);
}
.cp-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.cp-node.is-pending .cp-status { color: var(--auth-accent-bright); }
.cp-node.is-pending .cp-dot    { animation: cpBlink .7s ease-in-out infinite; }
@keyframes cpBlink { 50% { opacity: .25; } }
.cp-account .cp-line { display: flex; align-items: baseline; gap: .4rem; }
.cp-lot { margin-left: auto; color: var(--auth-muted); font-weight: 500; font-size: .72rem; }

/* ── Emblem: the same picture in miniature, for screens without the stage ── */
.auth-emblem { display: block; width: 168px; height: 56px; margin: 0 auto 1.25rem; }
.auth-emblem-wire  { fill: none; stroke: rgba(167,139,250,.30); stroke-width: 1.25; }
.auth-emblem-pulse {
    fill: none; stroke: var(--auth-accent-pale); stroke-width: 2.25; stroke-linecap: round;
    stroke-dasharray: 14 120; stroke-dashoffset: 14;
    animation: emblemPulse 2.6s cubic-bezier(.45,0,.25,1) infinite;
}
.auth-emblem-pulse.p2 { animation-delay: .12s; }
.auth-emblem-pulse.p3 { animation-delay: .24s; }
@keyframes emblemPulse {
    0%        { stroke-dashoffset: 14; }
    45%, 100% { stroke-dashoffset: -100; }
}
.auth-emblem-acc { fill: rgba(139,92,246,.16); stroke: rgba(167,139,250,.50); stroke-width: 1; }
@media (min-width: 1160px) { .auth-emblem { display: none; } }

/* ══ CARD ════════════════════════════════════════════════════════════════ */
.auth-card {
    width: 100%; max-width: 440px; margin: 0 auto;
    position: relative; z-index: 1;
    border-radius: 22px; overflow: hidden;
    background: var(--auth-card);
    backdrop-filter: blur(28px) saturate(1.6);
    -webkit-backdrop-filter: blur(28px) saturate(1.6);
    border: 1px solid var(--auth-border);
    box-shadow:
        0 0 0 1px rgba(139,92,246,.05),
        0 24px 64px rgba(0,0,0,.70),
        0 0 90px rgba(139,92,246,.10),
        inset 0 1px 0 rgba(255,255,255,.07);
}
/* Brand sweep along the top edge */
.auth-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent 0%, #7b4dff 22%, #c471ed 55%, #ff914d 80%, transparent 100%);
    opacity: .85;
}
.auth-card::after {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 160px;
    background: radial-gradient(ellipse 75% 100% at 50% 0%, rgba(139,92,246,.09) 0%, transparent 100%);
    pointer-events: none;
}

.auth-card-body   { padding: 2.2rem 2.1rem 1.7rem; position: relative; z-index: 1; }
.auth-card-footer {
    padding: 1rem 2.1rem 1.15rem;
    border-top: 1px solid rgba(255,255,255,.06);
    background: rgba(0,0,0,.20);
    text-align: center; position: relative; z-index: 1;
}

/* ── Icon badge (confirmation / error pages) ─────────────────────────────── */
.auth-icon-badge {
    width: 64px; height: 64px; border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.35rem; font-size: 1.55rem;
    position: relative;
}
.auth-icon-badge.green {
    background: rgba(139,92,246,.13); border: 1px solid rgba(139,92,246,.36);
    color: var(--auth-accent-bright); box-shadow: 0 0 34px rgba(139,92,246,.24);
}
.auth-icon-badge.teal {
    background: rgba(167,139,250,.11); border: 1px solid rgba(167,139,250,.32);
    color: #a78bfa; box-shadow: 0 0 30px rgba(167,139,250,.22);
}
.auth-icon-badge.red {
    background: rgba(248,113,113,.11); border: 1px solid rgba(248,113,113,.32);
    color: #f87171; box-shadow: 0 0 28px rgba(248,113,113,.20);
}
.auth-icon-badge.blue {
    background: rgba(96,165,250,.11); border: 1px solid rgba(96,165,250,.32);
    color: #60a5fa; box-shadow: 0 0 28px rgba(96,165,250,.20);
}
.auth-icon-badge.amber {
    background: rgba(251,191,36,.11); border: 1px solid rgba(251,191,36,.30);
    color: #fbbf24; box-shadow: 0 0 26px rgba(251,191,36,.18);
}

/* ── Headings ────────────────────────────────────────────────────────────── */
.auth-title {
    font-size: 1.6rem; font-weight: 800; color: #fff;
    text-align: center; letter-spacing: -.028em; margin: 0 0 .4rem;
}
.auth-subtitle {
    font-size: .88rem; color: var(--auth-muted);
    text-align: center; margin-bottom: 1.75rem; line-height: 1.58;
    text-wrap: balance;
}

/* ── Fields ──────────────────────────────────────────────────────────────── */
.auth-field { position: relative; margin-bottom: 1.05rem; }
/* The icon centres on this box, not .auth-field — that one also holds the label. */
.auth-input-wrap { position: relative; }
.auth-field-icon {
    position: absolute; left: .95rem; top: 50%; transform: translateY(-50%);
    color: var(--auth-dim); font-size: .9rem; pointer-events: none;
    transition: color .2s; z-index: 2;
}
.auth-field:focus-within .auth-field-icon { color: var(--auth-accent-bright); }

.auth-label {
    display: flex; align-items: center; gap: .35rem;
    font-size: .8rem; font-weight: 600; color: var(--auth-body);
    margin-bottom: .4rem;
}
.auth-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.auth-row .auth-label { margin-bottom: 0; }

.auth-input {
    display: block; width: 100%;
    background: var(--auth-field-bg) !important;
    border: 1px solid rgba(255,255,255,.13) !important;
    border-radius: 12px !important;
    color: #e6ecf4 !important;
    font-size: .95rem; font-family: inherit;
    padding: .74rem .95rem .74rem 2.65rem;
    transition: border-color .2s, box-shadow .2s, background .2s;
    outline: none; -webkit-appearance: none; appearance: none;
}
.auth-input::placeholder { color: var(--auth-dim) !important; }
.auth-input:hover:not(:focus) {
    border-color: rgba(255,255,255,.22) !important;
    background: var(--auth-field-hover) !important;
}
.auth-input:focus {
    border-color: rgba(139,92,246,.70) !important;
    background: var(--auth-field-focus) !important;
    box-shadow: 0 0 0 3.5px rgba(139,92,246,.18) !important;
}
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus,
.auth-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #12162a inset !important;
    -webkit-text-fill-color: #e6ecf4 !important;
    border-color: rgba(139,92,246,.40) !important;
    transition: background-color 99999s 0s;
}
.auth-input.no-icon { padding-left: .95rem; }

.auth-pw-wrap { position: relative; }
.auth-pw-wrap .auth-input { padding-right: 2.9rem; }
.auth-pw-toggle {
    position: absolute; right: .45rem; top: 50%; transform: translateY(-50%);
    width: 2rem; height: 2rem;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; border-radius: 8px; padding: 0; cursor: pointer;
    color: var(--auth-dim); font-size: 1rem; line-height: 1; transition: color .15s; z-index: 2;
}
.auth-pw-toggle:hover { color: var(--auth-accent-bright); }
.auth-pw-toggle:focus-visible { outline: 2px solid var(--auth-accent-bright); outline-offset: 1px; }

.auth-strength-wrap { margin-top: .5rem; }
.auth-strength-bar {
    height: 3px; border-radius: 99px;
    background: rgba(255,255,255,.08); overflow: hidden; margin-bottom: .32rem;
}
.auth-strength-fill { height: 100%; border-radius: 99px; width: 0%; transition: width .38s ease, background .38s ease; }
.auth-strength-txt  { font-size: .7rem; color: var(--auth-muted); }

/* ── Checkbox ────────────────────────────────────────────────────────────── */
.auth-check { display: flex; align-items: center; gap: .5rem; }
.auth-check input[type=checkbox],
.auth-check-native {
    width: 16px; height: 16px; flex-shrink: 0; margin: 0;
    accent-color: var(--auth-accent); cursor: pointer;
}
.auth-check label { font-size: .82rem; color: var(--auth-muted); cursor: pointer; margin: 0; line-height: 1.3; user-select: none; }

/* ── Primary button ──────────────────────────────────────────────────────── */
.auth-btn {
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    width: 100%;
    background: linear-gradient(118deg, #7b4dff 0%, #8b5cf6 38%, #a855f7 68%, #ec4899 100%);
    border: none; border-radius: 50px;
    color: #fff !important; font-weight: 700; font-size: .95rem; letter-spacing: .01em;
    padding: .82rem 1rem;
    cursor: pointer;
    transition: box-shadow .22s, transform .14s, filter .15s;
    box-shadow: 0 0 30px rgba(139,92,246,.34), 0 8px 26px rgba(0,0,0,.42);
    text-decoration: none; text-align: center; margin-top: 1.45rem;
}
.auth-btn:hover {
    box-shadow: 0 0 46px rgba(139,92,246,.52), 0 10px 32px rgba(0,0,0,.50);
    transform: translateY(-1px); filter: brightness(1.07);
}
.auth-btn:active   { transform: translateY(0); filter: brightness(.96); }
.auth-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.auth-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; filter: none; }
/* Older pages centre their icon with Bootstrap's me-* spacing */
.auth-btn i[class*="me-"] { margin-right: 0 !important; }

/* ── Links ───────────────────────────────────────────────────────────────── */
.auth-link {
    color: var(--auth-accent-bright); font-weight: 700; text-decoration: none; font-size: .85rem;
    transition: color .15s;
}
.auth-link:hover { color: var(--auth-accent-pale); text-decoration: underline; }
.auth-link-dim { color: var(--auth-muted); font-size: .82rem; text-decoration: none; transition: color .15s; }
.auth-link-dim:hover { color: #c3cedb; }

/* ── Validation and notices ──────────────────────────────────────────────── */
.auth-err { color: #f87171; font-size: .76rem; margin-top: .34rem; display: block; }
.auth-err:empty { display: none; }
.auth-err-box {
    background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.24);
    border-radius: 12px; padding: .7rem .95rem; margin-bottom: 1.1rem;
    color: #fca5a5; font-size: .82rem;
}
.auth-err-box ul { margin: 0; padding-left: 1.1rem; }
/* An empty summary still renders its box */
.auth-err-box.validation-summary-valid { display: none; }
.auth-success-box {
    background: rgba(34,211,155,.07); border: 1px solid rgba(34,211,155,.22);
    border-radius: 12px; padding: .7rem .95rem; margin-bottom: 1.1rem;
    color: #22d39b; font-size: .82rem;
    display: flex; align-items: flex-start; gap: .5rem;
}
.auth-success-box i { flex-shrink: 0; margin-top: .1rem; }

.auth-trust-strip {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
    gap: .28rem .64rem; margin-top: 1.15rem;
    font-size: .68rem; color: var(--auth-dim); letter-spacing: .03em;
}
.auth-trust-strip i { font-size: .68rem; margin-right: .2rem; }
.auth-trust-dot { width: 3px; height: 3px; border-radius: 50%; background: #3a4b5c; flex-shrink: 0; }

/* ── Misc ────────────────────────────────────────────────────────────────── */
.auth-hr { border: 0; border-top: 1px solid rgba(139,92,246,.10); margin: 1.1rem 0; }
.auth-footer-text { font-size: .85rem; color: var(--auth-muted); }
.auth-hint        { font-size: .72rem; color: var(--auth-dim); margin-top: .28rem; line-height: 1.45; }
.auth-page-footer { font-size: .7rem; color: var(--auth-dim); text-align: center; margin-top: 1.6rem; }

.auth-dev-alert {
    background: rgba(251,191,36,.06); border: 1px solid rgba(251,191,36,.18);
    border-radius: 12px; padding: .78rem 1rem;
    font-size: .76rem; color: #fbbf24; text-align: left; margin-top: .75rem;
}
.auth-dev-alert a { color: var(--auth-accent-bright); word-break: break-all; }

/* ── Small screens ───────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    /* 16px keeps iOS from zooming the page when a field takes focus */
    .auth-input { font-size: 16px; }
}
@media (max-width: 480px) {
    .auth-page        { padding: 1.5rem .85rem 1.25rem; }
    .auth-card-body   { padding: 1.8rem 1.3rem 1.35rem; }
    .auth-card-footer { padding: .9rem 1.3rem 1.05rem; }
    .auth-title       { font-size: 1.42rem; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-emblem-pulse { animation: none; opacity: 0; }
    .cp-node.is-live .cp-line,
    .cp-node.is-hit  .cp-line,
    .cp-node.is-pending .cp-dot { animation: none; }
    .auth-btn, .cp-node, .auth-port { transition: none; }
}
