/* BlitzFunnel — public helpers
 * Visual form/landing styles live inside each template's style.css
 * and are inlined into the published page. This file only carries
 * cross-template helpers (accessibility, FTC disclosure bar).
 */

.bf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Field grid layout lives in each template's form-layout.css (inlined on publish).
   bf-public.css only styles popups and cross-template helpers below. */

.bf-disclosure {
    background: #f6f7fb; color: #4f5566;
    padding: 8px 16px; font-size: 11px;
    text-align: center; border-bottom: 1px solid #e3e5ec;
}

/* Popup opt-in mode */
body.bf-popup-open { overflow: hidden; }
.bf-tpl-quiz .gate-form .bf-popup-trigger-wrap { display: none !important; }
.bf-popup-trigger-wrap { text-align: center; margin: 12px 0; }
.bf-popup-trigger {
    display: inline-block;
    width: 100%;
    max-width: 420px;
    padding: 14px 22px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: none;
    border-radius: 10px;
    background: var(--bf-accent, #4f46e5);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
    transition: background .15s, transform .1s, box-shadow .15s;
}
.bf-popup-trigger:hover {
    background: var(--bf-accent-dark, var(--bf-accent, #4338ca));
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
}

/* Skip opt-in — direct CTA to affiliate link */
.bf-paused-notice {
    margin: 16px auto;
    max-width: 420px;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, .08);
    background: rgba(255, 255, 255, .92);
    text-align: center;
}
.bf-paused-notice p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: #4d5266;
}
.bf-admin-preview-banner {
    position: sticky;
    top: 0;
    z-index: 10000;
    margin: 0;
    padding: 10px 16px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(37, 99, 235, .3);
    background: rgba(37, 99, 235, .1);
    text-align: center;
    backdrop-filter: blur(6px);
}
.bf-admin-preview-banner p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: #1e3a8a;
    font-weight: 600;
}
.bf-skip-optin-wrap { text-align: center; margin: 12px 0; }
a.bf-skip-optin-link,
a.bf-submit.bf-skip-optin-link {
    display: block;
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    cursor: pointer;
}
.bf-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(8, 11, 20, .64);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}
.bf-popup-backdrop[aria-hidden="false"] { display: flex; }
.bf-popup-dialog {
    position: relative;
    width: min(440px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
    padding: 32px 28px 28px;
    text-align: center;
}
.bf-popup-heading {
    margin: 0 0 8px;
    font-size: clamp(1.125rem, 3.5vw, 1.375rem);
    font-weight: 800;
    line-height: 1.3;
    color: #0f172a;
    padding-right: 28px;
}
.bf-popup-sub {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.55;
    color: #64748b;
}
.bf-popup-dialog .bf-form {
    margin-top: 0;
    text-align: left;
}
.bf-popup-dialog .bf-fields-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
.bf-popup-dialog .bf-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    font-size: 16px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
}
.bf-popup-dialog .bf-field input:focus {
    outline: none;
    border-color: var(--bf-accent, #4f46e5);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--bf-accent, #4f46e5) 18%, transparent);
}
.bf-popup-dialog .bf-submit {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    background: var(--bf-accent, #4f46e5);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
.bf-popup-dialog .bf-form-status {
    margin-top: 12px;
    text-align: center;
}
.bf-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.bf-popup-close:hover { color: #0f172a; background: #e2e8f0; }

@media (max-width: 640px) {
    .bf-popup-backdrop { padding: 10px; align-items: flex-end; }
    .bf-popup-dialog {
        width: 100%;
        max-height: min(88vh, 640px);
        border-radius: 12px 12px 0 0;
        padding: 20px 14px 12px;
    }
}

/* Form validation & feedback (loaded on all funnel pages) */
.bf-form-status {
    margin: 12px 0 0;
    padding: 0;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    min-height: 1.4em;
}
.bf-form-status.is-error,
.bf-form-status[data-state="error"] {
    color: #dc2626;
    font-weight: 600;
}
.bf-form-status.is-success,
.bf-form-status[data-state="success"] {
    color: #16a34a;
    font-weight: 600;
}
.bf-field.is-invalid input,
.bf-field.is-invalid textarea,
.bf-field.is-invalid select {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
}

.bf-consent {
    margin-top: 14px;
    text-align: left;
}

.bf-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.45;
    color: var(--bf-consent-color, var(--bf-form-area-muted, var(--bf-muted, #64748b)));
}

.bf-consent-input {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--bf-accent, var(--bf-submit-bg, #2563eb));
}

.bf-consent-text a {
    color: var(--bf-consent-link-color, var(--bf-accent, #2563eb));
    text-decoration: underline;
    text-underline-offset: 2px;
}

.bf-consent.is-invalid .bf-consent-label {
    color: #dc2626;
}

.bf-consent.is-invalid .bf-consent-input {
    outline: 2px solid rgba(220, 38, 38, 0.35);
    outline-offset: 1px;
}

/* Cross-template media + countdown helpers */
.bf-video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}
.bf-video-embed iframe,
.bf-video-embed video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.bf-countdown {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.bf-countdown__unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 64px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
}
.bf-countdown__num {
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.bf-countdown__label {
    margin-top: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.85;
}
.bf-countdown__expired {
    font-weight: 700;
    font-size: 14px;
}

.bf-hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    clip: rect(0, 0, 0, 0) !important;
}
