:root {
    --bg: #000;
    --surface: #121212;
    --surface-2: #1a1a1a;
    --border: #2a2a2a;
    --text: #fff;
    --muted: #a7a7a7;
    --accent: #7ed957;
    --accent-hover: #93e86d;
    --accent-ink: #0b1a05;
    --danger: #ff5d5d;
    --warning: #ffcc4d;
    --radius: 14px;
    --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}

svg { width: 1em; height: 1em; flex-shrink: 0; }
[hidden] { display: none !important; }

.auth {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
}

/* ---------- Visual ---------- */
.auth-visual {
    position: relative;
    overflow: hidden;
    padding: 40px 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    background:
        radial-gradient(60% 50% at 20% 10%, rgba(123, 108, 255, .28), transparent 70%),
        radial-gradient(50% 45% at 85% 90%, rgba(255, 106, 61, .22), transparent 70%),
        #070707;
}

.auth-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 22px; }
.brand-mark {
    width: 42px; height: 42px; border-radius: 12px;
    display: grid; place-items: center;
    background: var(--accent); color: var(--accent-ink); font-size: 22px;
}
.auth-brand--mobile { display: none; }

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    max-width: 760px;
}

.card {
    position: relative;
    aspect-ratio: 3 / 4.2;
    border-radius: 28px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .8);
    animation: float 7s ease-in-out infinite;
}
.card:nth-child(2) { animation-delay: -1.5s; transform: translateY(24px); }
.card:nth-child(3) { animation-delay: -3s; }
.card:nth-child(4) { animation-delay: -4.5s; transform: translateY(24px); }

.card--violet { background: linear-gradient(160deg, #8f82ff, #6152f0); }
.card--blue { background: linear-gradient(160deg, #3a5bff, #1f3df0); }
.card--orange { background: linear-gradient(160deg, #ffb02e, #ff8a00); }
.card--red { background: linear-gradient(160deg, #ff7d50, #ff5a2c); }

.card-meta { font-size: 12px; font-weight: 600; opacity: .9; }
.card-icon {
    position: absolute; right: -10%; top: 22%;
    width: 78%; height: auto; opacity: .22; stroke-width: 1.4;
}
.card-foot { display: flex; align-items: center; gap: 10px; position: relative; }
.card-foot strong { display: block; font-size: 14px; }
.card-foot small { display: block; font-size: 11px; opacity: .85; }
.card-play {
    width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center; flex-shrink: 0;
    background: var(--accent); color: var(--accent-ink);
}
.card-play svg { fill: currentColor; }

@keyframes float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -10px; }
}

.auth-tagline h2 { margin: 16px 0 10px; font-size: clamp(28px, 3vw, 40px); line-height: 1.1; letter-spacing: -.02em; }
.auth-tagline p { margin: 0; color: var(--muted); max-width: 440px; line-height: 1.5; }

.eq { display: flex; align-items: flex-end; gap: 4px; height: 28px; }
.eq span {
    width: 5px; border-radius: 3px; background: var(--accent);
    animation: eq 1.1s ease-in-out infinite;
}
.eq span:nth-child(1) { animation-delay: -.2s; }
.eq span:nth-child(2) { animation-delay: -.6s; }
.eq span:nth-child(3) { animation-delay: -.4s; }
.eq span:nth-child(4) { animation-delay: -.9s; }
.eq span:nth-child(5) { animation-delay: -.1s; }
@keyframes eq {
    0%, 100% { height: 25%; }
    50% { height: 100%; }
}

/* ---------- Form ---------- */
.auth-panel {
    display: grid;
    place-items: center;
    padding: 40px 24px;
    background: var(--surface);
}

.auth-form { width: 100%; max-width: 400px; }
.auth-form header h1 { margin: 0 0 6px; font-size: 32px; letter-spacing: -.02em; }
.auth-form header p { margin: 0 0 28px; color: var(--muted); }

.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; margin-bottom: 20px;
    border-radius: 12px;
    background: rgba(255, 93, 93, .12);
    border: 1px solid rgba(255, 93, 93, .4);
    color: #ffd0d0; font-size: 14px; line-height: 1.4;
}
.alert svg { color: var(--danger); font-size: 18px; margin-top: 1px; }
.alert.shake { animation: shake .35s; }
@keyframes shake {
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; }

.control { position: relative; display: flex; align-items: center; }
.control-icon { position: absolute; left: 16px; color: var(--muted); font-size: 18px; pointer-events: none; }
.control input {
    width: 100%; height: 52px;
    padding: 0 52px 0 46px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font: inherit; font-size: 16px;
    transition: border-color .15s, box-shadow .15s;
}
.control input::placeholder { color: #5f5f5f; }
.control input:hover { border-color: #3a3a3a; }
.control input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(126, 217, 87, .2); }
.field.has-error .control input { border-color: var(--danger); }
.field.has-error .control input:focus { box-shadow: 0 0 0 3px rgba(255, 93, 93, .2); }

.control-btn {
    position: absolute; right: 6px;
    width: 42px; height: 42px; border-radius: 10px;
    display: grid; place-items: center;
    border: 0; background: transparent; color: var(--muted);
    font-size: 18px; cursor: pointer;
}
.control-btn:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.control-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.field-error { margin: 6px 0 0; min-height: 0; color: var(--danger); font-size: 13px; }
.field-error:empty { display: none; }
.field-hint { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; color: var(--warning); font-size: 13px; }

.remember {
    display: flex; align-items: flex-start; gap: 12px;
    margin: 4px 0 18px; padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
    cursor: pointer;
}
.remember input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch {
    position: relative; flex-shrink: 0;
    width: 44px; height: 26px; margin-top: 1px;
    border-radius: 999px; background: #3a3a3a;
    transition: background .15s;
}
.switch::after {
    content: ""; position: absolute; top: 3px; left: 3px;
    width: 20px; height: 20px; border-radius: 50%;
    background: #fff; transition: transform .15s;
}
.remember input:checked + .switch { background: var(--accent); }
.remember input:checked + .switch::after { transform: translateX(18px); }
.remember input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.remember-text strong { display: block; font-size: 14px; }
.remember-text small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.4; }

.btn-primary {
    position: relative;
    width: 100%; height: 54px; margin-top: 8px;
    border: 0; border-radius: 999px;
    background: var(--accent); color: var(--accent-ink);
    font: inherit; font-size: 16px; font-weight: 800;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.btn-primary:disabled { cursor: progress; opacity: .85; }
.btn-primary .spinner {
    display: none;
    position: absolute; left: 50%; top: 50%;
    width: 22px; height: 22px; margin: -11px 0 0 -11px;
    border: 3px solid rgba(11, 26, 5, .25); border-top-color: var(--accent-ink);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.btn-primary.is-loading .btn-label { visibility: hidden; }
.btn-primary.is-loading .spinner { display: block; }
.btn-primary.is-success { background: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-foot {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin: 24px 0 0; color: #6f6f6f; font-size: 13px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .auth { grid-template-columns: 1fr 1fr; }
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 380px; }
    .card { aspect-ratio: 1 / 1.05; }
}

@media (max-width: 820px) {
    .auth { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
    .auth-panel {
        align-items: start;
        padding: 48px 20px 32px;
        background:
            radial-gradient(70% 35% at 50% 0%, rgba(123, 108, 255, .3), transparent 75%),
            var(--surface);
    }
    .auth-brand--mobile { display: flex; margin-bottom: 40px; }
    .auth-form header h1 { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    .card, .eq span, .alert.shake { animation: none; }
}
