/* ==========================================================================
   SNAPIMAGE AUTH & MODAL SYSTEM (Works Universally on All Pages)
   ========================================================================== */

/* 1. Popover Isolation: Hide when not open */
.auth-popup:not(:popover-open) {
    display: none !important;
}

.auth-popup:popover-open {
    display: flex !important;
    flex-direction: column;
    gap: 14px;
}

.auth-popup {
    width: 360px;
    max-width: 92vw;
    position: fixed;
    padding: 26px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.2);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    z-index: 99999;
}

.auth-popup::backdrop {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Close button */
.close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    line-height: 30px;
    text-align: center;
    padding: 0;
    font-size: 14px;
}

.close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Modal Header */
.auth-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}

.auth-header p {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
    margin-bottom: 0;
}

/* Form Controls */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-popup .form-control {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    color: #0f172a !important;
    font-size: 14px;
    padding: 10px 12px;
}

.auth-popup .form-control:focus {
    background: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
    outline: none !important;
}

.auth-popup .form-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}

.remember-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.auth-popup .form-check {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 0;
}

.auth-popup .form-check-input {
    margin: 0;
    accent-color: #2563eb;
}

.forgot-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.forgot-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.submit-btn:hover {
    background: #1d4ed8;
}

/* Divider & Footer */
.auth-divider {
    display: flex;
    align-items: center;
    color: #94a3b8;
    font-size: 12px;
    margin: 6px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.auth-divider span {
    padding: 0 10px;
}

.auth-footer {
    text-align: center;
    font-size: 13px;
    color: #64748b;
}

.auth-footer a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Notifications and Toasts */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100000;
}

.toast {
    min-width: 250px;
    padding: 12px 16px;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    margin-top: 10px;
    background: #0f172a;
}

.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }
.toast.info { background: #2563eb; }

.notification {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 10px;
}
.notification.success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.notification.error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.notification.info { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }