/* ============================================
 * AuthMe — Overlay Styles
 * ============================================
 *
 * Positioning, backdrop, and overlay container.
 * Uses position:fixed + z-index:1000 so the form
 * floats above ALL page content as a modal popup.
 *
 * @package AuthMe
 * ============================================ */

/* ── Body lock when overlay is open ──────── */
body.authme-body-locked {
    overflow: hidden;
}

/* ── Backdrop ────────────────────────────── */
.authme-overlay-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.authme-overlay-backdrop.authme-overlay-visible {
    opacity: 1;
}

/* ── Container ───────────────────────────── */
.authme-overlay-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    background-color: var(--authme-card-bg);
    border-radius: var(--authme-radius-lg);
    padding: 40px;
    box-shadow: var(--authme-shadow-lg);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.35s ease;
    opacity: 0;
}

.authme-overlay-backdrop.authme-overlay-visible .authme-overlay-container {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Custom scrollbar for the overlay */
.authme-overlay-container::-webkit-scrollbar {
    width: 4px;
}

.authme-overlay-container::-webkit-scrollbar-track {
    background: transparent;
}

.authme-overlay-container::-webkit-scrollbar-thumb {
    background: var(--authme-border);
    border-radius: 4px;
}

/* ── Close Button ────────────────────────── */
.authme-overlay-close {
    position: absolute !important;
    top: 14px;
    right: 14px;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    background: var(--authme-bg, #f8fafc) !important;
    border: 1px solid var(--authme-border, #e2e8f0) !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    color: var(--authme-text-muted, #64748b) !important;
    z-index: 10;
    margin: 0;
    appearance: none;
    justify-content: center;
    align-items: center;
}

/* Ensure the SVG icon is always visible */
.authme-overlay-close svg {
    display: block !important;
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
}

.authme-overlay-close:hover {
    background: var(--authme-error-bg, #fef2f2) !important;
    color: var(--authme-error, #dc2626) !important;
    border-color: var(--authme-error, #dc2626) !important;
}

/* ── Screen Switching ────────────────────── */
.authme-screen {
    display: none;
    animation: authmeSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.authme-screen.authme-screen-active {
    display: block;
}

@keyframes authmeSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Common Form Elements ────────────────── */
.authme-form-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--authme-text-main);
    letter-spacing: -0.5px;
    text-align: center;
    margin-bottom: 8px;
}

.authme-form-subtitle {
    font-size: 14px;
    color: var(--authme-text-muted);
    text-align: center;
    margin-bottom: 32px;
    line-height: 1.5;
}

/* ── Switch Links ────────────────────────── */
.authme-switch-link {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--authme-text-muted);
}

.authme-link {
    color: var(--authme-primary);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    margin-left: 4px;
    transition: color 0.2s;
}

.authme-link:hover {
    color: var(--authme-primary-hover);
    text-decoration: underline;
}

.authme-link-disabled {
    color: var(--authme-text-placeholder) !important;
    cursor: not-allowed !important;
    text-decoration: none !important;
}

.authme-link-disabled:hover {
    color: var(--authme-text-placeholder) !important;
    text-decoration: none !important;
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 480px) {
    .authme-overlay-container {
        padding: 30px 20px;
        border-radius: 16px;
    }
}
