/* =============================================================
   AUTH MODAL — AniList Design System
   ============================================================= */
.auth-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: 200000;
}
.auth-overlay.active { display: block; }

.auth-modal {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 94%; max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 200001;
    padding: 0;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.auth-modal.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.auth-modal-close {
    position: absolute; top: 14px; right: 14px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: var(--radius-full);
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); cursor: pointer;
    transition: all 0.15s; z-index: 2;
}
.auth-modal-close:hover { color: var(--text-bright); background: var(--bg-hover); }

/* Tabs */
.auth-tabs {
    display: flex; border-bottom: 2px solid var(--border);
}
.auth-tab {
    flex: 1; padding: 16px; text-align: center;
    font-family: var(--font); font-size: 0.95rem; font-weight: 700;
    color: var(--text-muted); background: transparent; border: none;
    cursor: pointer; transition: all 0.15s;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.auth-tab:hover { color: var(--text-primary); }
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Panels */
.auth-panel { display: none; padding: 1.75rem; }
.auth-panel.active { display: block; animation: authFadeIn 0.2s ease; }
@keyframes authFadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

/* Fields */
.auth-field { margin-bottom: 1rem; }
.auth-field label {
    display: block; font-weight: 600; font-size: 0.85rem;
    color: var(--text-secondary); margin-bottom: 6px;
}
.auth-input-wrap { position: relative; }
.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"] {
    width: 100%; padding: 10px 14px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-primary);
    font-family: var(--font); font-size: 0.9rem;
    transition: all 0.15s;
}
.auth-field input::placeholder { color: var(--text-muted); }
.auth-field input:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.auth-input-icon {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none; font-size: 0.85rem;
}
.auth-eye {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 6px; font-size: 0.95rem; transition: color 0.15s;
}
.auth-eye:hover { color: var(--accent); }

/* Validation */
.auth-validation {
    font-size: 0.8rem; min-height: 1.2rem; padding-top: 4px; font-weight: 600;
}
.auth-validation.valid { color: var(--green); }
.auth-validation.invalid { color: var(--red); }

/* Options Row */
.auth-options {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.25rem; font-size: 0.85rem;
}
.auth-check {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    font-size: 0.85rem; color: var(--text-secondary);
}
.auth-check input[type="checkbox"] { display: none; }
.auth-checkbox {
    width: 20px; height: 20px; flex-shrink: 0;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 5px; display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.auth-checkbox i { color: var(--accent); font-size: 0.7rem; opacity: 0; transform: scale(0.5); transition: all 0.15s; }
.auth-check input:checked + .auth-checkbox { background: var(--accent-surface); border-color: var(--accent); }
.auth-check input:checked + .auth-checkbox i { opacity: 1; transform: scale(1); }

.auth-forgot { color: var(--text-muted); text-decoration: none; font-weight: 600; transition: color 0.15s; }
.auth-forgot:hover { color: var(--accent); }

/* Submit */
.auth-submit {
    width: 100%; padding: 12px; border: none;
    border-radius: var(--radius); background: var(--accent); color: #fff;
    font-family: var(--font); font-size: 1rem; font-weight: 700;
    cursor: pointer; transition: all 0.15s;
}
.auth-submit:hover:not(:disabled) { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 4px 16px var(--accent-glow); }
.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* Switch */
.auth-switch {
    text-align: center; margin-top: 1.25rem; font-size: 0.88rem; color: var(--text-muted);
}
.auth-switch button {
    background: none; border: none; color: var(--accent);
    font-family: var(--font); font-weight: 700; cursor: pointer;
    font-size: 0.88rem;
}
.auth-switch button:hover { text-decoration: underline; }

/* reCAPTCHA */
.auth-panel .g-recaptcha { margin: 0.75rem 0; transform-origin: 0 0; }
@media (max-width: 440px) { .auth-panel .g-recaptcha { transform: scale(0.82); } }

/* Mobile */
@media (max-width: 480px) {
    .auth-modal { width: 96%; max-height: 95vh; }
    .auth-panel { padding: 1.25rem; }
}