/* ==========================================================
   FOMO Popup — Single-screen, Contact-first, 6 Services Grid
   ========================================================== */

.fomo-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    pointer-events: none;
}

.fomo-modal.is-open {
    display: block;
    pointer-events: auto;
}

.fomo-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 61, 45, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 280ms var(--ease-out);
}

.fomo-modal.is-open .fomo-modal__backdrop {
    opacity: 1;
}

.fomo-modal__inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.94);
    width: calc(100% - 32px);
    max-width: 760px;
    max-height: 92vh;
    background: var(--jemira-bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(13, 107, 79, 0.10);
    overflow: hidden;
    opacity: 0;
    transition: opacity 320ms var(--ease-out), transform 320ms var(--ease-spring);
}

.fomo-modal.is-open .fomo-modal__inner {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}


/* ==========================================================
   Close Button
   ========================================================== */

.fomo-modal__close {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--jemira-border-light);
    border-radius: var(--radius-circle);
    color: var(--jemira-text);
    font-size: var(--text-base);
    cursor: pointer;
    z-index: 5;
    transition: all var(--transition-fast);
}

.fomo-modal__close:hover {
    background: var(--jemira-text);
    color: #fff;
    border-color: var(--jemira-text);
    transform: rotate(90deg);
}


/* ==========================================================
   Body — single-screen, no scroll on standard viewports
   ========================================================== */

.fomo-modal__body {
    padding: var(--space-xl) var(--space-2xl) var(--space-lg);
    text-align: center;
    overflow-y: auto;
    max-height: 92vh;
}


/* ==========================================================
   1. Headline (top, largest)
   ========================================================== */

.fomo-modal__head {
    position: relative;
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-md);
}

.fomo-modal__pulse {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-circle);
    background: linear-gradient(135deg, var(--jemira-gold), var(--jemira-gold-light));
    color: #fff;
    font-size: var(--text-lg);
    box-shadow: 0 6px 20px rgba(200, 169, 81, 0.40);
    margin-bottom: var(--space-sm);
    animation: fomoPulse 1.6s ease-in-out infinite;
}

@keyframes fomoPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 6px 20px rgba(200, 169, 81, 0.40); }
    50%      { transform: scale(1.08); box-shadow: 0 10px 28px rgba(200, 169, 81, 0.65); }
}

.fomo-modal__title {
    font-size: clamp(var(--text-lg), 2.4vw, var(--text-2xl));
    color: var(--jemira-text);
    font-weight: 800;
    line-height: 1.4;
    margin: 0;
}

.fomo-modal__title-line {
    display: block;
    color: var(--jemira-text);
}

.fomo-modal__title-line:first-child {
    color: var(--jemira-primary);
    margin-bottom: 4px;
}


/* ==========================================================
   2. Contact buttons (above the fold) — phone + WhatsApp
   ========================================================== */

.fomo-modal__contact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.fomo-contact {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    color: #fff;
    text-decoration: none;
    font-family: inherit;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
    overflow: hidden;
    text-align: start;
}

.fomo-contact::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.fomo-contact:hover {
    transform: translateY(-3px);
    color: #fff;
}

.fomo-contact:hover::before { opacity: 1; }

.fomo-contact--whatsapp {
    background: linear-gradient(135deg, var(--jemira-whatsapp) 0%, var(--jemira-whatsapp-dark) 100%);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.30);
    animation: fomoWaPulse 2.4s ease-in-out infinite;
}

.fomo-contact--whatsapp:hover {
    box-shadow: 0 12px 32px rgba(37, 211, 102, 0.55);
}

@keyframes fomoWaPulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(37, 211, 102, 0.30); }
    50%      { box-shadow: 0 12px 32px rgba(37, 211, 102, 0.55); }
}

.fomo-contact--call {
    background: var(--gradient-primary);
    box-shadow: 0 8px 24px rgba(13, 107, 79, 0.30);
}

.fomo-contact--call:hover {
    box-shadow: 0 12px 32px rgba(13, 107, 79, 0.45);
}

.fomo-contact__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-circle);
    font-size: var(--text-xl);
    color: #fff;
}

.fomo-contact__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    line-height: 1.2;
}

.fomo-contact__text strong {
    font-size: var(--text-base);
    font-weight: 700;
    color: #fff;
}

.fomo-contact__text small {
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.85);
    direction: ltr;
    unicode-bidi: plaintext;
}

[dir="rtl"] .fomo-contact__text { direction: rtl; }


/* ==========================================================
   3. Subheading
   ========================================================== */

.fomo-modal__sub {
    font-size: var(--text-sm);
    color: var(--jemira-text-secondary);
    line-height: 1.6;
    margin: 0 0 var(--space-md);
    padding: 0 var(--space-sm);
    max-width: 600px;
    margin-inline: auto;
}


/* ==========================================================
   4. Services — 6 items, 3-col desktop, 2-col mobile, BOLD
   ========================================================== */

.fomo-modal__services {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-md);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    text-align: start;
}

.fomo-modal__service {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--jemira-bg-white);
    border: 1.5px solid var(--jemira-border-light);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--jemira-text);
    line-height: 1.3;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.fomo-modal__service::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--jemira-primary);
    transform: scaleY(0);
    transition: transform var(--transition-fast);
}

.fomo-modal__service:hover {
    border-color: var(--jemira-primary);
    background: rgba(13, 107, 79, 0.03);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.fomo-modal__service:hover::before { transform: scaleY(1); }

.fomo-modal__service i {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(13, 107, 79, 0.10), rgba(76, 175, 80, 0.06));
    color: var(--jemira-primary);
    border-radius: var(--radius-sm);
    font-size: var(--text-base);
    transition: all var(--transition-fast);
}

.fomo-modal__service:hover i {
    background: var(--gradient-primary);
    color: #fff;
    transform: scale(1.06) rotate(-4deg);
}

.fomo-modal__service span {
    flex: 1;
    min-width: 0;
}

/* Urgent (Permit Issuance + Renewal) — gold accent */
.fomo-modal__service--urgent {
    border-color: rgba(200, 169, 81, 0.45);
    background: linear-gradient(135deg, rgba(200, 169, 81, 0.08), var(--jemira-bg-white) 60%);
}

.fomo-modal__service--urgent::before {
    background: var(--jemira-gold);
}

.fomo-modal__service--urgent i {
    background: linear-gradient(135deg, rgba(200, 169, 81, 0.20), rgba(200, 169, 81, 0.10));
    color: var(--jemira-gold);
}

.fomo-modal__service--urgent:hover {
    border-color: var(--jemira-gold);
}

.fomo-modal__service--urgent:hover i {
    background: linear-gradient(135deg, var(--jemira-gold), var(--jemira-gold-light));
    color: #fff;
}


/* ==========================================================
   5. Office branding (small footer)
   ========================================================== */

.fomo-modal__brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--jemira-border-light);
    width: 100%;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--jemira-text-muted);
    letter-spacing: 0.02em;
}

.fomo-modal__brand i {
    color: var(--jemira-accent);
    font-size: var(--text-base);
}


/* ==========================================================
   Body lock when popup open
   ========================================================== */

body.fomo-locked {
    overflow: hidden;
}


/* ==========================================================
   Responsive — Tablet
   ========================================================== */

@media (max-width: 767px) {
    .fomo-modal__body { padding: var(--space-lg) var(--space-md) var(--space-md); }
    .fomo-modal__services { grid-template-columns: repeat(2, 1fr); }
    .fomo-modal__title { font-size: var(--text-lg); }
    .fomo-contact__icon { width: 42px; height: 42px; font-size: var(--text-lg); }
}


/* ==========================================================
   Responsive — Mobile (bottom sheet)
   ========================================================== */

@media (max-width: 575px) {
    .fomo-modal__inner {
        top: auto;
        bottom: 0;
        left: 0;
        transform: translate(0, 100%);
        width: 100%;
        max-width: 100%;
        max-height: 96vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }

    .fomo-modal.is-open .fomo-modal__inner {
        transform: translate(0, 0);
    }

    .fomo-modal__body {
        padding: var(--space-lg) var(--space-md) var(--space-md);
        max-height: 96vh;
    }

    .fomo-modal__pulse { width: 38px; height: 38px; font-size: var(--text-base); margin-bottom: var(--space-xs); }
    .fomo-modal__title { font-size: var(--text-base); }
    .fomo-modal__head { padding-bottom: var(--space-sm); margin-bottom: var(--space-sm); }

    /* Contact buttons stay side-by-side, more compact */
    .fomo-modal__contact { gap: var(--space-sm); margin-bottom: var(--space-sm); }
    .fomo-contact { padding: var(--space-sm) var(--space-md); gap: var(--space-sm); }
    .fomo-contact__icon { width: 38px; height: 38px; font-size: var(--text-base); }
    .fomo-contact__text strong { font-size: var(--text-sm); }
    .fomo-contact__text small { font-size: 11px; }

    .fomo-modal__sub { font-size: var(--text-xs); margin-bottom: var(--space-sm); }

    /* Services — 2 cols on mobile, tighter */
    .fomo-modal__services { gap: 6px; margin-bottom: var(--space-sm); }
    .fomo-modal__service { padding: 8px var(--space-sm); font-size: 12px; gap: 6px; }
    .fomo-modal__service i { width: 28px; height: 28px; font-size: var(--text-sm); }

    .fomo-modal__brand { font-size: 11px; padding-top: var(--space-xs); }
}


/* ==========================================================
   Reduced motion
   ========================================================== */

@media (prefers-reduced-motion: reduce) {
    .fomo-modal__pulse,
    .fomo-contact--whatsapp {
        animation: none;
    }

    .fomo-modal__inner,
    .fomo-modal__backdrop {
        transition-duration: 0.01ms;
    }
}
