/* ================================================================
   FF Forms — Frontend Styles
   Designed to closely match the lead-gen form style in the mockup.
   ================================================================ */

/* ----------------------------------------------------------------
   Form wrapper
   ---------------------------------------------------------------- */
.ff-form-wrap {
    width: 100%;
    max-width: 720px; /* overridden by inline style when Form Width is set in Form Settings */
    margin: 0 auto;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.ff-form {
    background: #fff;
    border: 1px solid #dde1e7;
    border-radius: 8px;
    padding: 28px 24px;
    box-sizing: border-box;
}

/* ----------------------------------------------------------------
   Rows & Columns
   ---------------------------------------------------------------- */
.ff-row {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
}

.ff-cols-1 { grid-template-columns: 1fr; }
.ff-cols-2 { grid-template-columns: 1fr 1fr; }
.ff-cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.ff-col-empty { min-height: 1px; /* placeholder slot */ }

/* Responsive: stack on small screens */
@media (max-width: 560px) {
    .ff-cols-2,
    .ff-cols-3 {
        grid-template-columns: 1fr;
    }
}

/* ----------------------------------------------------------------
   Honeypot — invisible to humans, visible to bots
   Do NOT use display:none; smart bots skip those intentionally.
   ---------------------------------------------------------------- */
.ff-hp {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

/* ----------------------------------------------------------------
   Field wrap
   ---------------------------------------------------------------- */
.ff-field-wrap {
    width: 100%;
}

.ff-field-wrap .ff-field-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

/* Yes/No field wraps get no extra padding — layout is handled inside */
.ff-field-wrap.ff-type-yes_no {
    padding: 0;
}

.ff-field-hidden {
    display: none;
}

/* ----------------------------------------------------------------
   Inputs
   High-specificity rules + !important on key props so Kadence theme
   cannot override border, color, background, or font styles.
   ---------------------------------------------------------------- */
.ff-form-wrap .ff-form .ff-input,
.ff-form-wrap .ff-form .ff-textarea,
.ff-form-wrap .ff-form .ff-select {
    width: 100% !important;
    padding: 10px 12px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #1d2327 !important;
    background: #fff !important;
    border: 2px solid #7a8390 !important;
    border-radius: 4px !important;
    box-sizing: border-box !important;
    transition: border-color .15s, box-shadow .15s;
    appearance: none !important;
    -webkit-appearance: none !important;
    outline: none !important;
    box-shadow: none !important;
    line-height: 1.4 !important;
    margin: 0 !important;
}

.ff-form-wrap .ff-form .ff-input::placeholder,
.ff-form-wrap .ff-form .ff-textarea::placeholder {
    color: #4a5568 !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    font-size: 12px !important;
    letter-spacing: .6px;
    opacity: 1 !important; /* Firefox resets opacity on placeholders */
}

/* Firefox-specific placeholder */
.ff-form-wrap .ff-form .ff-input::-moz-placeholder,
.ff-form-wrap .ff-form .ff-textarea::-moz-placeholder {
    color: #4a5568 !important;
    font-weight: 600 !important;
    opacity: 1 !important;
}

.ff-form-wrap .ff-form .ff-input:focus,
.ff-form-wrap .ff-form .ff-textarea:focus,
.ff-form-wrap .ff-form .ff-select:focus {
    border-color: #1a73e8 !important;
    box-shadow: 0 0 0 2px rgba(26,115,232,.18) !important;
    outline: none !important;
}

/* Select arrow */
.ff-form-wrap .ff-form .ff-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234a5568' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    padding-right: 32px !important;
    cursor: pointer !important;
    text-transform: uppercase;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: .5px;
    color: #4a5568 !important;
}

.ff-form-wrap .ff-form .ff-select option {
    text-transform: none;
    font-size: 14px;
    font-weight: 400;
    color: #1d2327;
}

/* ----------------------------------------------------------------
   Radio & Checkbox groups
   ---------------------------------------------------------------- */
.ff-radio-group,
.ff-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ff-radio-label,
.ff-checkbox-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 4px;
}

.ff-radio-item,
.ff-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.ff-radio-item input,
.ff-checkbox-item input {
    cursor: pointer;
}

/* ----------------------------------------------------------------
   Yes / No block
   Question always left, buttons always right — even on mobile.
   ---------------------------------------------------------------- */
.ff-yes-no-block {
    padding: 12px 0;
    border-bottom: 1px solid #e8eaed;
}

.ff-yes-no-block:last-of-type {
    border-bottom: none;
}

/* Main row: question + buttons side-by-side, never wraps */
.ff-yn-main-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    flex-wrap: nowrap !important;
}

.ff-yn-question {
    flex: 1 1 auto;
    font-size: 14px;
    font-weight: 500;
    color: #1d2327;
    line-height: 1.5;
    margin: 0;
    /* Prevent question from ever squishing the buttons off screen */
    min-width: 0;
}

/* Buttons cluster — always on the right, never wraps or shrinks */
.ff-yn-buttons {
    flex: 0 0 auto !important;
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}

.ff-form-wrap .ff-form .ff-yn-btn {
    flex: 0 0 auto !important;
    width: 64px !important;
    padding: 8px 0 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    border: 2px solid #c5c9d0 !important;
    border-radius: 5px !important;
    background: #fff !important;
    cursor: pointer !important;
    transition: background .12s, border-color .12s, color .12s;
    color: #374151 !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
    letter-spacing: 0 !important;
    text-align: center !important;
    box-shadow: none !important;
}

.ff-form-wrap .ff-form .ff-yn-btn:hover {
    border-color: #7a8390 !important;
    color: #1d2327 !important;
    background: #f4f5f7 !important;
}

.ff-form-wrap .ff-form .ff-yn-btn.active.ff-yn-yes {
    background: #137333 !important;
    border-color: #137333 !important;
    color: #fff !important;
}

.ff-form-wrap .ff-form .ff-yn-btn.active.ff-yn-no {
    background: #c5221f !important;
    border-color: #c5221f !important;
    color: #fff !important;
}

/* Offer / disclaimer content — shown below the row, smaller text */
.ff-yn-offer-content {
    margin-top: 10px;
    padding: 10px 12px;
    background: #f0f4f8;
    border-left: 3px solid #7a8390;
    border-radius: 0 4px 4px 0;
    font-size: 12px !important;
    line-height: 1.55;
    color: #374151;
}

.ff-yn-offer-content p         { margin: 0 0 6px; font-size: 12px; }
.ff-yn-offer-content p:last-child { margin-bottom: 0; }
.ff-yn-offer-content strong    { font-weight: 700; }
.ff-yn-offer-content small,
.ff-yn-offer-content sup       { font-size: 10px; color: #6b7280; }

/* ----------------------------------------------------------------
   Cloudflare Turnstile widget
   ---------------------------------------------------------------- */
.ff-turnstile-wrap {
    margin: 4px 0 8px;
}

/* Flexible fills width naturally; normal/compact auto-center */
.ff-turnstile-wrap .cf-turnstile:not([data-size="flexible"]) {
    margin: 0 auto;
    display: table;
}

.ff-turnstile-notice {
    color: #b91c1c;
    font-size: 13px;
    margin: 0;
    padding: 8px 0;
}

/* ----------------------------------------------------------------
   Section divider
   ---------------------------------------------------------------- */
.ff-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0;
}

.ff-divider::before,
.ff-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ff-div-line, #e2e8f0);
}

.ff-divider span {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--ff-div-text, #6b7280);
    text-transform: uppercase;
    white-space: nowrap;
}

/* ----------------------------------------------------------------
   Content block
   ---------------------------------------------------------------- */
.ff-content-block {
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    padding: 8px 0;
}

/* ----------------------------------------------------------------
   Consent / TCPA checkbox
   ---------------------------------------------------------------- */
.ff-consent-wrap {
    padding: 14px 0 6px;
}

/* Flex row: [checkbox] [text] — text is NOT inside the label */
.ff-consent-row {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
}

/* Label wraps only the checkbox + visual box */
.ff-consent-label {
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: flex-start !important;
    cursor: pointer;
    margin-top: 1px;
    line-height: 1;
}

/* Hide the native checkbox */
.ff-consent-checkbox {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

/* Custom checkbox box */
.ff-consent-box {
    width: 20px !important;
    height: 20px !important;
    border: 2px solid #7a8390 !important;
    border-radius: 3px !important;
    background: #fff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background .12s, border-color .12s;
    cursor: pointer;
    flex-shrink: 0 !important;
}

/* Checked state */
.ff-consent-checkbox:checked + .ff-consent-box {
    background: #1a73e8 !important;
    border-color: #1a73e8 !important;
}

/* Checkmark via pseudo-element */
.ff-consent-checkbox:checked + .ff-consent-box::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

/* Focus ring for keyboard accessibility */
.ff-consent-checkbox:focus + .ff-consent-box {
    outline: 2px solid #1a73e8 !important;
    outline-offset: 2px !important;
}

/* Consent text — sibling div, NOT inside label */
.ff-consent-text {
    flex: 1;
    font-size: 12px !important;
    line-height: 1.55 !important;
    color: #4a5568 !important;
    font-weight: 400 !important;
    cursor: default; /* makes it clear text is not clickable for the checkbox */
}

/* Links inside consent text work normally */
.ff-consent-text a {
    color: #1a73e8 !important;
    text-decoration: underline !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

.ff-consent-text a:hover {
    color: #1557b0 !important;
}

.ff-consent-text strong,
.ff-consent-text b {
    font-weight: 600;
    color: #1d2327;
}

/* Error state */
.ff-field-error .ff-consent-box {
    border-color: #c5221f !important;
    box-shadow: 0 0 0 2px rgba(197,34,31,.15) !important;
}

/* ----------------------------------------------------------------
   Submit button row
   ---------------------------------------------------------------- */
.ff-submit-row {
    margin-top: 16px;
}

.ff-form-wrap .ff-form .ff-submit-btn {
    width: 100% !important;
    padding: 13px 24px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #fff;
    background: #064E67;
    border: none !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    letter-spacing: .4px !important;
    text-decoration: none !important;
    text-transform: none !important;
    line-height: 1.4 !important;
    transition: background .15s, transform .1s;
    display: block !important;
    box-shadow: none !important;
}

.ff-form-wrap .ff-form .ff-submit-btn:hover:not(:disabled) {
    background: #053d52;
    color: #fff;
}

.ff-form-wrap .ff-form .ff-submit-btn:active:not(:disabled) {
    transform: scale(.99);
}

.ff-form-wrap .ff-form .ff-submit-btn:disabled,
.ff-form-wrap .ff-form .ff-submit-btn.ff-loading {
    opacity: .7 !important;
    cursor: not-allowed !important;
}

/* ----------------------------------------------------------------
   Validation errors
   ---------------------------------------------------------------- */
.ff-field-error .ff-input,
.ff-field-error .ff-textarea,
.ff-field-error .ff-select {
    border-color: #c5221f;
    box-shadow: 0 0 0 2px rgba(197,34,31,.15);
}

.ff-error-msg {
    display: block;
    color: #c5221f;
    font-size: 12px;
    margin-top: 4px;
}

/* ----------------------------------------------------------------
   Messages
   ---------------------------------------------------------------- */
.ff-form-messages {
    margin-top: 12px;
}

.ff-message {
    padding: 12px 16px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
}

.ff-message-error {
    background: #fce8e6;
    color: #c5221f;
    border: 1px solid #f5c6c5;
}

.ff-message-success {
    background: #e6f4ea;
    color: #137333;
    border: 1px solid #b7dfbf;
}

/* ----------------------------------------------------------------
   Multi-step: progress bar
   ---------------------------------------------------------------- */
.ff-progress-wrap {
    margin-bottom: 24px;
}

.ff-progress-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 14px;
}

.ff-progress-fill {
    height: 100%;
    background: #0ea5e9;
    border-radius: 99px;
    transition: width 0.35s ease;
}

.ff-step-indicators {
    display: flex;
    gap: 0;
    justify-content: space-between;
    position: relative;
}

.ff-step-indicators::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    height: 2px;
    background: #e5e7eb;
    z-index: 0;
}

.ff-step-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    position: relative;
    z-index: 1;
}

.ff-step-dot-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s, color 0.25s;
}

.ff-step-dot.active .ff-step-dot-num {
    background: #0ea5e9;
    color: #fff;
}

.ff-step-dot.completed .ff-step-dot-num {
    background: #22c55e;
    color: #fff;
}

.ff-step-dot-label {
    font-size: 11px;
    color: #6b7280;
    text-align: center;
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.ff-step-dot.active .ff-step-dot-label {
    color: #0ea5e9;
    font-weight: 600;
}

/* ----------------------------------------------------------------
   Multi-step: step containers
   ---------------------------------------------------------------- */
.ff-step-inactive {
    display: none !important;
}

.ff-step-active {
    display: block;
}

/* ----------------------------------------------------------------
   Multi-step: Next / Back buttons
   ---------------------------------------------------------------- */
.ff-step-nav-row {
    margin-top: 8px;
}

.ff-step-nav-row .ff-col {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
}

/* When only Next (no Back on first step), push it to the right */
.ff-step-nav-row .ff-col > .ff-next-btn:only-child {
    margin-left: auto;
}

.ff-next-btn,
.ff-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s, opacity 0.2s;
    line-height: 1;
}

.ff-next-btn {
    background: #0ea5e9;
    color: #fff;
}

.ff-next-btn:hover {
    background: #0284c7;
}

.ff-back-btn {
    background: #f1f5f9;
    color: #374151;
    border: 1px solid #e2e8f0;
}

.ff-back-btn:hover {
    background: #e2e8f0;
}

/* ----------------------------------------------------------------
   Success state
   ---------------------------------------------------------------- */
.ff-success-message {
    padding: 28px 24px;
    background: #e6f4ea;
    border: 1px solid #b7dfbf;
    border-radius: 8px;
    color: #137333;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    line-height: 1.55;
}

/* ----------------------------------------------------------------
   Mobile — multi-step adjustments
   ---------------------------------------------------------------- */
@media (max-width: 560px) {

    /* Let the wrapper fill the available width instead of centering with gaps */
    .ff-form-wrap {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Tighter form padding on small screens */
    .ff-form {
        padding: 20px 16px;
        border-radius: 6px;
    }

    /* Shrink progress bar margin */
    .ff-progress-wrap {
        margin-bottom: 16px;
    }

    /* Smaller step dots so they fit on narrow screens with many steps */
    .ff-step-dot-num {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    /* Hide step labels on mobile — only show them for the active step to avoid crowding */
    .ff-step-dot-label {
        display: none;
    }
    .ff-step-dot.active .ff-step-dot-label {
        display: block;
        font-size: 11px;
        white-space: normal;
        max-width: 70px;
    }

    /* Adjust the connector line height to match smaller dots */
    .ff-step-indicators::before {
        top: 12px;
    }

    /* Make Back/Next buttons fill their half of the row evenly */
    .ff-next-btn,
    .ff-back-btn {
        flex: 1 1 0;
        padding: 12px 10px;
        font-size: 14px;
    }

    /* Keep spacing between the two buttons */
    .ff-step-nav-row .ff-col {
        gap: 10px;
    }

    /* Single button (Next only on step 1) should still be full-width */
    .ff-step-nav-row .ff-col > .ff-next-btn:only-child {
        flex: 1 1 0;
        margin-left: 0;
    }
}
