/* ==========================================================================
   Feature Page Template v2 (fp2-)
   --------------------------------------------------------------------------
   One component system for every /plugin/ feature page. Loaded ONLY for
   pages using page-feature-v2.php (filemtime-busted), so legacy pages are
   untouched while they migrate.

   Rules this file enforces by construction:
   - Spacing comes from tokens (--fp2-s1..s4). No ad-hoc section paddings.
   - Light-only outer chrome. The dark sc-* admin mockup kit from style.css
     may appear INSIDE fp2-frame--dark, mimicking the app; nothing else is
     dark. No prefers-color-scheme here (tools/check-theme-css.sh blocks it).
   - Zero !important.
   - Every animation respects prefers-reduced-motion.
   - One container width (1180px) for the whole page.
   ========================================================================== */

.fp2 {
    --fp2-s1: 40px;
    --fp2-s2: 64px;
    --fp2-s3: 96px;
    --fp2-s4: 128px;
    --fp2-blue: #0062ff;
    --fp2-blue-deep: #0047cc;
    --fp2-green: #10b981;
    --fp2-amber: #f59e0b;
    --fp2-ink: #0f172a;
    --fp2-muted: #475569;
    --fp2-dim: #64748b;
    --fp2-border: #dbe6f6;
    --fp2-bg-soft: #f6f9ff;
    --fp2-shadow-soft: 0 8px 24px rgba(20, 50, 110, 0.09);
    --fp2-shadow-lift: 0 14px 40px rgba(20, 50, 110, 0.13);
    background: #fff;
    color: var(--fp2-ink);
    overflow-x: clip;
}

.fp2-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --------------------------------------------------------------------------
   Hero. Tier pill is the only H1 on the page; the big line is a styled <p>.
   Ported from the .fh-* block in page-feature.php so all pages share it.
   -------------------------------------------------------------------------- */
.fp2-hero {
    position: relative;
    padding: 88px 0 var(--fp2-s2);
    text-align: center;
    overflow: hidden;
    background: linear-gradient(180deg, #fff 0%, #f8faff 100%);
}
.fp2-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(60% 50% at 50% 0%, rgba(0, 98, 255, 0.08), transparent 60%),
        radial-gradient(40% 40% at 80% 30%, rgba(16, 185, 129, 0.06), transparent 70%);
}
.fp2-hero .fp2-container { position: relative; }

.fp2-tier {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.4;
    margin: 0 0 18px;
}
.fp2-tier--free {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
}
.fp2-tier--pro {
    background: linear-gradient(135deg, #0062ff, #0047cc);
    color: #fff;
    box-shadow: 0 6px 20px rgba(0, 98, 255, 0.25);
}
.fp2-tier--growth {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: #fff;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.25);
}

.fp2-h {
    font-family: 'Barlow', sans-serif;
    font-weight: 800;
    font-size: clamp(36px, 5vw, 60px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--fp2-ink);
    margin: 0 0 18px;
}
.fp2-h em {
    font-style: normal;
    background: linear-gradient(135deg, #0062ff 0%, #00c2ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.fp2-lead {
    font-size: 19px;
    color: var(--fp2-muted);
    max-width: 660px;
    margin: 0 auto 28px;
    line-height: 1.55;
}

.fp2-cta-row {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}
.fp2-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 26px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.fp2-btn--primary {
    background: linear-gradient(135deg, #0062ff, #0047cc);
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 98, 255, 0.3);
}
.fp2-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 38px rgba(0, 98, 255, 0.38);
    color: #fff;
}
.fp2-btn--ghost {
    background: #fff;
    color: var(--fp2-ink);
    border: 1.5px solid var(--fp2-border);
    font-weight: 600;
    padding: 14px 22px;
}
.fp2-btn--ghost:hover {
    border-color: var(--fp2-blue);
    transform: translateY(-2px);
    color: var(--fp2-ink);
}

/* --------------------------------------------------------------------------
   Sections. Exactly two backgrounds alternate; both light.
   -------------------------------------------------------------------------- */
.fp2-section {
    padding: var(--fp2-s3) 0;
}
.fp2-section--soft {
    background: var(--fp2-bg-soft);
}
.fp2-eyebrow {
    display: block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fp2-blue);
    margin: 0 0 12px;
}
.fp2-h2 {
    font-family: 'Barlow', sans-serif;
    font-weight: 800;
    font-size: clamp(26px, 3.2vw, 38px);
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--fp2-ink);
    margin: 0 0 14px;
}
.fp2-copy {
    font-size: 16.5px;
    line-height: 1.65;
    color: var(--fp2-muted);
    max-width: 720px;
}
.fp2-copy strong { color: var(--fp2-ink); }
.fp2-center { text-align: center; }
.fp2-center .fp2-copy { margin-left: auto; margin-right: auto; }

/* --------------------------------------------------------------------------
   Alternating feature rows. Grid + order, no direction hacks.
   -------------------------------------------------------------------------- */
.fp2-row {
    display: grid;
    grid-template-columns: 1.08fr 1fr;
    gap: var(--fp2-s1);
    align-items: center;
}
.fp2-row + .fp2-row { margin-top: var(--fp2-s3); }
.fp2-row--flip .fp2-row-media { order: 1; }
.fp2-row--flip .fp2-row-copy { order: 2; }

/* Belt and braces against filter-injected markup: wpautop is disabled for
   this template in functions.php, but any phantom empty <p> or stray <br>
   from a cached render must never take a grid cell or pad a frame. */
.fp2 p:empty { display: none; }
.fp2-frame br { display: none; }

/* A row with a single child spans the full width instead of leaving an
   empty second column. Copy stays readable via fp2-copy's own max-width. */
.fp2-row > .fp2-row-copy:only-child,
.fp2-row > .fp2-row-media:only-child { grid-column: 1 / -1; }

.fp2-bullets {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
    display: grid;
    gap: 12px;
}
.fp2-bullets li {
    position: relative;
    padding-left: 30px;
    font-size: 16px;
    line-height: 1.55;
    color: var(--fp2-muted);
}
.fp2-bullets li strong { color: var(--fp2-ink); }
.fp2-bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* --------------------------------------------------------------------------
   Media frames. Light frame for real screenshots; a dark variant hosts the
   sc-* admin mockup kit (which is deliberately dark, like the app).
   -------------------------------------------------------------------------- */
.fp2-frame {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--fp2-border);
    background: #fff;
    box-shadow: var(--fp2-shadow-lift);
}
.fp2-frame img {
    display: block;
    width: 100%;
    height: auto;
}
.fp2-frame--glow {
    box-shadow:
        0 0 0 1px rgba(0, 98, 255, 0.10),
        0 10px 30px rgba(0, 98, 255, 0.10),
        var(--fp2-shadow-lift);
}
.fp2-frame--dark {
    background: #0c0e14;
    border-color: rgba(38, 45, 64, 0.8);
}
.fp2-caption {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--fp2-dim);
    margin-top: 10px;
}
.fp2-caption strong { color: var(--fp2-ink); font-weight: 600; }

/* --------------------------------------------------------------------------
   Stat band. Collapses honestly at every width.
   -------------------------------------------------------------------------- */
.fp2-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.fp2-stat {
    background: #fff;
    border: 1px solid var(--fp2-border);
    border-radius: 14px;
    padding: 22px 20px;
    box-shadow: var(--fp2-shadow-soft);
}
.fp2-stat b {
    display: block;
    font-family: 'Barlow', sans-serif;
    font-weight: 800;
    font-size: 30px;
    letter-spacing: -0.01em;
    color: var(--fp2-ink);
}
.fp2-stat span {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--fp2-dim);
}

/* --------------------------------------------------------------------------
   Video facade. Clone of the docs pattern: event-delegated, any number of
   embeds per page, no external JS, no YouTube cookies until clicked.
   -------------------------------------------------------------------------- */
.fp2-video { margin: 0; }
.fp2-video__frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    background: #0f1626;
    border: 1px solid #cddffd;
    cursor: pointer;
    box-shadow: var(--fp2-shadow-lift);
}
.fp2-video__frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease, opacity 0.3s ease;
}
.fp2-video__frame:hover img { transform: scale(1.02); opacity: 0.92; }
.fp2-video__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.fp2-video__frame.is-playing img,
.fp2-video__frame.is-playing .fp2-video__btn,
.fp2-video__frame.is-playing .fp2-video__label { display: none; }
.fp2-video__btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    border: 0;
    background: none;
    padding: 0;
    cursor: pointer;
}
.fp2-video__btn svg { width: 68px; height: 48px; display: block; }
.fp2-video__btn .bg { fill: #212121; fill-opacity: 0.82; transition: fill 0.2s ease, fill-opacity 0.2s ease; }
.fp2-video__frame:hover .fp2-video__btn .bg { fill: #1b6ff5; fill-opacity: 1; }
.fp2-video__label {
    position: absolute;
    left: 14px;
    bottom: 14px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(9, 14, 24, 0.78);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    backdrop-filter: blur(4px);
}
.fp2-video__caption {
    font-size: 13.5px;
    color: var(--fp2-dim);
    margin-top: 10px;
}

/* --------------------------------------------------------------------------
   FAQ accordion. Own namespace, so the two legacy .faq-item definitions in
   style.css never touch it.
   -------------------------------------------------------------------------- */
.fp2-faq {
    max-width: 760px;
    margin: 0 auto;
}
.fp2-faq-item {
    background: #fff;
    border: 1.5px solid var(--fp2-border);
    border-radius: 14px;
    margin-bottom: 12px;
    overflow: hidden;
}
.fp2-faq-q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 18px 22px;
    background: none;
    border: 0;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    color: var(--fp2-ink);
}
.fp2-faq-q svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    transition: transform 0.25s ease;
    stroke: var(--fp2-dim);
}
.fp2-faq-item.is-open .fp2-faq-q svg { transform: rotate(180deg); }
.fp2-faq-a {
    display: none;
    padding: 0 22px 20px;
    font-size: 15.5px;
    line-height: 1.65;
    color: var(--fp2-muted);
}
.fp2-faq-item.is-open .fp2-faq-a { display: block; }

/* --------------------------------------------------------------------------
   Footer CTA. Light, on-brand, defined (unlike the old .cta-btn ghosts).
   -------------------------------------------------------------------------- */
.fp2-cta {
    background: linear-gradient(180deg, #f8faff 0%, #eef4ff 100%);
    border-top: 1px solid var(--fp2-border);
    padding: var(--fp2-s3) 0;
    text-align: center;
}
.fp2-cta .fp2-h2 { margin-bottom: 10px; }
.fp2-cta .fp2-copy { margin: 0 auto 26px; }

/* --------------------------------------------------------------------------
   Tables and wide content always scroll inside their own box on mobile.
   -------------------------------------------------------------------------- */
.fp2-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* --------------------------------------------------------------------------
   Entrance animation (opt-in via fp2-anim), motion-safe.
   -------------------------------------------------------------------------- */
.fp2-anim {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.fp2-anim.is-in {
    opacity: 1;
    transform: none;
}
@media (prefers-reduced-motion: reduce) {
    .fp2-anim {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .fp2-video__frame img,
    .fp2-btn {
        transition: none;
    }
}

/* --------------------------------------------------------------------------
   Responsive.
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .fp2-section { padding: var(--fp2-s2) 0; }
    .fp2-hero { padding: 64px 0 var(--fp2-s1); }
    .fp2-row {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .fp2-row + .fp2-row { margin-top: var(--fp2-s2); }
    /* Copy first, media second, whatever the desktop order was. */
    .fp2-row--flip .fp2-row-media,
    .fp2-row .fp2-row-media { order: 2; }
    .fp2-row--flip .fp2-row-copy,
    .fp2-row .fp2-row-copy { order: 1; }
}
@media (max-width: 640px) {
    .fp2-video__btn,
    .fp2-video__btn svg { width: 54px; height: 38px; }
    .fp2-video__label { font-size: 0.75rem; }
    .fp2-stat b { font-size: 26px; }
}
