/* --- VARIABLES & BASE --- */
:root { --bg: #111; --text: #eee; --primary: #fff; --error: rgba(255, 59, 48, 0.9); }

/* --- ACCESS OVERLAY CSS --- */
#accessOverlay {
    position: fixed !important; overflow: hidden; inset: 0 !important; z-index: 999999 !important;
    background: #141414 !important;
    background-color: #141414 !important;
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
#accessOverlay.hidden {
    opacity: 0; visibility: hidden; pointer-events: none;
}
.access-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px; padding: 40px;
    text-align: left; padding-right: 40px; width: 100%; max-width: 340px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.access-box h2 {
    margin: 0 0 10px 0; font-size: 2rem; font-weight: 700; letter-spacing: -1.5px;
}
.access-box p {
    margin: 0 0 25px 0; font-size: 0.9rem; color: #888; line-height: 1.4;
}

/* Auth Forms CSS */
.form-wrapper { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); }
.form-wrapper.active { grid-template-rows: 1fr; }
.form-wrapper.active .form-inner { opacity: 1; transition-delay: 0.1s; }
.form-inner { overflow: hidden; opacity: 0; transition: opacity 0.4s ease; }
.icon-fade { transition: opacity 0.3s ease; }

/* Inputs with icons */
.input-group { position: relative; margin-bottom: 12px; display: block; }
.auth-input { 
    width: 100%; height: 48px; box-sizing: border-box; background: rgba(255,255,255,0.05); 
    border: 1px solid rgba(255,255,255,0.1); color: #fff; padding: 12px 40px 12px 16px !important; display: block; 
    border-radius: 12px; font-size: 1rem; outline: none; 
    text-align: left; font-family: 'Inter', sans-serif; 
    transition: border-color 0.2s, background 0.2s;
}
.auth-input:focus { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.08); }

.toggle-password {
    box-sizing: border-box;
    margin: 0;
    position: absolute;
    right: 14px;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    width: 24px; height: 24px; line-height: 0;
    background: transparent; border: none; color: #aaa; cursor: pointer;
    padding: 0; display: flex; align-items: center; justify-content: center;
    transition: color 0.2s; outline: none; z-index: 10;
}
.toggle-password:hover { color: #fff; }

/* Options (Remember me) */
.form-options {
    display: flex; flex-direction: column; align-items: center; gap: 16px;
    margin-bottom: 24px; font-size: 0.95rem; color: #aaa; line-height: 1.4;
}
.form-options > div {
    display: flex; align-items: center;
}
.form-options input[type="checkbox"] { margin: 0; transform: scale(1.6); cursor: pointer; accent-color: #0a84ff; }
.form-options label { cursor: pointer; margin: 0; margin-left: 6px; }

/* Buttons */
.auth-btn { 
    width: 100%; background: #fff; color: #000; border: none; padding: 14px 16px; 
    border-radius: 12px; font-size: 1rem; font-weight: 600; cursor: pointer; 
    transition: opacity 0.2s, transform 0.1s; font-family: 'Inter', sans-serif; margin-bottom: 12px;
    position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.auth-btn:hover { opacity: 0.9; }
.auth-btn:active { transform: scale(0.98); }

.auth-btn-secondary {
    width: 100%; background: transparent; color: #888; border: 1px solid rgba(255,255,255,0.15); 
    padding: 12px 16px; border-radius: 12px; font-size: 0.95rem; font-weight: 500; 
    cursor: pointer; transition: color 0.2s, border-color 0.2s, background 0.2s; 
    font-family: 'Inter', sans-serif; display: block; box-sizing: border-box;
}
.auth-btn-secondary:hover { color: #fff; border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.02); }
.auth-btn-secondary:active { transform: scale(0.98); }

/* Loading Spinner */
.spinner {
    display: none; width: 20px; height: 20px; border: 2px solid rgba(0,0,0,0.1);
    border-left-color: #000; border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.auth-btn.loading .spinner { display: block; }
.auth-btn.loading span { display: none; }

/* Notifications (Toast) */
.toast-container, #toast-container {
    position: fixed !important;
    top: auto !important;
    bottom: 24px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 10000000 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    pointer-events: none !important;
    width: auto !important;
    max-width: 92vw !important;
}
.toast {
    background: rgba(255, 59, 48, 0.18) !important;
    border: 1px solid #ff3b30 !important;
    color: #fff !important;
    padding: 8px 18px !important;
    border-radius: 999px !important;
    font-size: 0.78rem !important;
    font-weight: 500 !important;
    font-family: 'Inter', sans-serif !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45) !important;
    backdrop-filter: blur(16px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(140%) !important;
    opacity: 0;
    transform: translateY(16px);
    animation: toastIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
    white-space: nowrap !important;
    max-width: 90vw !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.toast.success {
    background: rgba(38, 223, 136, 0.15) !important;
    background-color: rgba(38, 223, 136, 0.15) !important;
    border: 1px solid #26DF88 !important;
    color: #eafff5 !important;
}
@keyframes toastIn { to { opacity: 1; transform: translateY(0); } }
.toast.fade-out { animation: toastOut 0.25s ease forwards !important; }
@keyframes toastOut { to { opacity: 0; transform: translateY(16px); } }


.auth-input::placeholder { font-size: 0.85rem; }

.has-icon-left { padding-left: 16px !important; }

.toast.error {
    background: rgba(255, 59, 48, 0.18) !important;
    border: 1px solid #ff3b30 !important;
    color: #ffeceb !important;
}

body { overscroll-behavior: none; }
