/* public/css/oxform-public.css */

/* ── Container ── */
.oxform-container {
    background: var(--oxform-bg, #ffffff);
    color: var(--oxform-text, #333333);
    font-family: var(--oxform-font, inherit);
    font-size: var(--oxform-font-size, 16px);
    padding: var(--oxform-padding, 20px);
    /* Outer container border — defaults to none, fully admin-configurable. */
    border: var(--oxform-container-border-width, 0px) solid var(--oxform-container-border-color, #e5e7eb);
    border-radius: var(--oxform-container-border-radius, 0px);
    box-sizing: border-box;
}

.oxform-container *, .oxform-container *::before, .oxform-container *::after {
    box-sizing: border-box;
}

/* ── Fields ── */
.oxform-field {
    margin-bottom: var(--oxform-spacing, 15px);
}

.oxform-label {
    display: block;
    font-weight: 600;
    margin-bottom: 7px;
    color: var(--oxform-label-color, #374151);
    font-size: var(--oxform-label-font-size, 14px);
    line-height: 1.4;
}

.oxform-required-mark {
    color: #e02424;
    margin-left: 2px;
}

/*
 * Inputs are scoped under .oxform-container so host-theme styles (Divi, Astra,
 * etc.) don't bleed in, and appearance is reset so native chrome is normalised.
 */
.oxform-container .oxform-input,
.oxform-container .oxform-select,
.oxform-container .oxform-textarea {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px 14px;
    min-height: 48px;
    line-height: 1.4;
    border: var(--oxform-border-width, 1.5px) solid var(--oxform-border-color, #d7dbe2);
    border-radius: var(--oxform-border-radius, 10px);
    font-size: var(--oxform-font-size, 16px);
    font-family: var(--oxform-font, inherit);
    color: var(--oxform-text, #1f2937);
    background-color: #fff;
    background-image: none;
    box-shadow: none;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.oxform-container .oxform-input::placeholder,
.oxform-container .oxform-textarea::placeholder {
    color: #9aa1ad;
    opacity: 1;
}

.oxform-container .oxform-input:hover,
.oxform-container .oxform-select:hover,
.oxform-container .oxform-textarea:hover {
    border-color: #b6bcc6;
}

.oxform-container .oxform-input:focus,
.oxform-container .oxform-select:focus,
.oxform-container .oxform-textarea:focus {
    outline: none;
    border-color: var(--oxform-btn-bg, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .16);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--oxform-btn-bg, #2563eb) 22%, transparent);
}

.oxform-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Custom select chevron — replaces the raw native dropdown arrow. */
.oxform-container .oxform-select {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    cursor: pointer;
}

/* Native date/time fields — normalise so they match the other inputs. */
.oxform-container input[type="date"].oxform-input,
.oxform-container input[type="time"].oxform-input,
.oxform-container input[type="datetime-local"].oxform-input {
    cursor: pointer;
}
.oxform-container input[type="date"].oxform-input::-webkit-calendar-picker-indicator,
.oxform-container input[type="time"].oxform-input::-webkit-calendar-picker-indicator,
.oxform-container input[type="datetime-local"].oxform-input::-webkit-calendar-picker-indicator {
    opacity: .55;
    cursor: pointer;
}
.oxform-container input[type="date"].oxform-input::-webkit-calendar-picker-indicator:hover {
    opacity: .9;
}

/* ── Time picker (custom, elegant) ── */
.oxform-timepicker-wrap {
    position: relative;
}
.oxform-timepicker-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    color: #6b7280;
    pointer-events: none;
    z-index: 1;
}
.oxform-container .oxform-timepicker-display {
    padding-left: 42px;
    cursor: pointer;
    background-color: #fff;
}
.oxform-timepicker-panel {
    position: absolute;
    z-index: 50;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--oxform-border-color, #e2e8f0);
    border-radius: var(--oxform-border-radius, 10px);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(15, 23, 42, 0.08);
    scrollbar-width: thin;
}
.oxform-timepicker-opt {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 15px;
    font-family: inherit;
    color: var(--oxform-text, #1f2937);
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.oxform-timepicker-opt:hover,
.oxform-timepicker-opt.is-active {
    background: color-mix(in srgb, var(--oxform-btn-bg, #2563eb) 12%, #fff);
    color: var(--oxform-btn-bg, #2563eb);
}
.oxform-timepicker-opt:active { transform: none; }

/* ── Date picker (flatpickr) theme — matches the time picker / form look.
   The calendar is appended to <body>, so it can't inherit the form's vars;
   we use a clean accent (OxForm blue) consistent with the defaults. */
.flatpickr-calendar {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(15, 23, 42, 0.08);
    font-family: inherit;
}
.flatpickr-calendar.arrowTop::before, .flatpickr-calendar.arrowTop::after,
.flatpickr-calendar.arrowBottom::before, .flatpickr-calendar.arrowBottom::after { display: none; }
.flatpickr-months { padding-top: 4px; }
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year { font-weight: 600; }
.flatpickr-day {
    border-radius: 9px;
    color: #1f2937;
}
.flatpickr-day:hover,
.flatpickr-day:focus {
    background: #eef2ff;
    border-color: #eef2ff;
}
.flatpickr-day.today {
    border-color: #2563eb;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: #2563eb;
    border-color: #2563eb;
    box-shadow: none;
    color: #fff;
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: #cbd5e1;
    text-decoration: line-through;
}
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg { fill: #2563eb; }

/* ── Field-style presets (admin-selectable look) ── */
/* Filled: soft grey fill, borderless until focus. */
.oxform-container.oxform-fstyle-filled .oxform-input,
.oxform-container.oxform-fstyle-filled .oxform-select,
.oxform-container.oxform-fstyle-filled .oxform-textarea {
    background-color: #f3f4f6;
    border-color: transparent;
}
.oxform-container.oxform-fstyle-filled .oxform-input:focus,
.oxform-container.oxform-fstyle-filled .oxform-select:focus,
.oxform-container.oxform-fstyle-filled .oxform-textarea:focus {
    background-color: #fff;
    border-color: var(--oxform-btn-bg, #2563eb);
}
/* Underline: minimal bottom-border only. */
.oxform-container.oxform-fstyle-underline .oxform-input,
.oxform-container.oxform-fstyle-underline .oxform-select,
.oxform-container.oxform-fstyle-underline .oxform-textarea {
    border: none;
    border-bottom: 2px solid var(--oxform-border-color, #d7dbe2);
    border-radius: 0;
    padding-left: 2px;
    padding-right: 2px;
    background-color: transparent;
}
.oxform-container.oxform-fstyle-underline .oxform-select {
    padding-right: 24px;
    background-position: right 2px center;
}
.oxform-container.oxform-fstyle-underline .oxform-input:focus,
.oxform-container.oxform-fstyle-underline .oxform-select:focus,
.oxform-container.oxform-fstyle-underline .oxform-textarea:focus {
    box-shadow: none;
    border-bottom-color: var(--oxform-btn-bg, #2563eb);
}

/* ── Checkbox & Radio ── */
.oxform-checkbox-group,
.oxform-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.oxform-checkbox-label,
.oxform-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
    font-size: var(--oxform-font-size, 16px);
}

.oxform-checkbox-label input,
.oxform-radio-label input {
    width: auto;
    margin: 0;
}

/* ── File Upload ── */
.oxform-file-dropzone {
    border: 2px dashed var(--oxform-border-color, #cccccc);
    border-radius: var(--oxform-border-radius, 4px);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
}

.oxform-file-dropzone:hover,
.oxform-file-dropzone.dragover {
    border-color: var(--oxform-btn-bg, #0073aa);
    background: rgba(0, 115, 170, 0.03);
}

.oxform-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.oxform-file-hint {
    color: #787c82;
    font-size: 13px;
}

.oxform-file-list {
    margin-top: 10px;
    text-align: left;
}

.oxform-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 13px;
}

.oxform-file-item .oxform-file-remove {
    color: #d63638;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 16px;
    padding: 0;
}

/* ── Error ── */
.oxform-error {
    color: #d63638;
    font-size: 13px;
    margin-top: 4px;
    min-height: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.oxform-error:empty {
    display: none;
}

/* Animated error reveal — a small clock-in, reduced-motion safe. */
.oxform-error:not(:empty) {
    animation: oxform-error-in .22s ease both;
}
.oxform-error:not(:empty)::before {
    content: "";
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='7' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12' y2='17'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='7' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12' y2='17'/%3E%3C/svg%3E") center/contain no-repeat;
}
@keyframes oxform-error-in {
    from { opacity: 0; transform: translateY(-3px); }
    to   { opacity: 1; transform: none; }
}

.oxform-container .oxform-field.has-error .oxform-input,
.oxform-container .oxform-field.has-error .oxform-select,
.oxform-container .oxform-field.has-error .oxform-textarea,
.oxform-container .oxform-field.has-error .oxform-timepicker-display {
    border-color: #e02424;
    box-shadow: 0 0 0 3px rgba(224, 36, 36, .12);
}

@media (prefers-reduced-motion: reduce) {
    .oxform-error:not(:empty) { animation: none; }
}

/* ── Submit ── */
.oxform-submit {
    margin-top: var(--oxform-spacing, 15px);
    display: flex;
    align-items: center;
    gap: 10px;
}

.oxform-container .oxform-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    padding: 13px 32px;
    min-height: 48px;
    background: var(--oxform-btn-bg, #2563eb);
    color: var(--oxform-btn-text, #ffffff);
    border: none;
    border-radius: var(--oxform-btn-radius, 10px);
    font-size: var(--oxform-font-size, 16px);
    font-family: var(--oxform-font, inherit);
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease, opacity .15s ease;
}

.oxform-container .oxform-button:hover {
    filter: brightness(1.05);
    box-shadow: 0 6px 16px rgba(16, 24, 40, .16);
    transform: translateY(-1px);
}

.oxform-container .oxform-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .12);
}

.oxform-container .oxform-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .35);
}

.oxform-container .oxform-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    filter: none;
}

/* Submit button icon (inherits the button's text colour via currentColor). */
.oxform-container .oxform-button .oxform-btn-icon {
    width: 1.1em;
    height: 1.1em;
    flex: 0 0 auto;
    display: block;
}

/*
 * Button width + alignment — theme-proof.
 *
 * Selectors are anchored on .oxform-container (which carries the oxform-btnw-* /
 * oxform-btnalign-* classes) and the layout-critical declarations use
 * !important so page builders that style buttons/content via bare-element or
 * module selectors — Divi (incl. Divi 5: .et_pb_*, centered text modules),
 * Astra, Elementor, Kadence — can't override the admin's choice. !important is
 * confined to a handful of structural props (display/justify/width/float/
 * text-align) and scoped to the form, so it never leaks to the host page and
 * never touches colours, spacing, or fonts (which stay theme/admin driven).
 *
 * The submit row is forced to flex so alignment works even when the theme sets
 * text-align:center on the surrounding module (a common Divi cause of "left
 * alignment looks centred"). float:none neutralises themes that float buttons.
 */
.oxform-container .oxform-submit {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    float: none !important;
}
.oxform-container .oxform-submit .oxform-button {
    float: none !important;
    max-width: 100%;
}

/* Auto width (default): button hugs its content so alignment is visible. */
.oxform-container.oxform-btnw-auto .oxform-submit .oxform-button {
    width: auto !important;
    display: inline-flex !important;
}

/* Alignment of the auto-width button within the row. */
.oxform-container.oxform-btnalign-left .oxform-submit { justify-content: flex-start !important; }
.oxform-container.oxform-btnalign-center .oxform-submit { justify-content: center !important; }
.oxform-container.oxform-btnalign-right .oxform-submit { justify-content: flex-end !important; }

/* Full width: button fills the row regardless of the spinner sibling. */
.oxform-container.oxform-btnw-full .oxform-submit .oxform-button {
    width: 100% !important;
    flex: 1 0 100%;
    display: flex !important;
}

.oxform-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #ddd;
    border-top-color: var(--oxform-btn-bg, #0073aa);
    border-radius: 50%;
    animation: oxform-spin 0.6s linear infinite;
}

@keyframes oxform-spin {
    to { transform: rotate(360deg); }
}

/* ── Confirmation ── */
.oxform-confirmation {
    padding: 20px;
    text-align: center;
}

.oxform-confirmation p {
    font-size: 16px;
    color: #00a32a;
}

/* ── Conditional ── */
.oxform-conditional-hidden {
    display: none;
}

/* ── Honeypot ── */
.oxform-hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* ── Popup ── */
/* Standalone popup trigger button (Gutenberg "OxForm Popup Button" block).
   Branding (bg/text/radius) is applied inline from the form's styles. */
.oxform-popup-button-wrap { margin: 0 0 1em; }
.oxform-popup-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    min-height: 48px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.oxform-popup-button:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 24, 40, .16);
}
.oxform-popup-button:active { transform: translateY(0); }
.oxform-popup-button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.oxform-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.oxform-popup-modal {
    background: #fff;
    border-radius: 8px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.oxform-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #787c82;
    z-index: 1;
    line-height: 1;
    padding: 5px;
}

.oxform-popup-close:hover {
    color: #1d2327;
}

/* ── Multi-Step ── */
.oxform-step-hidden {
    display: none !important;
}

.oxform-progress-step.oxform-step-skipped {
    display: none !important;
}

.oxform-step {
    /* no special styling — just a grouping wrapper */
}

.oxform-step.oxform-step-active {
    display: block;
}

/* Smooth step transitions — applied only on navigation (JS adds the class),
   so the server-rendered first step never animates (zero CLS on load). */
@keyframes oxform-step-in {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: none; }
}
@keyframes oxform-step-in-back {
    from { opacity: 0; transform: translateX(-16px); }
    to   { opacity: 1; transform: none; }
}
.oxform-step-entering { animation: oxform-step-in .28s cubic-bezier(.22,.61,.36,1) both; }
.oxform-step-entering--back { animation-name: oxform-step-in-back; }

@media (prefers-reduced-motion: reduce) {
    .oxform-step-entering,
    .oxform-step-entering--back { animation: none; }
}

/* Progress bar */
.oxform-progress {
    display: flex;
    gap: 4px;
    margin-bottom: var(--oxform-spacing, 15px);
}

.oxform-progress-step {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    background: var(--oxform-border-color, #e2e8f0);
    border-radius: var(--oxform-border-radius, 4px);
    font-size: 12px;
    color: var(--oxform-text, #64748b);
    transition: background 0.2s, color 0.2s;
}

.oxform-progress-step.oxform-step-active,
.oxform-progress-step.oxform-step-completed {
    background: var(--oxform-btn-bg, #0073aa);
    color: var(--oxform-btn-text, #fff);
}

.oxform-progress-step.oxform-step-completed {
    opacity: 0.7;
}

.oxform-progress-step.oxform-step-active {
    font-weight: 600;
}

.oxform-progress-label {
    display: block;
    font-size: 13px;
    line-height: 1.3;
}

/* Step navigation */
.oxform-step-nav {
    display: flex;
    gap: 10px;
    margin-top: var(--oxform-spacing, 15px);
    align-items: center;
}

.oxform-btn-prev,
.oxform-btn-next {
    padding: 10px 24px;
    border: 1px solid var(--oxform-border-color, #ccc);
    border-radius: var(--oxform-border-radius, 4px);
    background: var(--oxform-bg, #fff);
    color: var(--oxform-text, #333);
    font-size: var(--oxform-font-size, 16px);
    cursor: pointer;
    font-family: var(--oxform-font, inherit);
    font-weight: 500;
}

.oxform-btn-next {
    margin-left: auto;
    background: var(--oxform-btn-bg, #0073aa);
    color: var(--oxform-btn-text, #fff);
    border-color: var(--oxform-btn-bg, #0073aa);
    font-weight: 600;
}

.oxform-btn-prev:hover,
.oxform-btn-next:hover {
    opacity: 0.9;
}

/* Screen reader text */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    word-wrap: normal;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .oxform-container {
        padding: 15px;
    }
    /*
     * Button width follows the admin's setting at every viewport (the
     * theme-proof rules above apply outside this media query too), so we don't
     * force full-width on mobile — auto stays auto, full stays full.
     */
    .oxform-step-nav {
        flex-wrap: wrap;
    }
    .oxform-btn-prev,
    .oxform-btn-next {
        flex: 1;
        text-align: center;
    }

    /*
     * Responsive header typography. Each element keeps its configured size on
     * desktop (the CSS var) but is capped to a viewport-relative size on small
     * screens via min(), so big headings / custom sizes never overflow. This
     * also scales the default sizes, since the var falls back to them.
     */
    .oxform-container .oxform-header { margin-bottom: 18px; }
    .oxform-container .oxform-header-heading { font-size: min(var(--oxform-h-head-size, 30px), 7.6vw); }
    .oxform-container .oxform-header-subtext { font-size: min(var(--oxform-h-sub-size, 16px), 4.6vw); }
    .oxform-container .oxform-header-badge { font-size: min(var(--oxform-h-badge-size, 13px), 3.7vw); }
    .oxform-container .oxform-countdown { font-size: min(var(--oxform-h-cd-size, 1em), 4.2vw); }
}

/* ── Calculation Field ── */
.oxform-calc-display {
    background: var(--oxform-bg, #f8fafc);
    border: 1px solid var(--oxform-border-color, #e2e8f0);
    border-radius: var(--oxform-border-radius, 4px);
    padding: 12px 16px;
    font-size: var(--oxform-font-size, 16px);
    color: var(--oxform-text, #333);
}

.oxform-calc-value {
    font-weight: 700;
    font-size: 1.1em;
}

.oxform-calc-hidden {
    display: none;
}

/* ── Phase 1 lead-gen fields ── */

/* Consent / GDPR */
.oxform-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
    font-size: var(--oxform-font-size, 16px);
    line-height: 1.4;
}
.oxform-consent-label input[type="checkbox"] {
    margin-top: 3px;
    flex: 0 0 auto;
}
.oxform-consent-text a { text-decoration: underline; }

/* HTML / content block */
.oxform-field-html {
    margin-bottom: var(--oxform-field-gap, 18px);
}

/* Choice groups (qualification / service / urgency / budget-radio) */
.oxform-choice-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.oxform-choice-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
    font-size: var(--oxform-font-size, 16px);
}

/* Image-card choice mode */
.oxform-choice-image {
    flex-direction: row;
    flex-wrap: wrap;
}
.oxform-choice-image .oxform-choice-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid var(--oxform-input-border, #d1d5db);
    border-radius: var(--oxform-radius, 8px);
    padding: 12px;
    min-width: 120px;
    transition: border-color .15s, box-shadow .15s;
}
.oxform-choice-image .oxform-choice-card:hover {
    border-color: var(--oxform-btn-bg, #2563eb);
}
.oxform-choice-image .oxform-choice-img img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

/* Budget slider */
.oxform-budget-slider {
    display: flex;
    align-items: center;
    gap: 12px;
}
.oxform-budget-slider .oxform-input-range {
    flex: 1 1 auto;
}
.oxform-budget-output {
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}

/* Rating — stars & NPS */
.oxform-rating {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.oxform-rating-stars { direction: rtl; justify-content: flex-end; }
.oxform-star-option { cursor: pointer; line-height: 1; }
.oxform-star-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.oxform-star-option .oxform-star {
    font-size: 28px;
    color: #d1d5db;
    transition: color .12s;
}
.oxform-rating-stars .oxform-star-option:hover .oxform-star,
.oxform-rating-stars .oxform-star-option:hover ~ .oxform-star-option .oxform-star,
.oxform-star-option input:checked ~ .oxform-star,
.oxform-rating-stars .oxform-star-option:has(input:checked) .oxform-star,
.oxform-rating-stars .oxform-star-option:has(input:checked) ~ .oxform-star-option .oxform-star {
    color: #f59e0b;
}
.oxform-nps-option {
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--oxform-input-border, #d1d5db);
    border-radius: 6px;
    padding: 6px 10px;
    min-width: 34px;
    text-align: center;
}
.oxform-nps-option:has(input:checked) {
    border-color: var(--oxform-btn-bg, #2563eb);
    background: var(--oxform-btn-bg, #2563eb);
    color: #fff;
}
.oxform-nps-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(1px,1px,1px,1px);
    white-space: nowrap;
}

/* Repeater */
.oxform-repeater-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    padding: 10px;
    border: 1px solid var(--oxform-input-border, #e5e7eb);
    border-radius: var(--oxform-radius, 8px);
    margin-bottom: 8px;
}
.oxform-repeater-field {
    flex: 1 1 160px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.oxform-repeater-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--oxform-label-color, #374151);
}
.oxform-repeater-remove {
    flex: 0 0 auto;
    background: transparent;
    border: 1px solid var(--oxform-input-border, #d1d5db);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #b91c1c;
}
.oxform-repeater-add {
    background: transparent;
    border: 1px dashed var(--oxform-btn-bg, #2563eb);
    color: var(--oxform-btn-bg, #2563eb);
    border-radius: 6px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
}

/* Signature pad */
.oxform-signature-canvas {
    display: block;
    width: 100%;
    border: 1px solid var(--oxform-input-border, #d1d5db);
    border-radius: var(--oxform-radius, 8px);
    background: #fff;
    touch-action: none;
    cursor: crosshair;
}
.oxform-signature-clear {
    margin-top: 6px;
    background: transparent;
    border: 1px solid var(--oxform-input-border, #d1d5db);
    border-radius: 6px;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 13px;
}

/* Save & resume */
.oxform-resume-save-btn {
    margin-left: 10px;
    background: transparent;
    border: 1px solid var(--oxform-input-border, #d1d5db);
    color: var(--oxform-text, #374151);
    border-radius: 6px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
}
.oxform-resume-panel {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid var(--oxform-input-border, #d1d5db);
    border-radius: var(--oxform-radius, 8px);
    background: rgba(37, 99, 235, 0.05);
}
.oxform-resume-panel p { margin: 0 0 8px; font-size: 14px; }
.oxform-resume-link { width: 100%; }

/* Conversational mode */
.oxform-conv-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}
.oxform-conv-progress { font-size: 13px; color: var(--oxform-text-muted, #6b7280); }
.oxform-conv-next, .oxform-conv-back {
    background: var(--oxform-btn-bg, #2563eb);
    color: var(--oxform-btn-text, #fff);
    border: none;
    border-radius: var(--oxform-radius, 8px);
    padding: 10px 20px;
    cursor: pointer;
    font-size: 15px;
}
.oxform-conv-back { background: transparent; color: var(--oxform-text, #374151); border: 1px solid var(--oxform-input-border, #d1d5db); }
.oxform-conversational .oxform-field { font-size: 1.05em; }

/* PPC distraction-free mode */
.oxform-ppc {
    max-width: 560px;
    margin: 0 auto;
}
.oxform-ppc .oxform-field { margin-bottom: 20px; }

/* Sticky CTA (mobile) */
@media (max-width: 600px) {
    .oxform-sticky-cta [type="submit"] {
        position: sticky;
        bottom: 0;
        z-index: 5;
        width: 100%;
    }
}

/* Lead magnet download button (thank-you) */
.oxform-lead-magnet-btn {
    display: inline-block;
    background: var(--oxform-btn-bg, #2563eb);
    color: var(--oxform-btn-text, #fff);
    padding: 10px 20px;
    border-radius: var(--oxform-radius, 8px);
    text-decoration: none;
    font-weight: 600;
}

/* Closed / limit-reached message */
.oxform-closed .oxform-closed-message {
    padding: 18px 20px;
    border: 1px solid var(--oxform-input-border, #d1d5db);
    border-radius: var(--oxform-radius, 8px);
    background: rgba(0, 0, 0, 0.02);
    color: var(--oxform-text, #374151);
    text-align: center;
    font-size: 15px;
}

/* Booking — per-child age inputs */
.oxform-children-ages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}
.oxform-children-ages:empty {
    margin-top: 0;
}
.oxform-child-age-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.oxform-child-age-label {
    flex: 0 0 auto;
    min-width: 90px;
    font-size: 14px;
    color: var(--oxform-text, #374151);
}
.oxform-child-age-row .oxform-child-age {
    flex: 1 1 auto;
    max-width: 140px;
}

/* Booking — pay deposit now / pay on arrival choice */
.oxform-pay-choice {
    border: 1px solid var(--oxform-border, #e5e7eb);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 0 0 16px;
}
.oxform-pay-choice legend {
    padding: 0 6px;
    font-size: 13px;
    font-weight: 600;
}
.oxform-pay-choice-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    font-size: 15px;
    color: var(--oxform-text, #374151);
}
.oxform-pay-choice-option input {
    margin: 0;
}

/* Form intro header — badge pill + heading + subtext (above fields) */
.oxform-header {
    text-align: center;
    margin: 0 0 24px;
}
.oxform-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 999px;
    background: #fdecec;
    background: color-mix(in srgb, var(--oxform-btn-bg, #ef4444) 12%, #fff);
    color: var(--oxform-btn-bg, #ef4444);
    font-size: var(--oxform-h-badge-size, 13px);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
}
.oxform-header-badge-icon {
    font-size: 14px;
    line-height: 1;
}
.oxform-header-heading {
    margin: 16px 0 6px;
    font-size: var(--oxform-h-head-size, 30px);
    font-weight: 800;
    line-height: 1.15;
    color: var(--oxform-text, #111827);
}
.oxform-header-subtext {
    margin: 0;
    font-size: var(--oxform-h-sub-size, 16px);
    line-height: 1.5;
    color: #6b7280;
}

/* Badge countdown — tabular figures keep width stable so ticking never shifts layout */
.oxform-countdown {
    font-size: var(--oxform-h-cd-size, 1em);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    letter-spacing: 0.02em;
}

/* Reassurance note under the submit button */
.oxform-cta-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 12px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: #6b7280;
}
.oxform-cta-note-icon {
    font-size: 13px;
    line-height: 1;
}

/* ── Split image + form layout (OptiMonk-style) ───────────────── */
.oxform-split {
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow: hidden;
    border-radius: var(--oxform-container-border-radius, 0px);
}
.oxform-split-media {
    flex: 1 1 0;
    min-height: 220px;          /* reserve space → no CLS */
    overflow: hidden;
}
.oxform-split-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.oxform-split-body {
    flex: 1 1 0;
    min-width: 0;               /* let the form panel shrink */
}
.oxform-split-body .oxform-container { height: 100%; }
.oxform-split--right { flex-direction: row-reverse; }
.oxform-split--left  { flex-direction: row; }
.oxform-split--top   { flex-direction: column; }
.oxform-split--top .oxform-split-media { min-height: 180px; max-height: 280px; }

@media (max-width: 600px) {
    .oxform-split,
    .oxform-split--left,
    .oxform-split--right { flex-direction: column; }
    .oxform-split-media { min-height: 160px; max-height: 240px; }
}

/* ── Slide-in / corner popup (Pro) ────────────────────────────── */
.oxform-popup-overlay.oxform-popup--slide {
    background: transparent;        /* non-blocking */
    pointer-events: none;
    align-items: stretch;
    justify-content: stretch;
}
.oxform-popup--slide .oxform-popup-modal {
    pointer-events: auto;
    position: fixed;
    max-width: 420px;
    margin: 0;
    box-shadow: 0 16px 48px rgba(15, 23, 42, .28);
    animation: oxform-slide-in .3s cubic-bezier(.22,.61,.36,1) both;
}
.oxform-popup--bottom-right .oxform-popup-modal { right: 20px; bottom: 20px; }
.oxform-popup--bottom-left  .oxform-popup-modal { left: 20px;  bottom: 20px; }
.oxform-popup--top-right    .oxform-popup-modal { right: 20px; top: 20px; }
.oxform-popup--top-left     .oxform-popup-modal { left: 20px;  top: 20px; }
@keyframes oxform-slide-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .oxform-popup--slide .oxform-popup-modal { animation: none; } }
@media (max-width: 600px) {
    .oxform-popup--slide .oxform-popup-modal { left: 12px; right: 12px; bottom: 12px; top: auto; max-width: none; }
}
