:root {
    color-scheme: light dark;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    background-color: #0a101c;
    background-image: radial-gradient(circle at top, rgba(74, 144, 226, 0.3), transparent 55%);
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #f5f7fb;
}

.page-shell {
    width: min(960px, 95vw);
    background: rgba(12, 20, 36, 0.9);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(2, 8, 20, 0.6);
    padding: 3rem 2.5rem;
    backdrop-filter: blur(12px);
}

.auth-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.auth__header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth__brand {
    font-size: 2.25rem;
    margin: 0 0 0.5rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth__subtitle {
    margin: 0;
    color: #b1bed9;
    font-weight: 500;
}

.auth__tabs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.auth__tab {
    flex: 1 1 auto;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(97, 124, 164, 0.5);
    background: transparent;
    color: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

[data-active-mode="login"] .auth__tab[data-switch-mode="login"],
[data-active-mode="register"] .auth__tab[data-switch-mode="register"] {
    background: linear-gradient(135deg, #4a90e2, #7f5af0);
    border-color: transparent;
}

.auth__banner {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-weight: 600;
}

.auth__banner--success {
    background: rgba(66, 186, 150, 0.2);
    color: #5de4c7;
}

.auth__banner--error {
    background: rgba(255, 99, 132, 0.15);
    color: #ff6f91;
}

.auth__forms {
    position: relative;
}

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

[data-active-mode="login"] .auth-form[data-mode="login"],
[data-active-mode="register"] .auth-form[data-mode="register"] {
    display: flex;
}

.auth-form__title {
    margin: 0 0 0.25rem;
    font-size: 1.4rem;
}

.auth-form__field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.95rem;
}

.auth-form__field input {
    border-radius: 12px;
    border: 1px solid rgba(97, 124, 164, 0.5);
    background: rgba(15, 22, 38, 0.85);
    color: inherit;
    padding: 0.75rem 0.9rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form__field input:focus {
    outline: none;
    border-color: rgba(124, 199, 255, 0.85);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.35);
}

.auth-form__submit {
    margin-top: 0.5rem;
    border: none;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    color: #0a101c;
    background: linear-gradient(135deg, #7f5af0, #4a90e2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-form__submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(9, 12, 24, 0.4);
}

.auth-form__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.auth__footer {
    margin-top: 2.25rem;
    text-align: center;
    color: #8fa4c9;
    font-size: 0.95rem;
}

.auth__footer a {
    color: #9bc0ff;
    text-decoration: none;
}

.auth__footer a:hover {
    text-decoration: underline;
}

.auth {
    flex: 1 1 420px;
    max-width: 520px;
}

.auth-switcher {
    flex: 0 0 280px;
    align-self: stretch;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.auth-switcher__toggle {
    width: 100%;
    display: flex;
    gap: 0.85rem;
    align-items: center;
    justify-content: flex-start;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(97, 124, 164, 0.45);
    background: rgba(15, 22, 38, 0.85);
    color: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.auth-switcher--open .auth-switcher__toggle {
    border-color: rgba(124, 199, 255, 0.85);
    box-shadow: 0 8px 18px rgba(7, 14, 28, 0.35);
}

.auth-switcher__toggle:hover {
    border-color: rgba(124, 199, 255, 0.85);
    box-shadow: 0 8px 18px rgba(7, 14, 28, 0.35);
    transform: translateY(-1px);
}

.auth-switcher__waffle {
    display: grid;
    grid-template-columns: repeat(3, 8px);
    gap: 3px;
    width: 26px;
    height: 26px;
}

.auth-switcher__waffle span {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 3px;
    background: linear-gradient(135deg, #4a90e2, #7f5af0);
    opacity: 0.9;
}

.auth-switcher__toggle-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}

.auth-switcher__toggle-label {
    font-weight: 700;
    font-size: 1rem;
}

.auth-switcher__toggle-sub {
    color: #9eb2d6;
    font-size: 0.9rem;
}

.auth-switcher__menu {
    background: rgba(15, 22, 38, 0.92);
    border: 1px solid rgba(97, 124, 164, 0.4);
    border-radius: 16px;
    padding: 0 1rem;
    box-shadow: 0 18px 32px rgba(5, 12, 24, 0.45);
    opacity: 0;
    transform: translateY(-6px);
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 220ms ease, transform 220ms ease, max-height 260ms ease, padding 220ms ease;
}

.auth-switcher__menu--visible {
    opacity: 1;
    transform: translateY(0);
    max-height: 720px;
    padding: 1rem;
    pointer-events: auto;
}

.auth-switcher__hint {
    margin: 0 0 0.75rem;
    color: #9eb2d6;
    font-size: 0.95rem;
}

.auth-switcher__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.auth-switcher__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.9rem;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
    text-align: left;
}

.auth-switcher__chip:hover {
    background: rgba(124, 199, 255, 0.12);
    border-color: rgba(124, 199, 255, 0.45);
    transform: translateY(-1px);
}

.auth-switcher__chip--active {
    border-color: rgba(124, 199, 255, 0.8);
    background: rgba(124, 199, 255, 0.16);
    box-shadow: 0 10px 20px rgba(7, 14, 28, 0.35);
}

.auth-switcher__chip-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 1.2rem;
    background: rgba(12, 20, 36, 0.55);
    border: 1px solid rgba(97, 124, 164, 0.35);
}

.auth-switcher__chip-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.auth-switcher__chip-title {
    font-weight: 700;
}

.auth-switcher__chip-desc {
    color: #9eb2d6;
    font-size: 0.92rem;
}

.auth-switcher__pill {
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(124, 199, 255, 0.15);
    color: #b4d5ff;
    font-size: 0.85rem;
    border: 1px solid rgba(124, 199, 255, 0.25);
}

@media (max-width: 640px) {
    .page-shell {
        padding: 2.25rem 1.5rem;
    }

    .auth-layout {
        flex-direction: column;
    }

    .auth-switcher {
        width: 100%;
    }
}
