/* --- Auth Modal Overlay --- */
#auth-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

#auth-overlay.visible {
    display: flex;
}

/* --- Modal Box --- */
#auth-modal {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 380px;
    position: relative;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

#auth-modal h2 {
    text-align: center;
    margin: 0 0 1.2rem 0;
    color: #333;
}

#auth-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #888;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

#auth-close:hover {
    color: #333;
}

/* --- Form --- */
#auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#auth-form input {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
}

#auth-form input:focus {
    outline: none;
    border-color: #6153cc;
    box-shadow: 0 0 0 2px rgba(97, 83, 204, 0.2);
}

#auth-submit-btn {
    padding: 10px;
    background-color: #362A8D;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

#auth-submit-btn:hover {
    background-color: #4d42a3;
}

#auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- Error --- */
#auth-error {
    color: #dc3545;
    font-size: 0.85rem;
    text-align: center;
    min-height: 1.2em;
    margin: 0.25rem 0;
}

/* --- Toggle link --- */
#auth-toggle-text {
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d;
}

#auth-toggle-text a {
    color: #0056b3;
    text-decoration: underline;
    cursor: pointer;
}

/* --- Divider --- */
#auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.75rem 0;
    color: #adb5bd;
    font-size: 0.85rem;
}

#auth-divider::before,
#auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #dee2e6;
}

/* --- Google Button --- */
#auth-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    background-color: white;
    color: #333;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s;
}

#auth-google-btn:hover {
    background-color: #f8f9fa;
}

/* --- Header Auth Elements --- */
.header-user-btn,
.header-signin-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #dee2e6;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.header-signin-btn:hover,
.header-user-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* --- User dropdown --- */
.header-user-wrap {
    position: relative;
}

.header-user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 200;
    padding: 0.5rem 0;
}

.header-user-dropdown.open {
    display: block;
}

.header-user-dropdown .user-email {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    color: #6c757d;
    border-bottom: 1px solid #f0f0f0;
    word-break: break-all;
}

.header-user-dropdown button,
.header-user-dropdown .dropdown-link {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    text-align: left;
    font-size: 0.9rem;
    cursor: pointer;
    color: #333;
    text-decoration: none;
    box-sizing: border-box;
}

.header-user-dropdown button:hover,
.header-user-dropdown .dropdown-link:hover {
    background-color: #f8f9fa;
}
