:root {
    --bg: #06101c;
    --panel: rgba(13, 22, 37, 0.78);
    --panel-strong: #0b1626;
    --border: rgba(255, 255, 255, 0.08);
    --muted: #93a6be;
    --text: #f4f8ff;
    --primary: #f4c95d;
    --primary-dark: #d0a841;
    --accent: #1fa38a;
    --danger: #ff667d;
    --success: #27c27d;
    --shadow: 0 26px 70px rgba(0, 0, 0, 0.38);
}

* {
    box-sizing: border-box;
}

body.auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Outfit', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(31, 163, 138, 0.2), transparent 32%),
        radial-gradient(circle at right 20%, rgba(244, 201, 93, 0.12), transparent 28%),
        linear-gradient(135deg, #040912 0%, #081220 45%, #07111c 100%);
    color: var(--text);
    overflow-x: hidden;
}

.auth-orb,
.auth-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.auth-grid {
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.3), transparent 85%);
}

.auth-orb--one::before,
.auth-orb--two::before {
    content: '';
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.35;
}

.auth-orb--one::before {
    background: rgba(31, 163, 138, 0.55);
    top: -140px;
    left: -100px;
}

.auth-orb--two::before {
    background: rgba(244, 201, 93, 0.4);
    right: -80px;
    bottom: -120px;
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: min(1280px, calc(100% - 40px));
    margin: 0 auto;
    min-height: 100vh;
    padding: 28px 0;
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(360px, 620px);
    gap: 28px;
    align-items: stretch;
}

.auth-copy-panel,
.auth-stage {
    border: 1px solid var(--border);
    background: rgba(8, 15, 26, 0.52);
    backdrop-filter: blur(16px);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.auth-copy-panel {
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 780px;
}

.auth-back-link {
    color: var(--text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    width: fit-content;
    opacity: 0.88;
}

.auth-copy-card {
    position: relative;
    max-width: 460px;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 30px;
    perspective: 1000px;
    overflow: hidden;
}

/* Canvas full */
#particles {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -3;
}

/* Moving light */
.bg-light {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,215,0,0.2), transparent 60%);
    filter: blur(120px);
    animation: moveLight 12s infinite alternate ease-in-out;
    z-index: -2;
}

@keyframes moveLight {
    0% { transform: translate(-150px,-150px); }
    100% { transform: translate(150px,150px); }
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 4px;
    font-size: 12px;
    color: #aaa;
}

.dot {
    width: 8px;
    height: 8px;
    background: #ffd700;
    border-radius: 50%;
    box-shadow: 0 0 15px #ffd700;
}

/* Hero */
.hero h1 {
    font-size: 52px;
    font-weight: 300;
    line-height: 1.1;
}

.hero h1 span {
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255,215,0,0.6);
}

.tagline {
    margin-top: 12px;
    color: #bbb;
    line-height: 1.6;
}

/* Glass card */
.glass-card {
    padding: 20px;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255,255,255,0.1);
    transition: 0.5s;
}

.glass-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

/* Features */
.feature {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.feature i {
    color: #ffd700;
    font-size: 18px;
}

/* Stats */
.stats {
    display: flex;
    justify-content: space-between;
}

.stats h3 {
    color: #ffd700;
}

/* Entry animation */
.auth-copy-card {
    animation: fadeUp 1.2s ease forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.auth-stage {
    padding: 26px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.server-banner,
.message-box {
    display: none;
    border-radius: 16px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.5;
}

.server-banner.is-visible,
.message-box.is-visible {
    display: block;
}

.server-banner.is-success,
.message-box.is-success {
    background: rgba(39, 194, 125, 0.12);
    border: 1px solid rgba(39, 194, 125, 0.26);
    color: #b4f1d0;
}

.server-banner.is-error,
.message-box.is-error {
    background: rgba(255, 102, 125, 0.12);
    border: 1px solid rgba(255, 102, 125, 0.24);
    color: #ffc0cb;
}

.auth-topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.mode-switch {
    display: inline-flex;
    padding: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
}

.mode-switch__btn,
.text-switch,
.link-button,
.modal-close,
.primary-btn,
.secondary-btn,
.google-btn {
    font: inherit;
}

.mode-switch__btn,
.text-switch,
.link-button,
.modal-close {
    cursor: pointer;
    background: transparent;
    border: 0;
    color: inherit;
}

.mode-switch__btn {
    padding: 10px 18px;
    border-radius: 999px;
    color: var(--muted);
    transition: 0.25s ease;
}

.mode-switch__btn.is-active {
    background: linear-gradient(135deg, rgba(244, 201, 93, 0.22), rgba(244, 201, 93, 0.08));
    color: var(--text);
}

.auth-scene {
    perspective: 1800px;
    flex: 1;
}

.auth-card-shell {
    border-radius: 28px;
    padding: 18px;
    min-height: 620px;
}

.auth-card {
    position: relative;
    min-height: 100%;
}

.auth-card__inner {
    position: relative;
    min-height: 584px;
    transform-style: preserve-3d;
    transition: transform 0.85s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.auth-scene.is-register .auth-card__inner {
    transform: rotateY(180deg);
}

.auth-face {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(244, 201, 93, 0.12), transparent 35%),
        linear-gradient(180deg, rgba(14, 24, 39, 0.96), rgba(10, 18, 30, 0.98));
    border: 1px solid rgba(255,255,255,0.06);
    padding: 30px;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-face--register {
    transform: rotateY(180deg);
}

.face-header {
    margin-bottom: 18px;
}

.face-header span {
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 12px;
    font-weight: 700;
}

.face-header h3 {
    margin: 8px 0 0;
    font-size: 2rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field-label {
    color: #d3dfef;
    font-size: 14px;
}

.field-wrap {
    position: relative;
}

.field-wrap i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6d819c;
}

.field-wrap input {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--text);
    border-radius: 18px;
    padding: 16px 16px 16px 46px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.field-wrap input:focus {
    border-color: rgba(244, 201, 93, 0.55);
    box-shadow: 0 0 0 4px rgba(244, 201, 93, 0.08);
    transform: translateY(-1px);
}

.strength-panel {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
}

.strength-bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.strength-bars span {
    height: 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    transition: background 0.25s ease;
}

.strength-panel p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

.strength-panel.is-weak .strength-bars span:nth-child(-n+1) { background: #ff6b6b; }
.strength-panel.is-medium .strength-bars span:nth-child(-n+2) { background: #ffb347; }
.strength-panel.is-good .strength-bars span:nth-child(-n+3) { background: #f4c95d; }
.strength-panel.is-strong .strength-bars span:nth-child(-n+4) { background: #27c27d; }

.primary-btn,
.secondary-btn,
.google-btn {
    width: 100%;
    border-radius: 18px;
    padding: 15px 18px;
    border: 0;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), #f1b93f);
    color: #09111c;
    font-weight: 700;
    box-shadow: 0 16px 34px rgba(244, 201, 93, 0.24);
}

.secondary-btn {
    background: rgba(255,255,255,0.05);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.08);
}

.google-btn {
    background: #f7f9fc;
    color: #172233;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 600;
}

.google-btn.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.primary-btn:hover,
.secondary-btn:hover,
.google-btn:hover:not(.is-disabled) {
    transform: translateY(-1px);
}

.form-actions-inline {
    display: flex;
    justify-content: flex-end;
}

.link-button,
.text-switch {
    color: var(--primary);
    padding: 0;
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--muted);
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.08);
}

.footer-switch {
    margin: 18px 0 0;
    text-align: center;
    color: var(--muted);
}

.helper-text {
    margin-top: 12px;
    font-size: 13px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 13, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 40;
}

.modal-backdrop.is-open {
    display: flex;
}

.modal-card {
    width: min(520px, 100%);
    border-radius: 28px;
    padding: 28px;
    background: linear-gradient(180deg, rgba(15, 26, 42, 0.98), rgba(9, 17, 28, 0.98));
    box-shadow: var(--shadow);
    position: relative;
}

.modal-card--wide {
    width: min(560px, 100%);
}

.modal-close {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
}

.modal-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
}

.countdown {
    color: var(--muted);
    font-size: 13px;
}

.otp-wrap input {
    letter-spacing: 0.32em;
    font-weight: 700;
}

.forgot-progress {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.forgot-progress span {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,0.06);
    color: var(--muted);
    font-weight: 700;
}

.forgot-progress span.is-active {
    background: linear-gradient(135deg, var(--primary), #efb53a);
    color: #09111c;
}

.forgot-step {
    display: none;
}

.forgot-step.is-active {
    display: block;
}

.toast-stack {
    position: fixed;
    top: 22px;
    right: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 60;
}

.toast {
    min-width: 260px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text);
    box-shadow: var(--shadow);
    animation: toastIn 0.35s ease;
}

.toast--success { background: rgba(39, 194, 125, 0.18); }
.toast--error { background: rgba(255, 102, 125, 0.18); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1080px) {
    .auth-shell {
        grid-template-columns: 1fr;
        padding: 18px 0 32px;
    }

    .auth-copy-panel {
        min-height: auto;
    }
}

@media (max-width: 720px) {
    .auth-shell {
        width: min(100% - 24px, 100%);
    }

    .auth-copy-panel,
    .auth-stage,
    .auth-face,
    .modal-card {
        border-radius: 22px;
    }

    .auth-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-copy-stats,
    .auth-copy-points {
        grid-template-columns: 1fr;
    }

    .auth-face {
        padding: 22px;
    }

    .modal-actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .toast-stack {
        right: 12px;
        left: 12px;
    }

    .toast {
        min-width: 0;
    }
}
