.auth-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 0 0 20px;
    padding: 4px;
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    background: #090c0f;
}

.auth-mode button {
    border: 0;
    border-radius: 6px;
    padding: 10px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.auth-mode button:hover {
  border-color: var(--hover-color);
  box-shadow: inset 0 0 10px var(--hover-color);
}
.auth-mode button:focus-visible { color: var(--text-primary); }

.auth-mode button.active {
    background: var(--accent-color);
    color: #ffffff;
    box-shadow: 0 0 12px var(--accent-glow);
}
:root {
    --bg-dark: #000000;
    --card-bg: #001433;
    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --border-color: #334155;
    --hover-color: #0364ff;
    
    --accent-color: #0364ff;
    --accent-glow: #0364ff;
    
    --error-color: #ef4444;
    --success-color: #10b981;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: system-ui, -apple-system, sans-serif; }

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* --- Immersive Loading Bar --- */
.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
    width: 0%;
    transition: width 0.3s ease, opacity 0.3s ease;
    z-index: 1000;301024
    opacity: 0;
}

.otp-container {
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.otp-container input {
    width: 48px;
    height: 52px;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    padding: 0;
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    color: white;
    opacity: 0;
    transform: translateY(-20px);
    animation: slideDown 0.3s forwards ease-out;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.toast.error { background: var(--error-color); }
.toast.success { background: var(--success-color); }

@keyframes slideDown {
    to { opacity: 1; transform: translateY(0); }
}

/* --- Login Card --- */
.login-wrapper { width: 100%; max-width: 400px; padding: 20px; }
.login-card {
    background: var(--card-bg);
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
}
.login-header { text-align: center; margin-bottom: 30px; }
.login-header h2 { font-size: 24px; margin-bottom: 8px; }
.login-header h2 span { color: var(--accent-color); font-weight: 500; }
.login-header p { color: var(--text-secondary); font-size: 14px; }

/* --- Glowing Inputs --- */
.input-group { margin-bottom: 20px; }
.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}
.input-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease-in-out;
}
.input-group input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-glow);
}
.otp-destination {
    margin-bottom: 18px; color: var(--text-secondary); font-size: 14px; line-height: 1.5;
}
.btn-link {
    display: block; margin: -4px auto 18px; padding: 4px; border: 0;
    background: transparent; color: var(--accent-color); cursor: pointer; font: inherit;
}
.btn-link:hover { color: #93c5fd; }

.input-group input:hover {
    border-color: var(--hover-color);
    box-shadow: inset 0 0 10px var(--hover-color);
}
/* --- Button --- */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: #0062ff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}
.btn-primary:hover { background-color: #00dd63; box-shadow: 0 0 5px #02ff74; color: black;}
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }

/* Spinner */
.btn-spinner {
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.28);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s infinite linear, spinnerGlow 1.1s ease-in-out infinite alternate;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinnerGlow { to { box-shadow: 0 0 16px rgba(255,255,255,0.75); } }

@media (max-width: 480px) {
    .login-wrapper { max-width: none; padding: 14px; }
    .login-card { padding: 32px 20px; border-radius: 12px; }
    .toast-container { width: calc(100% - 28px); }
    .toast { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}