/* login.css — Shared styles for login, register, forgot-password, reset-password */

/* Auth pages are permanently dark — not affected by user theme selection.
   theme.js is skipped on these pages (skipTheme: true), so these :root values
   are never overridden by JS. login.css loads after styles.css so they win. */
:root {
    --color-bg:       #0d1117;
    --card-bg:        #161b22;
    --border-color:   rgba(255, 255, 255, 0.1);
    --text-primary:   #e6edf3;
    --text-secondary: rgba(255, 255, 255, 0.55);
    --text-muted:     rgba(255, 255, 255, 0.3);
    --input-bg:       rgba(255, 255, 255, 0.05);
    --accent-color:   #4dabf7;
}

html, body { overflow: hidden; }

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--card-bg, #1a1a2e);
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo .logo-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    padding: 6px;
    background-color: #16243d;
    box-shadow: 0 10px 12px rgba(0, 0, 0, 0.35);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 6px;
    color: var(--text-primary, #fff);
}

.auth-subtitle {
    font-size: 0.875rem;
    text-align: center;
    color: var(--text-secondary, rgba(255,255,255,0.55));
    margin: 0 0 24px;
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary, rgba(255,255,255,0.7));
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    background: var(--input-bg, rgba(255,255,255,0.06));
    border: 1px solid var(--border-color, rgba(255,255,255,0.12));
    border-radius: 10px;
    color: var(--text-primary, #fff);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: var(--accent-color, #4a9eff);
}

.form-group input::placeholder {
    color: var(--text-muted, rgba(255,255,255,0.3));
}

/* Password wrapper with toggle */
.password-wrapper {
    position: relative;
}

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

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary, rgba(255,255,255,0.4));
    cursor: pointer;
    padding: 4px;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--text-primary, #fff);
}

/* Buttons */
.btn-auth {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: var(--accent-color, #4a9eff);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.btn-auth:hover:not(:disabled) {
    opacity: 0.88;
    transform: translateY(-1px);
}

.btn-auth:active:not(:disabled) {
    transform: translateY(0);
}

.btn-auth:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-auth.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color, rgba(255,255,255,0.15));
    color: var(--text-secondary, rgba(255,255,255,0.7));
    margin-top: 10px;
}

/* Error / success banners */
.auth-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #f87171;
    font-size: 0.85rem;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.auth-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    color: #4ade80;
    font-size: 0.85rem;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.auth-error-static {
    color: #f87171;
    font-size: 0.9rem;
    text-align: center;
    margin: 16px 0;
}

.auth-error-static a {
    color: var(--accent-color, #4a9eff);
}

/* Auth links */
.auth-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.auth-links a {
    font-size: 0.85rem;
    color: var(--accent-color, #4a9eff);
    text-decoration: none;
    transition: opacity 0.2s;
}

.auth-links a:hover {
    opacity: 0.75;
}

.auth-sep {
    color: var(--text-muted, rgba(255,255,255,0.25));
    font-size: 0.75rem;
}

/* Help link inside label */
.help-link {
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--accent-color, #4a9eff);
    text-decoration: none;
    margin-left: auto;
}

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

/* OTP input */
.otp-input {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.4em;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-card {
        padding: 28px 20px;
    }
}

/* Loading overlay */
#auth-loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--color-bg, #0f0f0f);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s ease;
}

#auth-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.auth-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.auth-loading-dots {
    display: flex;
    gap: 0.6rem;
}

.auth-loading-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-primary, #7c3aed);
    animation: dotPulse 1.2s ease-in-out infinite;
}

.auth-loading-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.auth-loading-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes dotPulse {
    0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.1); }
}
