/* PlanMyCrew — Smart Fuel Saving Preview Modal
   Minimal one-screen popup. Map visual + headline + single CTA.
   All selectors namespaced `.pmc-fsm-` so it never collides with site styles.
   To remove: delete this file + the matching JS + the HTML block. */

.pmc-fsm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 19, 42, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    font-family: 'DM Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.pmc-fsm-overlay.is-visible {
    opacity: 1;
    pointer-events: all;
}

.pmc-fsm-modal {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow: hidden;
    background: #FFFFFF;
    border-radius: 22px;
    box-shadow: 0 32px 90px rgba(11, 19, 42, 0.45);
    transform: translateY(28px) scale(0.96);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.pmc-fsm-overlay.is-visible .pmc-fsm-modal {
    transform: translateY(0) scale(1);
}

/* Close button */
.pmc-fsm-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    color: #1B2A52;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(11, 19, 42, 0.18);
    transition: background 0.2s ease, transform 0.25s ease;
}

.pmc-fsm-close:hover {
    background: #FFFFFF;
    transform: rotate(90deg);
}

/* Route visual */
.pmc-fsm-visual {
    position: relative;
    background: linear-gradient(160deg, #1B2A52 0%, #111C3A 100%);
    aspect-ratio: 16 / 7;
    min-height: 200px;
    border-radius: 22px 22px 0 0;
    overflow: hidden;
}

.pmc-fsm-visual svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.pmc-fsm-visual-legend {
    position: absolute;
    bottom: 14px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    pointer-events: none;
}

.pmc-fsm-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 11px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.10);
    color: #FFFFFF;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    white-space: nowrap;
}

.pmc-fsm-tag em {
    font-style: normal;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 10.5px;
    letter-spacing: 0.02em;
}

.pmc-fsm-tag.is-before { color: #FFB4A0; }
.pmc-fsm-tag.is-before::before { content: ''; width: 10px; height: 3px; background: #E8654A; border-radius: 2px; flex-shrink: 0; }
.pmc-fsm-tag.is-before em { background: rgba(232, 101, 74, 0.22); color: #FFD4C6; }

.pmc-fsm-tag.is-after  { color: #B8F0D6; }
.pmc-fsm-tag.is-after::before  { content: ''; width: 10px; height: 3px; background: #2ECC8F; border-radius: 2px; flex-shrink: 0; }
.pmc-fsm-tag.is-after em { background: rgba(46, 204, 143, 0.22); color: #D4F6E6; }

/* Mobile: tighter legend so it never wraps under the close button area */
@media (max-width: 480px) {
    .pmc-fsm-visual-legend { left: 12px; right: 12px; font-size: 10.5px; gap: 6px; }
    .pmc-fsm-tag { padding: 5px 9px; gap: 6px; }
    .pmc-fsm-tag em { padding: 2px 6px; font-size: 10px; }
}

/* Body */
.pmc-fsm-body {
    padding: 28px 32px 32px;
    text-align: center;
}

.pmc-fsm-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(232, 101, 74, 0.10);
    color: #E8654A;
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(232, 101, 74, 0.22);
    margin-bottom: 14px;
}

.pmc-fsm-badge::before { content: '⛽'; font-size: 12px; }

.pmc-fsm-h2 {
    font-family: 'Manrope', sans-serif;
    font-weight: 900;
    font-size: clamp(20px, 2.4vw, 26px);
    color: #1B2A52;
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin: 0 0 12px;
}

.pmc-fsm-h2 span { color: #E8654A; }

.pmc-fsm-sub {
    font-size: 14.5px;
    color: #5A6880;
    line-height: 1.65;
    max-width: 440px;
    margin: 0 auto 22px;
}

.pmc-fsm-sub strong { color: #1B2A52; font-weight: 700; }

/* Primary CTA */
.pmc-fsm-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 320px;
    background: #E8654A;
    color: #FFFFFF;
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: -0.005em;
    padding: 15px 22px;
    border-radius: 12px;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(232, 101, 74, 0.36);
    transition: background 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease;
}

.pmc-fsm-cta:hover {
    background: #F07B62;
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(232, 101, 74, 0.42);
}

.pmc-fsm-cta::after {
    content: '→';
    font-weight: 700;
    transition: transform 0.2s ease;
}

.pmc-fsm-cta:hover::after { transform: translateX(3px); }

/* Auto-close timer bar */
.pmc-fsm-timer-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #E8654A, #2ECC8F);
    width: 100%;
    transform-origin: left center;
}

.pmc-fsm-modal.is-counting .pmc-fsm-timer-bar {
    animation: pmc-fsm-shrink linear forwards;
}

@keyframes pmc-fsm-shrink {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* ────────── RESPONSIVE ────────── */
@media (max-width: 640px) {
    .pmc-fsm-overlay { padding: 12px; }
    .pmc-fsm-modal { border-radius: 18px; }
    .pmc-fsm-visual { border-radius: 18px 18px 0 0; min-height: 170px; }
    .pmc-fsm-body { padding: 24px 22px 26px; }
    .pmc-fsm-h2 { font-size: 20px; }
    .pmc-fsm-sub { font-size: 13.5px; margin-bottom: 18px; }
    .pmc-fsm-close { top: 10px; right: 10px; width: 32px; height: 32px; font-size: 18px; }
    .pmc-fsm-cta { font-size: 14px; padding: 14px 20px; }
}
