/* Variables for Dark and Light Modes */
:root[data-theme="dark"] {
    --bg-color: #0b0f19;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --input-bg: rgba(255, 255, 255, 0.03);
    --input-border: rgba(255, 255, 255, 0.1);
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow: rgba(0, 0, 0, 0.3);
    --circle-1: #1e3a8a;
    --circle-2: #4c1d95;
}

:root[data-theme="light"] {
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(0, 0, 0, 0.06);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
    --success-color: #059669;
    --error-color: #dc2626;
    --shadow: rgba(15, 23, 42, 0.08);
    --circle-1: #bfdbfe;
    --circle-2: #ddd6fe;
}

/* Base Resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.2s ease;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Background Gradients */
.bg-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 1;
}
.circle-1 { width: 300px; height: 300px; background: var(--circle-1); top: 15%; left: 15%; }
.circle-2 { width: 400px; height: 400px; background: var(--circle-2); bottom: 10%; right: 15%; }

/* UI Container */
.login-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
    z-index: 10;
}

/* Card Structure and Glassmorphism Layout */
.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 40px 32px;
    box-shadow: 0 20px 40px var(--shadow);
    display: none;
    transform: translateY(15px);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.auth-card.active {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.card-header {
    text-align: center;
    margin-bottom: 32px;
}

.icon-box {
    width: 64px;
    height: 64px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-color);
    font-size: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 16px;
    margin: 0 auto 16px;
}

.success-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.card-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.card-header p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.highlight {
    color: var(--text-primary);
    font-weight: 600;
}

/* Inputs & Form Controls */
.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    overflow: hidden;
}

.input-wrapper:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.country-prefix {
    padding: 14px 12px 14px 16px;
    color: var(--text-secondary);
    font-weight: 600;
    border-right: 1px solid var(--input-border);
}

input[type="tel"] {
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 16px;
    letter-spacing: 0.5px;
}

/* Custom Styled Row for Split OTP Inputs */
.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.otp-field {
    width: 48px;
    height: 54px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-primary);
    outline: none;
}

.otp-field:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Buttons */
.btn {
    width: 100%;
    padding: 14px;
    background: var(--accent-color);
    border: none;
    outline: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn:hover { background: var(--accent-hover); }

.btn.outline {
    background: transparent;
    border: 1px solid var(--input-border);
    color: var(--text-primary);
}
.btn.outline:hover { background: rgba(255, 255, 255, 0.05); }

.btn-link {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-link:hover { color: var(--accent-color); }

.card-footer {
    margin-top: 24px;
    text-align: center;
}

/* Spinners & Validation Messages */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

.error-text {
    display: block;
    color: var(--error-color);
    font-size: 12px;
    margin-top: 6px;
    min-height: 16px;
}

/* Theme Switcher Widget */
.theme-toggle {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 12px var(--shadow);
}

/* Toast Message Engine */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    padding: 12px 24px;
    border-radius: 12px;
    background: #1e293b;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.toast.error { background: var(--error-color); }
.toast.success { background: var(--success-color); }

/* Responsive Adaptations */
@media (max-width: 480px) {
    .auth-card { padding: 32px 20px; }
    .otp-field { width: 40px; height: 48px; font-size: 18px; }
}
