/* 1. VARIABLES (Matched with your existing theme) */
:root {
    --bg-main: #0b1121;
    --bg-card: #151e32;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-light: #60a5fa;
    --accent-hover: #2563eb;
    --border: #1e293b;
    --input-bg: #0f172a;
    --gradient-1: #1e3a8a;
    --gradient-2: #0b1121;
    --accent-solid: #38bdf8; /* Added missing variable for hover states */
}

/* 2. BASE RESET */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background-color: var(--bg-main); color: var(--text-main); height: 100vh; overflow: hidden; display: flex; justify-content: center; align-items: center; position: relative; }
a { text-decoration: none; color: inherit; }
.mt-4 { margin-top: 20px; }
.w-100 { width: 100%; }

/* 3. BACKGROUND (From Home Page) */
.bg-wrapper { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-mesh { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2), var(--accent), var(--gradient-2)); background-size: 400% 400%; animation: meshGradient 15s ease infinite; opacity: 0.15; }
@keyframes meshGradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.grid-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 40px 40px; opacity: 0.3; }
.bg-animated-shape { position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.5; animation: floatAnimation 15s infinite alternate ease-in-out; }
.shape-1 { top: -10%; left: -10%; width: 500px; height: 500px; background: rgba(59, 130, 246, 0.4); }
.shape-2 { top: 40%; right: -10%; width: 600px; height: 600px; background: rgba(139, 92, 246, 0.3); animation-delay: -5s; }
.shape-3 { bottom: -10%; left: 20%; width: 400px; height: 400px; background: rgba(14, 165, 233, 0.3); animation-delay: -10s; }
@keyframes floatAnimation { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(50px, 50px) scale(1.1); } }

/* BACK BUTTON */
.back-btn { position: absolute; top: 30px; left: 40px; z-index: 10; display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-weight: 600; transition: 0.3s; padding: 10px 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 50px; }
.back-btn:hover { color: var(--text-main); border-color: var(--accent); box-shadow: 0 0 15px rgba(59, 130, 246, 0.2); transform: translateX(-5px); }

/* 4. AUTH CONTAINER & CARD */
.auth-container { position: relative; z-index: 10; width: 100%; max-width: 450px; padding: 20px; }
.auth-card { background: rgba(21, 30, 50, 0.7); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.05); padding: 40px; border-radius: 24px; box-shadow: 0 25px 50px rgba(0,0,0,0.5); text-align: center; border-top: 1px solid rgba(255,255,255,0.1); }

/* BRANDING */
.auth-header { margin-bottom: 30px; }
.brand-img { height: 60px; object-fit: contain; margin-bottom: 15px; filter: invert(1) hue-rotate(180deg) brightness(1.5) contrast(1.2); mix-blend-mode: screen; }
.brand-text { font-size: 2.2rem; font-weight: 900; letter-spacing: -0.5px; margin-bottom: 5px; }
.theme-accent { color: var(--accent-light); }
.auth-subtitle { color: var(--text-muted); font-size: 0.95rem; }

/* TOGGLE SWITCH */
.auth-toggle { display: flex; background: var(--input-bg); border-radius: 12px; padding: 5px; margin-bottom: 30px; border: 1px solid var(--border); }
.toggle-btn { flex: 1; background: transparent; border: none; color: var(--text-muted); padding: 12px; font-weight: 700; font-size: 0.95rem; border-radius: 8px; cursor: pointer; transition: 0.3s; }
.toggle-btn.active { background: var(--accent); color: white; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4); }

/* FORMS */
.auth-form { display: none; text-align: left; animation: fadeIn 0.4s ease; }
.auth-form.active-form { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 8px; color: var(--text-muted); display: flex; gap: 8px; align-items: center; }
.form-group label i { color: var(--accent-light); }
.form-group input { width: 100%; background: var(--input-bg); border: 1px solid var(--border); color: var(--text-main); padding: 14px 16px; border-radius: 12px; font-size: 1rem; outline: none; transition: 0.3s; }
.form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15); }

.forgot-password { text-align: right; margin-bottom: 20px; }
.forgot-password a { color: var(--accent-light); font-size: 0.85rem; font-weight: 600; transition: 0.2s; }
.forgot-password a:hover { color: white; text-decoration: underline; }

.btn-primary { background: linear-gradient(135deg, #3b82f6, #60a5fa); color: white; padding: 14px; border-radius: 12px; font-weight: 700; font-size: 1.05rem; border: none; cursor: pointer; transition: 0.3s; box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3); display: flex; justify-content: center; align-items: center; gap: 10px; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 25px rgba(59, 130, 246, 0.5); }

/* ========================================================= */
/* MERGED STYLES FROM HTML (Do not edit below this line) */
/* ========================================================= */

.auth-container { background: rgba(30, 41, 59, 0.6); backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.1); padding: 35px 25px; border-radius: 20px; width: 100%; max-width: 450px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); z-index: 10; text-align: center; position: relative; max-height: 95vh; overflow-y: auto; }
.auth-container::-webkit-scrollbar { display: none; }

.auth-logo { height: 50px; margin-bottom: 10px; }
.auth-title { font-size: 1.8rem; font-weight: 800; margin-bottom: 5px; margin-top: 0; color: var(--text-main); }
.auth-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; margin-top: 0; }

.input-group { position: relative; margin-bottom: 12px; width: 100%; }

.input-group i:not(.toggle-pwd) { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1.15rem; z-index: 10; pointer-events: none; display: block; opacity: 1; }
.input-group .toggle-pwd { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1.1rem; cursor: pointer; z-index: 10; transition: 0.2s; }
.input-group .toggle-pwd:hover { color: var(--accent-solid); }

.auth-input { width: 100%; padding: 14px 45px; border-radius: 10px; background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255, 255, 255, 0.1); color: var(--text-main); font-size: 16px; outline: none; transition: 0.3s; padding-left: 48px !important; }
.auth-input:focus { border-color: var(--accent-solid); background: rgba(0, 0, 0, 0.4); box-shadow: 0 0 10px rgba(56, 189, 248, 0.2); }

.auth-btn { width: 100%; padding: 14px; border-radius: 10px; background: var(--accent); color: white; border: none; font-size: 1.05rem; font-weight: bold; cursor: pointer; transition: 0.3s; margin-top: 5px; }
.auth-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 15px rgba(56, 189, 248, 0.3); }

.otp-btn { background: rgba(56, 189, 248, 0.1); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); width: 100%; padding: 12px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 0.95rem; transition: 0.3s; margin-bottom: 12px; }
.resend-otp-btn { background: transparent; border: none; color: var(--accent-solid); font-size: 0.85rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: 0.2s; padding: 0;}
.resend-otp-btn:hover { color: white; text-decoration: underline; }

.toggle-text { margin-top: 20px; font-size: 0.95rem; color: var(--text-muted); margin-bottom: 5px; }
.toggle-link { color: var(--accent-solid); cursor: pointer; font-weight: bold; text-decoration: none; }

.error-msg, .success-msg { font-size: 0.9rem; margin-top: 10px; display: none; padding: 10px; border-radius: 8px; font-weight: 500; }
.error-msg { color: #ef4444; background: rgba(239, 68, 68, 0.1); }
.success-msg { color: #10b981; background: rgba(16, 185, 129, 0.1); }
.signup-only { display: none; }

#toast-auth { visibility: hidden; min-width: 250px; background-color: #10b981; color: white; text-align: center; border-radius: 10px; padding: 14px 20px; position: fixed; z-index: 1000; left: 50%; top: 20px; transform: translateX(-50%); box-shadow: 0 10px 20px rgba(0,0,0,0.3); font-weight: bold; opacity: 0; transition: 0.4s; }
#toast-auth.show { visibility: visible; opacity: 1; top: 40px; }