/* ═══════════════════════════════════════════════════════════════════════════
   AI Ops — Unified CTA system
   F-26 (2026-05-21). Styles for:
     • .ai-ops-dualcta             — joined two-segment CTA button
     • .ai-ops-modal               — generic dialog overlay (lead + role)
     • .ai-ops-lead-modal          — lead-form modal specifics
     • .ai-ops-agent-role-modal    — agent role-picker modal specifics
   ═══════════════════════════════════════════════════════════════════════════ */

/* ──────────── DualCTA ──────────── */
.ai-ops-body .ai-ops-dualcta {
    display: inline-flex;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
    max-width: 100%;
}

/* F-24 (2026-05-30): reassurance line under the DualCTA. `flex-basis: 100%`
   makes it drop onto its own line below the buttons in the wrapping
   `.ai-ops-uc-cta-row` (flex-wrap: wrap), regardless of placement. */
.ai-ops-body .ai-ops-dualcta-reassure {
    flex-basis: 100%;
    width: 100%;
    margin: 2px 0 0;
    font-family: var(--ao-font);
    font-size: 13px;
    line-height: 1.4;
    letter-spacing: 0.02em;
    color: var(--ao-text-muted, rgba(255, 255, 255, 0.55));
}
.ai-ops-body .ai-ops-dualcta-segment {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    font-family: var(--ao-font, 'Poppins', sans-serif);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.32px;
    text-decoration: none !important;
    color: #fff;
    background: transparent;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
    white-space: nowrap;
    cursor: pointer;
}
/* Primary (agent) — gradient surface, dark text. Mirrors .ai-ops-btn-primary. */
.ai-ops-body .ai-ops-dualcta-segment--agent {
    background: linear-gradient(245deg, #50d5ff 0%, #acb9ff 100%);
    color: var(--ao-button-dark, #21054F) !important;
}
.ai-ops-body .ai-ops-dualcta-segment--agent:hover {
    color: var(--ao-button-dark, #21054F) !important;
    filter: brightness(1.05);
}
/* Secondary (form) — transparent, white text. Mirrors .ai-ops-btn-secondary. */
.ai-ops-body .ai-ops-dualcta-segment--form {
    color: #fff;
}
.ai-ops-body .ai-ops-dualcta-segment--form:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.ai-ops-body .ai-ops-dualcta-segment:focus-visible {
    outline: 2px solid rgba(151, 199, 255, 0.7);
    outline-offset: -2px;
}
.ai-ops-body .ai-ops-dualcta-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ai-ops-body .ai-ops-dualcta-divider {
    width: 1px;
    align-self: stretch;
    background: rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
}
/* Compact size — for tight chrome (nav, dense rows). */
.ai-ops-body .ai-ops-dualcta--compact .ai-ops-dualcta-segment {
    padding: 10px 16px;
    font-size: 14px;
    letter-spacing: 0.28px;
}
.ai-ops-body .ai-ops-dualcta--compact .ai-ops-dualcta-icon svg {
    width: 16px;
    height: 16px;
}
/* Stack on narrow viewports — the two segments become full-width buttons
   in a vertical column so each is still tappable. */
@media (max-width: 560px) {
    .ai-ops-body .ai-ops-dualcta {
        flex-direction: column;
        border-radius: 16px;
        width: 100%;
    }
    .ai-ops-body .ai-ops-dualcta-segment {
        justify-content: center;
        width: 100%;
        padding: 14px 16px;
    }
    .ai-ops-body .ai-ops-dualcta-divider {
        width: auto;
        height: 1px;
    }
}

/* F-27 (2026-05-30): the ".ai-ops-h-hero-secondary" ("See how it works →")
   rules were removed — the link is gone from all three hero templates
   (home F-09, hub + use-case F-27). No markup references the class anymore. */

/* ──────────── Modal base ──────────── */
.ai-ops-body .ai-ops-modal {
    position: fixed;
    inset: 0;
    z-index: 9500; /* above agent-widget (9000) so clicking the bubble doesn't sit atop the modal */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: var(--ao-font, 'Poppins', sans-serif);
}
.ai-ops-body .ai-ops-modal[hidden] {
    display: none;
}
.ai-ops-body .ai-ops-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 10, 22, 0.78);
    backdrop-filter: blur(4px);
    cursor: pointer;
}
.ai-ops-body .ai-ops-modal-panel {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    background: #0a0a1a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    padding: 32px;
    color: #e8e8f0;
    animation: ai-ops-modal-pop 200ms ease-out;
}
@keyframes ai-ops-modal-pop {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)  scale(1); }
}
.ai-ops-body .ai-ops-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
}
.ai-ops-body .ai-ops-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}
.ai-ops-body .ai-ops-modal-close:focus-visible {
    outline: 2px solid rgba(151, 199, 255, 0.7);
    outline-offset: 2px;
}
.ai-ops-body .ai-ops-modal-head {
    margin-bottom: 24px;
}
.ai-ops-body .ai-ops-modal-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.48px;
    color: #fff;
    margin: 12px 0 8px;
}
.ai-ops-body .ai-ops-modal-sub {
    font-size: 15px;
    line-height: 1.6;
    color: var(--ao-text-body, #D2D2D2);
    margin: 0;
}

/* Body-locks scroll while a modal is open. */
.ai-ops-modal-open,
.ai-ops-modal-open body {
    overflow: hidden;
}

/* ──────────── Lead-form modal specifics ──────────── */
.ai-ops-body .ai-ops-modal-form .ai-ops-uc-form-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ai-ops-body .ai-ops-modal-form .ai-ops-uc-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 480px) {
    .ai-ops-body .ai-ops-modal-form .ai-ops-uc-form-row {
        grid-template-columns: 1fr;
    }
}
.ai-ops-body .ai-ops-modal-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.26px;
    margin-bottom: 6px;
}
.ai-ops-body .ai-ops-modal-form input,
.ai-ops-body .ai-ops-modal-form textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
}
.ai-ops-body .ai-ops-modal-form input:focus,
.ai-ops-body .ai-ops-modal-form textarea:focus {
    outline: 2px solid rgba(151, 199, 255, 0.65);
    outline-offset: 1px;
    border-color: rgba(151, 199, 255, 0.55);
}
.ai-ops-body .ai-ops-modal-form input::placeholder,
.ai-ops-body .ai-ops-modal-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.35);
}
.ai-ops-body .ai-ops-modal-form .ai-ops-uc-form-submit {
    margin-top: 20px;
    width: 100%;
    background: linear-gradient(245deg, #50d5ff 0%, #acb9ff 100%);
    color: var(--ao-button-dark, #21054F);
    border: 0;
    border-radius: 999px;
    padding: 14px 22px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease;
}
.ai-ops-body .ai-ops-modal-form .ai-ops-uc-form-submit:hover {
    filter: brightness(1.05);
}
.ai-ops-body .ai-ops-modal-form .ai-ops-uc-engage-status {
    margin-top: 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    min-height: 1.2em;
}

/* ──────────── Shared "Sending" spinner overlay (2026-05-29) ────────────
   One styled source for every lead form: the DualCTA popup + the home / hub /
   use-case engage sections (all rendered by partials/lead-form.php). The form
   is the positioning context; the overlay sits on top of the fields and fades
   in when ai-ops-cta.js adds `.is-sending` to the form on submit. Lives in
   ai-ops-cta.css because that file loads on every AI Ops template. */
.ai-ops-body .ai-ops-uc-form {
    position: relative;
}
.ai-ops-body .ai-ops-form-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border-radius: inherit;
    background: rgba(10, 10, 26, 0.82);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms ease, visibility 180ms ease;
    z-index: 5;
    pointer-events: none;
}
.ai-ops-body .ai-ops-uc-form.is-sending .ai-ops-form-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* swallow clicks on the fields while sending */
}
.ai-ops-body .ai-ops-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(151, 199, 255, 0.25);
    border-top-color: var(--ao-link, #51a1ff);
    animation: ai-ops-spin 0.7s linear infinite;
}
@keyframes ai-ops-spin {
    to { transform: rotate(360deg); }
}
.ai-ops-body .ai-ops-form-overlay-msg {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.28px;
    color: #fff;
}
/* Accessibility: don't spin under reduced-motion — show a static ring + the
   "Sending…" text instead. */
@media (prefers-reduced-motion: reduce) {
    .ai-ops-body .ai-ops-spinner {
        animation: none;
        border: 3px solid var(--ao-link, #51a1ff);
        opacity: 0.65;
    }
    .ai-ops-body .ai-ops-form-overlay {
        transition: none;
    }
}

/* ──────────── Agent role-picker modal specifics ──────────── */
.ai-ops-body .ai-ops-agent-role-modal .ai-ops-modal-panel {
    max-width: 720px;
}
.ai-ops-body .ai-ops-agent-role-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
@media (max-width: 720px) {
    .ai-ops-body .ai-ops-agent-role-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 480px) {
    .ai-ops-body .ai-ops-agent-role-grid {
        grid-template-columns: 1fr;
    }
}
.ai-ops-body .ai-ops-agent-role-tile {
    display: flex;
    flex-direction: column;
    /* 2026-05-23 (Stas): center avatar + label inside each tile. Was
       flex-start (left-aligned); the modal now reads as a symmetric
       3×2 grid of centered tiles rather than a wall of left-justified
       mini-cards. text-align:center keeps wrapped role names centered
       on the rare case the role label flows to two lines (e.g. on
       mobile when the tile is narrower). */
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    text-decoration: none !important;
    color: inherit;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.ai-ops-body .ai-ops-agent-role-tile:hover {
    background: rgba(81, 161, 255, 0.10);
    border-color: rgba(81, 161, 255, 0.5);
    transform: translateY(-1px);
}
.ai-ops-body .ai-ops-agent-role-tile:focus-visible {
    outline: 2px solid rgba(151, 199, 255, 0.7);
    outline-offset: 2px;
}
.ai-ops-body .ai-ops-agent-role-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.ai-ops-body .ai-ops-agent-role-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.3px;
}
.ai-ops-body .ai-ops-agent-role-tagline {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.26px;
}

/* ─────────────────────────────────────────────────────────────────────
 * Engage section header (Figma 29476:4283) — centered H2 + sub above
 * the Talk + Form cards. Lives on every engage surface (home / 6 hubs /
 * 53 UCs), driven by per-page ACF fields engage_section_h2 / _sub.
 * Width-capped at 900 per Figma; the grid below stays wider.
 * ─────────────────────────────────────────────────────────────────── */
.ai-ops-body .ai-ops-uc-engage-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    max-width: 900px;
    margin: 0 auto 64px;
}
.ai-ops-body .ai-ops-uc-engage-h2 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 40px;
    line-height: 1.2;
    letter-spacing: 0.8px;
    color: #ffffff;
    margin: 0;
}
.ai-ops-body .ai-ops-uc-engage-sub {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    letter-spacing: 0.32px;
    color: #d2d2d2;
    margin: 0;
}
/* Mobile: scale H2 down so it doesn't overflow narrow viewports. */
@media (max-width: 768px) {
    .ai-ops-body .ai-ops-uc-engage-header {
        margin-bottom: 40px;
    }
    .ai-ops-body .ai-ops-uc-engage-h2 {
        font-size: 28px;
        letter-spacing: 0.56px;
    }
}
