/* ============================================================
   modals.css — all modal screens
   Login/OAuth, newsletter popup, currency display, cookie notice
   All CSS-only where possible (checkbox hack for toggle state)
   ============================================================ */

/* ---- MODAL BASE ------------------------------------------- */
.fmo-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

/* Checkbox hack — no JS needed for open/close */
.fmo-modal-toggle { display: none; }
.fmo-modal-toggle:checked ~ .fmo-modal-overlay { display: flex; }

.fmo-modal-box {
    background: var(--fmo-white);
    border-radius: 3px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.fmo-modal-header {
    background: var(--fmo-nav-bg);
    color: var(--fmo-white);
    padding: 14px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fmo-modal-close {
    background: none;
    border: none;
    color: #ccc;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color var(--fmo-transition);
}
.fmo-modal-close:hover { color: var(--fmo-white); }

.fmo-modal-body { padding: 24px 20px; }

/* ---- LOGIN / OAUTH MODAL ---------------------------------- */
.fmo-login-modal .fmo-modal-box { max-width: 380px; }

.fmo-oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--fmo-border);
    border-radius: 2px;
    background: var(--fmo-white);
    font-size: 0.88rem;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background var(--fmo-transition), border-color var(--fmo-transition);
    text-decoration: none;
    color: var(--fmo-black);
}
.fmo-oauth-btn:hover { background: var(--fmo-off-white); border-color: #aaa; color: var(--fmo-black); }

.fmo-oauth-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.fmo-login-divider {
    text-align: center;
    font-size: 0.75rem;
    color: var(--fmo-mid-gray);
    margin: 14px 0;
    position: relative;
}
.fmo-login-divider::before,
.fmo-login-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: var(--fmo-border);
}
.fmo-login-divider::before { left: 0; }
.fmo-login-divider::after  { right: 0; }

.fmo-login-field {
    margin-bottom: 12px;
}
.fmo-login-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--fmo-black);
}
.fmo-login-field input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--fmo-border);
    border-radius: 2px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color var(--fmo-transition);
}
.fmo-login-field input:focus { border-color: var(--fmo-link); }

.fmo-login-links {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-top: 10px;
}

/* ---- NEWSLETTER MODAL ------------------------------------- */
/* Scroll-triggered — JS adds .open class after delay */
.fmo-newsletter-modal {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2500;
    width: 320px;
}
.fmo-newsletter-modal.open { display: block; }

.fmo-newsletter-inner {
    background: var(--fmo-white);
    border: 1px solid var(--fmo-border);
    border-radius: 3px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    padding: 20px;
    position: relative;
}

.fmo-newsletter-inner h3 {
    font-family: var(--fmo-font-sans);
    font-size: 1rem;
    margin-bottom: 6px;
    color: var(--fmo-black);
}

.fmo-newsletter-inner p {
    font-size: 0.78rem;
    color: var(--fmo-mid-gray);
    margin-bottom: 12px;
    line-height: 1.4;
}

.fmo-newsletter-field {
    display: flex;
    gap: 6px;
}
.fmo-newsletter-field input[type="email"] {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid var(--fmo-border);
    border-radius: 2px;
    font-size: 0.82rem;
    outline: none;
}
.fmo-newsletter-field input:focus { border-color: var(--fmo-link); }

.fmo-newsletter-dismiss {
    position: absolute;
    top: 8px; right: 10px;
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--fmo-mid-gray);
    cursor: pointer;
    line-height: 1;
}

/* ---- COOKIE NOTICE ---------------------------------------- */
/* localStorage flag controls show/hide — 20 lines CSS+JS combined */
#fmo-cookie-notice {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--fmo-dark);
    color: #ccc;
    font-size: 0.75rem;
    padding: 10px var(--fmo-content-pad);
    z-index: 2000;
    align-items: center;
    justify-content: space-between;
    gap: var(--fmo-gap);
}
#fmo-cookie-notice.visible { display: flex; }

#fmo-cookie-notice a { color: var(--fmo-gold); }

#fmo-cookie-accept {
    background: var(--fmo-gold);
    color: var(--fmo-white);
    border: none;
    padding: 5px 14px;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 2px;
    white-space: nowrap;
    transition: background var(--fmo-transition);
}
#fmo-cookie-accept:hover { background: var(--fmo-gold-light); }

/* ---- AFFILIATE DISCLOSURE BAR ----------------------------- */
/* Auto-hides after 10s via JS timer — CSS handles layout */
#fmo-disclosure {
    background: #fffbe6;
    border-bottom: 1px solid #f0e68c;
    padding: 6px var(--fmo-content-pad);
    font-size: 0.72rem;
    color: #555;
    text-align: center;
    line-height: 1.4;
}

@media (max-width: 800px) {
    .fmo-newsletter-modal {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        border-radius: 0;
    }
    #fmo-cookie-notice { flex-direction: column; text-align: center; }
}
