:root {
    --bg: #08111f;
    --bg-soft: #101b2e;
    --card: rgba(8, 15, 28, 0.88);
    --card-border: rgba(255, 255, 255, 0.08);
    --text: #f4f8ff;
    --muted: #98a6bc;
    --primary: #3ea6ff;
    --primary-strong: #1e88e5;
    --danger: #ff7272;
    --success: #77e0a5;
    --input: rgba(255, 255, 255, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(62, 166, 255, 0.18), transparent 32%),
        radial-gradient(circle at top right, rgba(79, 209, 197, 0.14), transparent 26%),
        linear-gradient(180deg, #08111f 0%, #0d1422 48%, #070d17 100%);
}

.auth-shell {
    min-height: calc(100vh - 70px);
    padding: 104px 16px 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: min(100%, 440px);
    padding: 32px;
    border-radius: 28px;
    background: var(--card);
    border: 1px solid var(--card-border);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(16px);
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(62, 166, 255, 0.1);
    color: #c9e7ff;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 18px;
}

.auth-card h1 {
    margin: 0 0 10px;
    font-size: clamp(2rem, 5vw, 2.7rem);
    line-height: 1.05;
}

.auth-subtitle {
    margin: 0 0 26px;
    color: var(--muted);
    line-height: 1.65;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #d8e4f4;
}

.auth-input,
.auth-textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--input);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.auth-input:focus,
.auth-textarea:focus {
    border-color: rgba(62, 166, 255, 0.65);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.auth-input::placeholder,
.auth-textarea::placeholder {
    color: #8896ab;
}

.password-wrapper {
    position: relative;
}

.password-wrapper .auth-input {
    padding-right: 76px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    border-radius: 999px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #d6e9fb;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.password-strength {
    display: none;
    margin-top: 12px;
}

.strength-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.strength-bar {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    transition: width 0.25s ease, background 0.25s ease;
}

.strength-text {
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
}

.auth-button {
    width: 100%;
    padding: 14px 18px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: white;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 14px 36px rgba(30, 136, 229, 0.26);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.auth-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 42px rgba(30, 136, 229, 0.32);
    filter: brightness(1.04);
}

.auth-button.secondary {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.auth-button.secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

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

.auth-link {
    color: #7fc3ff;
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-footer {
    margin-top: 22px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

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

.back-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
}

.back-pill:hover {
    background: rgba(255, 255, 255, 0.12);
}

.auth-message {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.auth-message.error {
    background: rgba(255, 114, 114, 0.14);
    color: #ffc5c5;
    border: 1px solid rgba(255, 114, 114, 0.22);
}

.auth-message.success {
    background: rgba(119, 224, 165, 0.14);
    color: #c9ffe1;
    border: 1px solid rgba(119, 224, 165, 0.22);
}

.auth-note,
.timer-text,
.cooldown-text,
.match-message {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.match-message {
    min-height: 20px;
    margin-top: 8px;
}

.cooldown-text {
    min-height: 22px;
    margin-top: 10px;
}

.code-input {
    text-align: center;
    letter-spacing: 0.45em;
    font-size: 24px;
}

@media (max-width: 560px) {
    .auth-card {
        padding: 24px 18px;
        border-radius: 22px;
    }

    .auth-shell {
        padding-top: 96px;
    }

    .auth-card h1 {
        font-size: 1.85rem;
    }

    .code-input {
        letter-spacing: 0.3em;
        font-size: 20px;
    }
}
