* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.app-logo h1 {
    font-size: 2.5rem;
    margin-bottom: 8px;
    color: #2d3748;
}

.app-logo p {
    color: #718096;
    margin-bottom: 32px;
    font-size: 0.95rem;
}

.login-form h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: #2d3748;
}

.subtitle {
    color: #718096;
    margin-bottom: 32px;
    font-size: 0.9rem;
}

.login-btn {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.google-btn {
    border-color: #e2e8f0;
    color: #2d3748;
}

.google-btn:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

.divider {
    margin: 24px 0;
    position: relative;
    text-align: center;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

.divider span {
    background: white;
    padding: 0 16px;
    color: #718096;
    font-size: 0.9rem;
}

.email-option {
    padding: 16px;
    background: #f7fafc;
    border-radius: 8px;
    color: #718096;
    font-size: 0.9rem;
}

.login-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.login-footer p {
    color: #a0aec0;
    font-size: 0.8rem;
    line-height: 1.4;
}

.login-otp-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(5px);
    padding: 18px;
    z-index: 50;
}

.login-otp-card {
    width: min(100%, 380px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
    overflow: hidden;
}

.login-otp-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 22px 12px;
}

.login-otp-header h3 {
    color: #1e293b;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.login-otp-header p {
    color: #64748b;
    font-size: 0.86rem;
    line-height: 1.4;
}

.login-otp-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    font-size: 1.25rem;
}

.login-otp-body {
    padding: 10px 22px 22px;
}

.login-otp-email {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    font-size: 0.9rem;
    padding: 10px 12px;
    margin-bottom: 14px;
    word-break: break-all;
}

.login-otp-input {
    width: 100%;
    height: 52px;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    outline: none;
    text-align: center;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 8px;
    color: #1e293b;
    margin-bottom: 10px;
}

.login-otp-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}

.login-otp-error {
    min-height: 20px;
    color: #dc2626;
    font-size: 0.84rem;
    margin-bottom: 10px;
}

.login-otp-primary,
.login-otp-secondary {
    width: 100%;
    height: 44px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

.login-otp-primary {
    border: none;
    background: #6366f1;
    color: #ffffff;
    margin-bottom: 10px;
}

.login-otp-secondary {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
}

.login-otp-secondary:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

@media (max-width: 480px) {
    .login-container {
        padding: 16px;
    }
    
    .login-card {
        padding: 32px 24px;
    }
    
    .app-logo h1 {
        font-size: 2rem;
    }
}







/* ============================================================
   MODAL + TOTP STYLES (needed for 2FA on login page)
   ============================================================ */

/* CSS variables fallback for login page */
:root {
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --bg: #0f172a;
    --sidebar-bg: #1e293b;
    --sidebar-border: rgba(255,255,255,0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --bg-main: #0f172a;
    --chat-bg: #0f172a;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
    --red: #ef4444;
    --border: rgba(255,255,255,0.12);
    --text: #f1f5f9;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    backdrop-filter: blur(6px);
}
.modal {
    background: #1e293b;
    border-radius: 14px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.08);
}
.modal-header {
    padding: 18px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f1f5f9;
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #64748b;
    padding: 4px 7px;
    border-radius: 6px;
    transition: background 0.15s;
}
.modal-close:hover { background: rgba(255,255,255,0.06); }
.modal-body {
    padding: 16px 20px;
    color: #94a3b8;
    font-size: 0.9rem;
}
.modal-footer {
    padding: 0 20px 18px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.btn-primary {
    background: #6366f1;
    color: white;
    border: none;
    padding: 9px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.15s;
}
.btn-primary:hover { background: #4f46e5; }
.btn-secondary {
    background: #0f172a;
    color: #94a3b8;
    border: 1px solid rgba(255,255,255,0.08);
    padding: 9px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

/* TOTP specific */
.totp-overlay { z-index: 9100; }
.totp-modal { width: 100%; max-width: 380px; }
.totp-body { display: flex; flex-direction: column; gap: 12px; }
.totp-step { font-size: 13.5px; color: #94a3b8; line-height: 1.5; }
.totp-step strong { color: #f1f5f9; }
.totp-code-wrap { display: flex; gap: 8px; align-items: stretch; }
.totp-input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1.5px solid rgba(255,255,255,0.12);
    background: #0f172a;
    color: #f1f5f9;
    font-size: 22px;
    font-family: 'Courier New', monospace;
    letter-spacing: 6px;
    text-align: center;
    outline: none;
}
.totp-input:focus { border-color: #6366f1; }
.totp-btn {
    padding: 10px 18px;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.15s;
    white-space: nowrap;
}
.totp-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.totp-btn:hover:not(:disabled) { opacity: 0.88; }
.totp-btn-danger { background: #ef4444; }
.totp-btn-danger:hover:not(:disabled) { background: #dc2626; opacity: 1; }
.totp-error {
    font-size: 12.5px;
    color: #f87171;
    background: rgba(248,113,113,0.1);
    padding: 6px 10px;
    border-radius: 6px;
    display: none;
}
.totp-link-btn {
    background: none;
    border: none;
    color: #6366f1;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 0;
    align-self: center;
}
.totp-verify-modal { max-width: 340px; }
