/* =========================================================
   XevoNet — Auth pages (login / signup)
   Split layout: black narrative left, theme-aware form right.
   The left panel has a signature: a slow, liquid colour gradient
   that washes through the six product accents.
   ========================================================= */

body.auth {
    background: var(--bg-base);
    color: var(--txt);
    overflow: hidden;
}

.auth-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    width: 100%;
}

/* ---------- Left (narrative, forced dark, with liquid gradient) ---------- */

.auth-left {
    /* Forced dark to keep the dramatic split.  The gradient layered
       on top is the page signature. */
    background: #000;
    color: #f5f5f7;
    padding: 56px 64px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* Signature liquid gradient — slowly drifts across the six product
   accents.  Heavy blur + saturated dots that drift in opposite
   directions. */
.auth-left::before,
.auth-left::after {
    content: "";
    position: absolute;
    inset: -20%;
    z-index: 0;
    pointer-events: none;
    filter: blur(80px) saturate(140%);
    opacity: 0.55;
    will-change: transform;
}
.auth-left::before {
    background:
        radial-gradient(40% 50% at 20% 30%, #7c5cff 0%, transparent 60%),
        radial-gradient(40% 50% at 80% 70%, #4d9c8f 0%, transparent 60%),
        radial-gradient(40% 50% at 50% 50%, #d97a64 0%, transparent 60%);
    animation: authDrift1 24s ease-in-out infinite alternate;
}
.auth-left::after {
    background:
        radial-gradient(40% 50% at 70% 30%, #9b7be0 0%, transparent 60%),
        radial-gradient(40% 50% at 30% 80%, #bf9248 0%, transparent 60%),
        radial-gradient(40% 50% at 60% 60%, #5a86e6 0%, transparent 60%);
    animation: authDrift2 30s ease-in-out infinite alternate;
    mix-blend-mode: screen;
}

@keyframes authDrift1 {
    0%   { transform: translate3d(-4%, -2%, 0) scale(1);    }
    100% { transform: translate3d( 6%,  3%, 0) scale(1.08); }
}
@keyframes authDrift2 {
    0%   { transform: translate3d( 4%,  2%, 0) scale(1.04); }
    100% { transform: translate3d(-6%, -3%, 0) scale(1);    }
}

.auth-left > * { position: relative; z-index: 2; }

.auth-left .brand {
    color: #f5f5f7;
}
.auth-left .brand-name { color: #f5f5f7 !important; }
.auth-tagline { z-index: 2; }
.auth-tagline h2 {
    font-family: var(--font-sans);
    font-size: clamp(36px, 4.6vw, 56px);
    font-weight: 600;
    line-height: 1.06;
    letter-spacing: -0.022em;
    margin: 0 0 16px;
    max-width: 18ch;
    color: #f5f5f7;
}
.auth-tagline p {
    font-size: 17px;
    color: rgba(245, 245, 247, 0.72);
    line-height: 1.5;
    margin: 0;
    max-width: 36ch;
}
.auth-credits {
    z-index: 2;
    font-size: 12px;
    color: rgba(245, 245, 247, 0.5);
    letter-spacing: 0.04em;
}

/* ---------- Right (form, theme-aware) ---------- */

.auth-right {
    background: var(--bg-base);
    padding: 56px 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    position: relative;
}

/* Theme toggle floats top-right of the form pane */
.auth-toggle-slot {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 3;
}

.auth-form-wrap {
    width: 100%;
    max-width: 400px;
}
.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--txt-dim);
    font-size: 13px;
    margin-bottom: 40px;
    transition: color var(--dur-fast) var(--ease-out);
}
.auth-back:hover { color: var(--txt); }

.auth-form-wrap h1 {
    font-family: var(--font-sans);
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.018em;
    color: var(--txt);
    margin: 0 0 8px;
}
.auth-form-wrap .auth-sub {
    font-size: 15px;
    color: var(--txt-dim);
    margin: 0 0 32px;
}

.form { display: flex; flex-direction: column; gap: 14px; }
.form .field { display: flex; flex-direction: column; gap: 6px; }
.form .field label {
    font-size: 13px;
    font-weight: 500;
    color: var(--txt-dim);
}
.form .field input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--bg-elev);
    border: 1px solid var(--hairline-strong);
    color: var(--txt);
    font: inherit;
    font-size: 15px;
    transition: border-color var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}
.form .field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--txt-dim);
}
.form-row .forgot {
    color: var(--accent);
    font-weight: 500;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: var(--txt-dim);
}
.checkbox input {
    position: absolute;
    width: 0; height: 0;
    opacity: 0;
}
.checkbox .box {
    width: 16px; height: 16px;
    border-radius: 4px;
    border: 1.5px solid var(--txt-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elev);
    transition: background var(--dur-fast), border-color var(--dur-fast);
}
.checkbox input:checked + .box {
    background: var(--accent);
    border-color: var(--accent);
}
.checkbox input:checked + .box::after {
    content: "";
    width: 8px; height: 4px;
    border-left: 1.5px solid #fff;
    border-bottom: 1.5px solid #fff;
    transform: rotate(-45deg) translate(1px, -1px);
}

.form-error {
    padding: 12px 14px;
    background: rgba(196, 75, 75, 0.10);
    color: #c44b4b;
    border: 1px solid rgba(196, 75, 75, 0.25);
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.auth-submit {
    margin-top: 12px;
    width: 100%;
    justify-content: center;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    font-size: 12px;
    color: var(--txt-soft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--hairline);
}

.social-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    border: 1px solid var(--hairline-strong);
    background: var(--bg-elev);
    color: var(--txt);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out);
    font-family: inherit;
}
.social-btn:hover { background: var(--bg-elev-2); }

.auth-foot {
    margin-top: 28px;
    font-size: 14px;
    color: var(--txt-dim);
    text-align: center;
}
.auth-foot a {
    color: var(--accent);
    font-weight: 500;
}

/* ---------- Spinner + shake (used by auth-pages.js) ---------- */
.spinner {
    width: 14px; height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: authSpin 0.6s linear infinite;
    margin-right: 6px;
    vertical-align: -3px;
}
@keyframes authSpin { to { transform: rotate(360deg); } }
@keyframes authShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
.form-error.shake { animation: authShake 0.45s var(--ease-out); }

/* ---------- Mobile ---------- */
@media (max-width: 880px) {
    body.auth { overflow: auto; }
    .auth-shell { grid-template-columns: 1fr; min-height: auto; }
    .auth-left { padding: 40px 32px; min-height: 280px; }
    .auth-right { padding: 32px; min-height: auto; }
    .auth-tagline { margin: 32px 0; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .auth-left::before,
    .auth-left::after { animation: none !important; }
}
