/* assets/css/auth.css */

/* Modern Glassmorphism Design */

.auth-page {
    min-height: 100vh;
    min-height: 100dvh; /* For mobile browsers */
    display: flex;
    align-items: center;
    justify-content: center;
    /* Animated Mesh Gradient Background */
    background: radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
                radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), 
                radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
    background-size: 200% 200%;
    animation: gradientBG 15s ease infinite;
    padding: 1.5rem;
    position: relative;
    overflow-y: auto; /* Allow scrolling if content overflows */
}

/* Add a dark overlay pattern or noise for texture if desired, 
   but for now let's stick to a vibrant deep gradient */
.auth-page::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 60vw; height: 60vw;
    background: rgb(79, 70, 229);
    filter: blur(120px);
    opacity: 0.2;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    animation: pulseBlob 8s infinite alternate;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulseBlob {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.2; }
    100% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.4; }
}


.auth-container {
    width: 100%;
    max-width: 380px; /* Reduced from 440px for a tighter look */
    position: relative;
    z-index: 10;
}

.auth-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 2rem 1.75rem; /* Reduced from 2.5rem */
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 20px 40px -10px rgba(0, 0, 0, 0.2), 
        0 0 0 1px rgba(255, 255, 255, 0.4) inset;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25), 
        0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

.auth-logo {
    display: flex; 
    justify-content: center; 
    margin-bottom: 1rem; /* Further reduced from 1.5rem */
}

.auth-logo img {
    height: 36px; /* Further reduced from 44px */ 
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.auth-logo:hover img {
    transform: scale(1.05);
}

.auth-card h2 {
    text-align: center;
    font-size: 1.5rem; /* Reduced from 1.75rem */
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.auth-card p {
    text-align: center;
    color: #64748b;
    color: #64748b;
    margin-bottom: 1.25rem; /* Reduced from 1.75rem */
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Google Button */
#g_id_onload { display: none; }
.g_id_signin {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: center;
}

/* Form Elements */
.form-group { margin-bottom: 1rem; } /* Reduced from 1.25rem */
.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: #334155;
    font-size: 0.9rem;
    margin-left: 2px;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem; /* Reduced from 0.875rem */
    border: 2px solid #e2e8f0; /* Slightly thicker border for modern look */
    border-radius: 12px;
    background-color: #f8fafc;
    font-family: var(--font-primary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    color: #1e293b;
    font-weight: 500;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-input::placeholder { color: #94a3b8; font-weight: 400; }

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 0.8rem; /* Reduced from 0.9rem */
    font-size: 1rem;
    border-radius: 12px;
    font-weight: 600;
    margin-top: 0.5rem;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 12px -1px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    border-radius: 12px;
    font-weight: 600;
    background: #1e293b;
    color: white;
    margin-top: 0.5rem;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(30, 41, 59, 0.2);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 8px 12px -1px rgba(30, 41, 59, 0.3);
}

/* Footer & Divider */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #64748b;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
}
.auth-footer a:hover { text-decoration: underline; }

hr { border-top-color: #cbd5e1 !important; opacity: 0.6; }

/* Animation */
.fade-up {
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }


/* Modals (Glassmorphism update) */
.custom-modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    padding: 2.5rem 2rem;
    border-radius: 24px;
    width: 90%;
    max-width: 480px; 
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Keep existing modal inner styles */
.custom-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); /* Darker overlay */
    backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center;
    z-index: 10000; opacity: 0; animation: fadeIn 0.3s forwards;
}

/* Toasts */
#custom-toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; }
.custom-toast {
    display: flex; gap: 12px; padding: 16px 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.1);
    margin-bottom: 10px;
    animation: slideInRight 0.4s ease-out forwards;
    transform: translateX(100%);
    opacity: 0;
    border: 1px solid rgba(255, 255, 255, 0.5);
}
@keyframes slideInRight { to { transform: translateX(0); opacity: 1; } }
.custom-toast.success { border-left: 4px solid #10b981; }
.custom-toast.error { border-left: 4px solid #ef4444; }
.custom-toast.info { border-left: 4px solid #3b82f6; }

/* Keep utilities */
.modal-close-btn { position: absolute; top: 1rem; right: 1rem; border: none; background: none; font-size: 1.5rem; cursor: pointer; color: #94a3b8; }
.modal-close-btn:hover { color: #334155; }
.modal-icon { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 1.5rem; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.modal-icon.error { background: #fee2e2; color: #ef4444; }
.modal-icon.success { background: #d1fae5; color: #10b981; }
.modal-icon.loading { background: #ebe9fe; color: #4f46e5; animation: spin 1s linear infinite; }
.modal-btn { background: #4f46e5; color: white; padding: 0.75rem; border-radius: 12px; width: 100%; border: none; font-weight: 600; margin-top: 1rem; cursor: pointer; }
.active .custom-modal { transform: scale(1); }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes scaleUp { to { transform: scale(1); } }
@keyframes spin { 100% { transform: rotate(360deg); } }

.toast-icon { font-size: 1.25rem; }
.success .toast-icon { color: #10b981; }
.error .toast-icon { color: #ef4444; }
.info .toast-icon { color: #3b82f6; }

.toast-content h4 { margin: 0; font-size: 0.95rem; font-weight: 700; color: #1e293b; }
.toast-content p { margin: 2px 0 0; font-size: 0.85rem; color: #64748b; text-align: left !important; }

/* Mobile */
/* Mobile - Single Screen View Optimization */
@media (max-width: 480px) {
    .auth-page {
        padding: 0.5rem; /* Minimal page padding */
        align-items: center; /* Center vertically for cleaner look if it fits, or flex-start if too tall */
        justify-content: center;
        /* Remove explicit top padding to let flexbox center it */
        padding-top: 0.5rem; 
    }

    .auth-container { 
        max-width: 100%; 
        width: 100%;
    }

    .auth-card { 
        padding: 1.25rem 1rem; /* Extremely compact padding */
        border-radius: 16px; 
    }

    .auth-logo { margin-bottom: 0.5rem; }
    .auth-logo img { height: 28px; } /* Even smaller logo */

    .auth-card h2 { 
        font-size: 1.2rem; 
        margin-bottom: 0.1rem;
    }
    
    .auth-card p {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }

    .form-group { margin-bottom: 0.625rem !important; }
    .form-group label { 
        font-size: 0.8rem; 
        margin-bottom: 0.2rem; 
    }
    
    .form-input { 
        padding: 0.6rem 0.75rem; 
        font-size: 16px; /* Prevent iOS zoom */
        border-radius: 8px; /* Tighter radius */
    }

    .btn-primary, .btn-secondary {
        padding: 0.7rem;
        margin-top: 0.25rem;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    .auth-footer {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        font-size: 0.75rem;
    }
}

/* Password Toggle Styles */
.password-wrapper { position: relative; }
.toggle-password {
    position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
    cursor: pointer; color: #94a3b8; font-size: 1.1rem; user-select: none; z-index: 2;
}
.toggle-password:hover { color: var(--primary-color); }
