:root {
    --bg: #060915;
    --bg-accent: linear-gradient(140deg, rgba(38, 56, 120, 0.55), rgba(120, 54, 168, 0.35));
    --surface: rgba(18, 22, 40, 0.82);
    --surface-strong: rgba(18, 22, 40, 0.92);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #f1f5ff;
    --text-muted: #a6b2d9;
    --accent: #ffd95e;
    --accent-soft: rgba(255, 217, 94, 0.18);
    --danger: #ff6b6b;
    --success: #6bffb0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    color: var(--text);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover,
a:focus-visible {
    text-decoration: underline;
}

body.auth-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: clamp(1.5rem, 4vw, 3rem);
    background: linear-gradient(155deg, #060915 0%, #101533 55%, #090d22 100%);
    color: var(--text);
}

.auth-shell {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: clamp(2rem, 4vw, 3.5rem);
    padding: clamp(2rem, 4vw, 3rem);
    background: linear-gradient(130deg, rgba(16, 20, 37, 0.92), rgba(16, 20, 37, 0.76));
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 26px 85px rgba(4, 8, 20, 0.5);
}

.auth-hero {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-brand {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-logo {
    font-size: 1rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
}

.auth-brand h1 {
    margin: 0;
    font-size: clamp(2.2rem, 4vw, 2.9rem);
    line-height: 1.2;
}

.auth-brand p {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.02rem;
}

.auth-highlights {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.9rem;
}

.auth-highlights li {
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(6, 9, 21, 0.35);
}

.auth-highlights strong {
    color: var(--accent);
    font-weight: 600;
}

.auth-cta-note {
    font-size: 0.9rem;
    color: var(--text-muted);
    border-left: 3px solid var(--accent);
    padding: 0.5rem 0 0.5rem 0.85rem;
    background: rgba(255, 217, 94, 0.08);
    border-radius: 0 12px 12px 0;
}

.auth-illustration {
    margin: 0;
    align-self: center;
    width: min(380px, 100%);
    background: var(--surface);
    border-radius: 18px;
    padding: 1.4rem;
    border: 1px solid var(--border);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 16px 45px rgba(6, 9, 15, 0.45);
}

.auth-illustration img {
    width: 100%;
    display: block;
}

.auth-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background: var(--surface-strong);
    border-radius: 18px;
    border: 1px solid var(--border);
    padding: clamp(1.75rem, 3vw, 2.25rem);
    box-shadow: 0 24px 68px rgba(6, 9, 15, 0.5);
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0.35rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.auth-tab {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.auth-tab.is-active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.auth-tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.auth-card {
    position: relative;
}

.auth-form-container {
    transition: opacity 0.25s ease;
}

.auth-form-container:not(.is-active) {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    inset: 0;
}

.auth-form-container[hidden] {
    display: none;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

label {
    font-size: 0.95rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

input {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    background: rgba(9, 12, 24, 0.88);
    color: var(--text);
    font-size: 1rem;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 217, 94, 0.25);
}

.btn {
    border: none;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
    background: linear-gradient(135deg, var(--accent), #ffb347);
    color: #101428;
    box-shadow: 0 20px 40px rgba(255, 217, 94, 0.35);
}

.btn.primary:hover,
.btn.primary:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 26px 60px rgba(255, 217, 94, 0.5);
}

.form-switch {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.form-message {
    min-height: 1.2rem;
    font-size: 0.9rem;
}

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

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

.password-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 0.75rem 1rem;
}

.auth-footer-note {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
}

@media (max-width: 820px) {
    .auth-shell {
        padding: 1.75rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .auth-form-container:not(.is-active) {
        position: absolute;
    }
}

@media (max-width: 640px) {
    body.auth-body {
        padding: 1rem;
    }

    .auth-shell {
        padding: 1.5rem;
        border-radius: 18px;
    }

    .auth-illustration {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-tab,
    .btn,
    input {
        transition: none;
    }

    .btn.primary:hover,
    .btn.primary:focus-visible {
        transform: none;
        box-shadow: 0 20px 40px rgba(255, 217, 94, 0.35);
    }
}
