/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* Transparent dark background */
    backdrop-filter: blur(5px); /* Blur effect */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    font-family: 'Plus Jakarta Sans', sans-serif; /* Clean modern font */
    overflow-y: auto; /* Enable scrolling */
    padding: 20px 0; /* Add vertical padding so content isn't flush */
}

/* Wrapper to hold Logo + Card + Footer */
.auth-layout-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
     /* gap removed as everything is inside card */
    width: 100%;
    max-width: 420px;
    margin: auto; /* Ensure it stays centered when scrolling */
}

/* 1. Logo */
.auth-top-logo img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

/* 2. Card */
.auth-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.05); /* Soft shadow */
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.auth-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

/* Views */
.auth-view {
    display: none !important;
    flex-direction: column;
    width: 100%;
}

.auth-view.active {
    display: flex !important;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: #000;
    margin-bottom: 30px;
    margin-top: 0;
    line-height: 1.2;
}

.auth-title.small {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 25px;
}

.auth-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* Inputs */
.auth-input-group {
    margin-bottom: 20px;
    width: 100%;
}

.auth-input {
    width: 100%;
    background-color: #F5F7F6; /* Very light gray/green tint */
    border: none;
    border-radius: 10px;
    padding: 16px 20px;
    font-size: 15px;
    color: #333;
    outline: none;
    transition: background 0.2s;
    box-sizing: border-box;
}

.auth-input:focus {
    background-color: #ECEFEF;
}

.auth-input::placeholder {
    color: #A0A0A0;
}

/* Forgot Password */
.auth-forgot-link {
    display: block;
    text-align: left;
    margin-top: -10px;
    margin-bottom: 24px;
}

.auth-forgot-link a {
    color: #4A90E2; 
    font-size: 14px;
    text-decoration: none;
}

/* Button */
.auth-btn {
    width: 100%;
    background-color: #0C9350; /* Brand Green */
    color: white;
    font-weight: 600;
    padding: 16px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-btn:hover {
    background-color: #087b41;
}

/* Divider */
.auth-divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
    color: #888;
    font-size: 14px;
}

/* Google Login Container */
.auth-social-login {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.auth-social-login .g_id_signin {
    display: flex;
    justify-content: center;
}

/* 3. Bottom Footer */
.auth-bottom-text {
    font-size: 14px;
    color: #333; /* Dark color for white background */
    font-weight: 500;
    text-align: center;
    margin-top: 20px;
}

.auth-bottom-text a {
    color: #4A90E2;
    text-decoration: none;
    margin-left: 5px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-card {
        padding: 30px 20px;
        width: 90%;
    }
    
    .auth-modal-overlay {
        align-items: flex-start; /* Start from top on mobile to allow scrolling */
        padding-top: 40px; /* Space from top */
        padding-bottom: 40px;
    }
}

/* Settings Popover Styles */
.settings-popover {
    position: absolute; /* Default to absolute for desktop */
    z-index: 9999;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 8px 0;
    min-width: 180px;
    display: none; /* Hidden by default */
}

.settings-popover-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.settings-popover-item:hover {
    background-color: #f5f7f6;
    color: #0C9350;
}

/* Mobile Settings Popover (Bottom Sheet) */
@media (max-width: 768px) {
    .settings-popover {
        position: fixed;
        top: auto;
        left: 0;
        bottom: 0;
        width: 100%;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
        padding-top: 8px;
        padding-bottom: max(20px, env(safe-area-inset-bottom)); /* Safe area for notched phones */
        max-height: 40vh; /* Prevent it from taking up entire screen */
        overflow-y: auto; /* Allow scrolling if needed */
        transform: translateY(100%); /* Hidden by default */
        transition: transform 0.3s ease-out;
        z-index: 10001; /* Above everything */
    }
    
    /* When visible in mobile */
    .settings-popover[style*="display: block"] {
        transform: translateY(0);
    }
    
    .settings-popover-item {
        padding: 18px 24px;
        font-size: 16px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .settings-popover-item:last-child {
        border-bottom: none; /* Remove border from last item */
    }
}

/* Backdrop for mobile */
.settings-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
}

/* Modifiers for specific views */
.view-section {
  display: none;
}
.view-section.active {
  display: block;
}
