/* ══════════════════════════════════════════════════════════════════════════
   Auth pages (login / register) — premium AI trading theme

   Reads the shared --dash-* palette from dash-tokens.css, which the auth
   layout links just before this file. Same tokens the dashboard uses, so the
   two surfaces stay in step: change a token there and both re-skin.

   Layout note: .auth-modern is the page wrapper; the form sits in a single
   .card that the layout renders. Everything here is scoped under
   .auth-modern so the stock Sneat auth CSS is only overridden on these pages.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Page canvas ──────────────────────────────────────────────────────────
   Layered bottom-to-top: flat black base, two wide pools of blue/purple
   light, then the artwork. The overlay gradient sits ABOVE the photo so the
   card never has to fight a busy background for contrast.

   The background photo is optional — until the file exists the gradients
   alone already render the intended look, so a missing image degrades
   cleanly rather than showing a broken page. */
.auth-modern {
    position: relative;
    min-height: 100vh;
    background-color: var(--dash-bg-0) !important;
    background-image:
        radial-gradient(900px 700px at 12% -5%, rgba(var(--dash-accent-rgb), 0.16) 0%, transparent 60%),
        radial-gradient(800px 650px at 92% 105%, rgba(var(--dash-accent-3-rgb), 0.13) 0%, transparent 60%),
        url("../img/illustrations/auth-bg.png");
    background-size: 100% 100%, 100% 100%, cover;
    background-position: center, center, center;
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-attachment: scroll, scroll, fixed;
}

/* Faint terminal grid over the artwork, fading out toward the bottom */
.auth-modern::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(var(--dash-accent-rgb), 0.030) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--dash-accent-rgb), 0.030) 1px, transparent 1px);
    background-size: 40px 40px, 40px 40px;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 100%);
}

.auth-modern > * {
    position: relative;
    z-index: 1;
}

/* ── The card ─────────────────────────────────────────────────────────────
   Smoked blue glass over black, rimmed in accent light with a wide outer
   bloom — the single focal element on the page. */
.auth-modern .card {
    position: relative;
    background-color: rgba(6, 10, 20, 0.82) !important;
    background-image:
        linear-gradient(158deg, rgba(var(--dash-accent-rgb), 0.08) 0%, rgba(var(--dash-accent-rgb), 0.02) 42%, transparent 100%) !important;
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
    border: 1px solid rgba(var(--dash-accent-rgb), 0.34) !important;
    border-radius: 1.5rem !important;
    box-shadow:
        inset 0 1px 0 0 rgba(var(--dash-accent-soft-rgb), 0.14),
        0 24px 70px rgba(0, 0, 0, 0.75),
        0 0 0 1px rgba(var(--dash-accent-rgb), 0.10),
        0 0 60px -10px rgba(var(--dash-accent-rgb), 0.45);
    overflow: hidden;
}

/* Bright light streak along the top edge */
.auth-modern .card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(var(--dash-accent-2-rgb), 0.9), rgba(var(--dash-accent-soft-rgb), 0.7), transparent);
}

.auth-modern .card-body {
    color: var(--dash-text);
    padding: 2.25rem 2rem;
}

/* ── Typography ───────────────────────────────────────────────────────── */
.auth-modern h4,
.auth-modern h5,
.auth-modern h6 {
    color: var(--dash-text-bright);
    letter-spacing: -0.02em;
    font-weight: 700;
}

.auth-modern .form-label,
.auth-modern label {
    color: var(--dash-text-soft);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

/* The inline "Forgot Password?" / "Generate Password" links sit on the same
   row as a .form-label — keep them sentence-case link styling, not caps. */
.auth-modern .form-label + a,
.auth-modern .d-flex > a {
    text-transform: none;
    letter-spacing: normal;
}

.auth-modern p,
.auth-modern small {
    color: var(--dash-text-muted);
}

.auth-modern .text-center span {
    color: var(--dash-text-muted);
}

.auth-modern a {
    color: var(--dash-accent-soft);
    text-decoration: none;
    transition: color 0.18s ease;
}

.auth-modern a:hover {
    color: var(--dash-accent-tint);
}

/* ── Inputs ───────────────────────────────────────────────────────────── */
.auth-modern .form-control {
    background: rgba(0, 0, 0, 0.45) !important;
    border: 1px solid rgba(var(--dash-accent-rgb), 0.22) !important;
    color: var(--dash-text) !important;
    border-radius: 0.75rem;
    padding: 0.7rem 0.95rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.auth-modern .form-control::placeholder {
    color: var(--dash-text-dim);
}

.auth-modern .form-control:focus {
    background: rgba(0, 0, 0, 0.55) !important;
    border-color: rgba(var(--dash-accent-rgb), 0.75) !important;
    box-shadow: 0 0 0 3px rgba(var(--dash-accent-rgb), 0.18), 0 0 18px -4px rgba(var(--dash-accent-rgb), 0.55) !important;
    color: var(--dash-text) !important;
}

/* Leading icon chip inside .input-group (the person / lock glyphs) */
.auth-modern .input-group-text {
    background: rgba(0, 0, 0, 0.45) !important;
    border: 1px solid rgba(var(--dash-accent-rgb), 0.22) !important;
    color: var(--dash-accent-soft) !important;
}

.auth-modern .input-group > .input-group-text:first-child {
    border-right: 0 !important;
    border-radius: 0.75rem 0 0 0.75rem;
}

.auth-modern .input-group > .input-group-text:last-child {
    border-left: 0 !important;
    border-radius: 0 0.75rem 0.75rem 0;
    cursor: pointer;
}

/* Middle field in a 3-part group (icon + input + toggle) has no rounding;
   :first-child/:last-child below re-round the true outer edges. */
.auth-modern .input-group > .form-control {
    border-radius: 0;
    border-left: 0 !important;
    border-right: 0 !important;
}

.auth-modern .input-group > .form-control:first-child {
    border-left: 1px solid rgba(var(--dash-accent-rgb), 0.22) !important;
    border-radius: 0.75rem 0 0 0.75rem;
}

.auth-modern .input-group > .form-control:last-child {
    border-right: 1px solid rgba(var(--dash-accent-rgb), 0.22) !important;
    border-radius: 0 0.75rem 0.75rem 0;
}

/* Focus ring belongs to the whole group, not just the <input> */
.auth-modern .input-group:focus-within > .form-control,
.auth-modern .input-group:focus-within > .input-group-text {
    border-color: rgba(var(--dash-accent-rgb), 0.75) !important;
}

.auth-modern .input-group:focus-within {
    border-radius: 0.75rem;
    box-shadow: 0 0 0 3px rgba(var(--dash-accent-rgb), 0.18), 0 0 18px -4px rgba(var(--dash-accent-rgb), 0.55);
}

.auth-modern .input-group:focus-within > .form-control {
    box-shadow: none !important;
}

/* ── Primary button ───────────────────────────────────────────────────── */
.auth-modern .btn-primary {
    border: 0;
    border-radius: 0.85rem;
    padding: 0.8rem 1.5rem;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.01em;
    background: var(--dash-gradient);
    box-shadow: 0 4px 20px rgba(var(--dash-accent-rgb), 0.40), 0 0 26px -6px rgba(var(--dash-accent-3-rgb), 0.55);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: #fff;
}

.auth-modern .btn-primary:hover,
.auth-modern .btn-primary:focus {
    transform: translateY(-1px);
    background: var(--dash-gradient);
    box-shadow: 0 8px 28px rgba(var(--dash-accent-rgb), 0.55), 0 0 34px -4px rgba(var(--dash-accent-3-rgb), 0.65);
    color: #fff;
}

.auth-modern .btn-primary:active {
    transform: translateY(0);
}

/* ── Checkbox ─────────────────────────────────────────────────────────── */
.auth-modern .form-check-input {
    background-color: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(var(--dash-accent-rgb), 0.35);
    border-radius: 0.3rem;
}

.auth-modern .form-check-input:checked {
    background-color: var(--dash-accent);
    border-color: var(--dash-accent);
    box-shadow: 0 0 12px -2px rgba(var(--dash-accent-rgb), 0.7);
}

.auth-modern .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(var(--dash-accent-rgb), 0.18);
}

.auth-modern .form-check-label {
    color: var(--dash-text-muted);
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.9rem;
    font-weight: 400;
}

/* ── Validation / alerts ──────────────────────────────────────────────── */
.auth-modern .text-danger {
    color: var(--dash-danger-soft) !important;
}

.auth-modern .validation-summary-errors ul {
    margin-bottom: 0;
    padding-left: 1.25rem;
}

.auth-modern .alert-danger {
    background: rgba(var(--dash-danger-rgb), 0.12);
    border: 1px solid rgba(var(--dash-danger-rgb), 0.35);
    color: var(--dash-danger-pale);
    border-radius: 0.75rem;
}

/* ── Logo header ──────────────────────────────────────────────────────── */
.auth-modern header {
    text-align: center;
}

.auth-modern header a {
    display: inline-block;
    margin-bottom: 1.75rem;
}

/* ── Divider ("or continue with") ─────────────────────────────────────── */
.auth-modern hr {
    border-color: rgba(var(--dash-accent-rgb), 0.22);
    opacity: 1;
}

/* ── Social sign-in buttons ───────────────────────────────────────────── */
.auth-modern .social-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(var(--dash-accent-rgb), 0.22);
    border-radius: 0.75rem;
    color: var(--dash-text-soft);
    font-size: 14px;
    font-weight: 500;
    padding: 11px 16px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    letter-spacing: 0.01em;
    text-decoration: none;
}

.auth-modern .social-login-btn:hover {
    background: rgba(var(--dash-accent-rgb), 0.10);
    border-color: rgba(var(--dash-accent-rgb), 0.45);
    color: var(--dash-text-bright);
}

.auth-modern .social-login-btn:active {
    background: rgba(var(--dash-accent-rgb), 0.16);
    transform: scale(0.99);
}

/* ── Trust footer ─────────────────────────────────────────────────────── */
.auth-modern .auth-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(var(--dash-accent-rgb), 0.18);
    text-align: left;
}

.auth-modern .auth-trust i {
    font-size: 1.35rem;
    color: var(--dash-accent-soft);
    filter: drop-shadow(0 0 10px rgba(var(--dash-accent-rgb), 0.55));
    flex-shrink: 0;
}

.auth-modern .auth-trust p {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--dash-text-muted);
}

@media (max-width: 575.98px) {
    .auth-modern .card-body {
        padding: 1.5rem 1.25rem;
    }
}
