/**
 * AUTH — Liquid Glass
 * Shared styling for login / register / forgot / reset pages.
 * Load AFTER app-modern.css (uses its tokens + aurora background).
 */

* { margin: 0; padding: 0; box-sizing: border-box; }

body.app-modern {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
}

/* ===== Back to home pill ===== */
.back-home {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 100px;
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    -webkit-backdrop-filter: var(--app-blur);
    backdrop-filter: var(--app-blur);
    box-shadow: inset 0 1px 0 var(--app-highlight);
    color: var(--app-muted);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.3s var(--app-spring), color 0.2s ease, border-color 0.2s ease;
}

.back-home:hover {
    color: var(--app-text);
    border-color: var(--app-border-strong);
    transform: translateY(-2px);
}

/* ===== Card ===== */
.container { width: 100%; max-width: 440px; }

.auth-container,
.form-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 42px 36px 34px;
    border-radius: var(--app-radius-lg);
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    -webkit-backdrop-filter: var(--app-blur);
    backdrop-filter: var(--app-blur);
    box-shadow: var(--app-shadow), inset 0 1px 0 var(--app-highlight);
    animation: auth-rise 0.6s var(--app-spring) both;
}

.auth-container::before,
.form-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.05) 46%, transparent 60%);
    pointer-events: none;
}

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(18px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Logo / titles ===== */
.logo {
    text-align: center;
    margin-bottom: 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 54px;
    width: auto;
    filter: drop-shadow(0 6px 18px rgba(59, 130, 246, 0.35));
}

.logo h1 {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--app-text);
}

.logo p {
    color: var(--app-muted);
    font-size: 14.5px;
    font-weight: 500;
}

.step-indicator {
    display: inline-flex;
    padding: 5px 14px;
    border-radius: 100px;
    border: 1px solid rgba(96, 165, 250, 0.4);
    background: rgba(59, 130, 246, 0.14);
    color: #93C5FD;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.form-title { text-align: center; margin-bottom: 26px; }
.form-title h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 8px; color: var(--app-text); }
.form-title p { color: var(--app-muted); font-size: 14px; line-height: 1.6; }

/* ===== Alerts ===== */
.error, .alert-error,
.success, .alert-success {
    padding: 13px 16px;
    border-radius: var(--app-radius-sm);
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.55;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.error, .alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.4);
    color: #FCA5A5;
}

.success, .alert-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: #6EE7B7;
}

/* ===== Form ===== */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--app-muted);
    font-size: 13.5px;
    font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    color: var(--app-text);
    font-size: 15px;
    font-family: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-group input::placeholder { color: rgba(148, 163, 184, 0.55); }

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(96, 165, 250, 0.6);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16);
}

/* ===== Custom checkbox (no native glitch) ===== */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    cursor: pointer;
    user-select: none;
}

.checkbox-row input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-box {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 1px solid var(--app-border-strong);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s var(--app-spring);
}

.checkbox-box::after {
    content: '';
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(0);
    margin-top: -2px;
    transition: transform 0.18s var(--app-spring);
}

.checkbox-row input[type="checkbox"]:checked + .checkbox-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(37, 99, 235, 0.92));
    border-color: rgba(96, 165, 250, 0.7);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.checkbox-row input[type="checkbox"]:checked + .checkbox-box::after { transform: rotate(45deg) scale(1); }

.checkbox-row input[type="checkbox"]:focus-visible + .checkbox-box {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
}

.checkbox-text { color: var(--app-text); font-size: 14px; font-weight: 500; line-height: 1.4; }
.checkbox-text small { display: block; color: var(--app-muted); font-size: 12.5px; font-weight: 400; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 28px;
    margin-top: 4px;
    border: 1px solid rgba(96, 165, 250, 0.45);
    border-radius: 100px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(37, 99, 235, 0.92));
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: transform 0.3s var(--app-spring), box-shadow 0.3s ease, filter 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 16px 44px rgba(59, 130, 246, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    filter: brightness(1.06);
}

.btn:active { transform: translateY(0) scale(0.99); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-secondary {
    background: var(--app-surface-strong);
    border: 1px solid var(--app-border-strong);
    box-shadow: inset 0 1px 0 var(--app-highlight);
    color: var(--app-muted);
    margin-top: 10px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.11);
    color: var(--app-text);
    box-shadow: inset 0 1px 0 var(--app-highlight);
    filter: none;
}

/* ===== Footer links ===== */
.auth-footer, .links {
    text-align: center;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--app-border);
    color: var(--app-muted);
    font-size: 14px;
}

.auth-footer p { margin: 0; }

/* Links row: lay out bare anchors side-by-side cleanly, stack <p> blocks */
.links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px 20px;
}

.links p { width: 100%; margin: 0; }
.links .divider { display: none; }

.back-link {
    text-align: center;
    margin-top: 14px;
    color: var(--app-muted);
    font-size: 14px;
}

.auth-footer a, .links a, .back-link a {
    color: var(--app-primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-footer a:hover, .links a:hover, .back-link a:hover { color: #93C5FD; }

/* ===== Platform selector (register) ===== */
.platform-selector {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.platform-selector input[type="radio"] { display: none; }

.platform-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: var(--app-radius-sm);
    cursor: pointer;
    transition: transform 0.25s var(--app-spring), background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
    border: 1px solid var(--app-border);
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: #7C8794;
    flex-shrink: 0;
    overflow: hidden;
    padding: 0;
}

.platform-label img,
.platform-label svg {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    flex-shrink: 0;
    filter: grayscale(1) opacity(0.55);
    transition: filter 0.25s ease, transform 0.25s var(--app-spring);
    /* EDIT ZOOM: Discord default — try 1.2 to 1.5 */
    transform: scale(1.3);
    transform-origin: center center;
}

/* EDIT ZOOM: Telegram only — slightly smaller than Discord */
.telegram-label img { transform: scale(1.15); }

.platform-label:hover img,
.platform-label:hover svg { filter: grayscale(0.4) opacity(0.85); }

.platform-selector input[type="radio"]:checked + .platform-label img,
.platform-selector input[type="radio"]:checked + .platform-label svg {
    filter: none;
}

.platform-selector input[type="radio"]:checked + .telegram-label {
    background: rgba(42, 171, 238, 0.14);
    border-color: rgba(42, 171, 238, 0.55);
    box-shadow: 0 6px 16px rgba(34, 158, 217, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.platform-selector input[type="radio"]:checked + .discord-label {
    background: rgba(88, 101, 242, 0.14);
    border-color: rgba(88, 101, 242, 0.55);
    box-shadow: 0 6px 16px rgba(88, 101, 242, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.platform-label:hover { color: #C7D2DD; border-color: var(--app-border-strong); transform: translateY(-2px); }
.platform-selector input[type="radio"]:checked + .platform-label { transform: none; }
.platform-selector input[type="radio"]:checked + .platform-label:hover { transform: translateY(-2px); }

.social-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
}

.social-input-wrapper { display: flex; align-items: center; flex: 1; min-width: 180px; max-width: 220px; }
.social-input-wrapper input { width: 100%; height: 52px; min-width: 0; }
.social-username-group { display: flex; flex-direction: column; align-items: center; }
.social-username-group label { align-self: flex-start; }

/* ===== Verification step (register) ===== */
.verify-intro {
    text-align: center;
    color: var(--app-muted);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 22px;
}

.verify-email-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 8px 16px;
    background: rgba(59, 130, 246, 0.14);
    border: 1px solid rgba(96, 165, 250, 0.4);
    border-radius: 100px;
    color: #93C5FD;
    font-weight: 700;
    font-size: 14px;
}

.code-input {
    text-align: center;
    font-size: 28px !important;
    letter-spacing: 0.35em;
    font-weight: 700;
    font-family: 'SF Mono', Consolas, monospace;
}

.verify-actions { display: flex; flex-direction: column; gap: 0; }

/* ===== Small screens ===== */
@media (max-width: 480px) {
    .auth-container, .form-card { padding: 32px 22px 26px; }
    .back-home { top: 14px; left: 14px; padding: 9px 14px; }
    .social-input-row { width: 100%; }
    .social-input-wrapper { max-width: none; }
}
