/**
 * Forlossningshaftet — Form styles.
 * Dark theme compatible (chrille.nu child theme).
 */

/* ── Form container ── */
.fh-form {
    --fh-accent: #C2185B;
    --fh-bg: #1A1A1E;
    --fh-surface: #242428;
    --fh-surface-hover: #2A2A2E;
    --fh-text: #F0F0EB;
    --fh-text-subtle: #8A8A80;
    --fh-border: #333;
    --fh-green: #3DAA6D;
    --fh-amber: #F5A623;
    --fh-red: #D0021B;
    --fh-radius: 8px;

    max-width: 720px;
    margin: 0 auto;
    font-family: 'Source Sans 3', 'Inter', sans-serif;
}

/* ── Progress bar ── */
.jet-form-builder-progress-pages {
    background: var(--fh-surface) !important;
    border-radius: var(--fh-radius) !important;
    padding: 12px 16px !important;
    margin-bottom: 24px !important;
}

.jet-form-builder-progress-pages__item {
    color: var(--fh-text-subtle) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}

.jet-form-builder-progress-pages__item--active {
    color: var(--fh-accent) !important;
}

.jet-form-builder-progress-pages__item--passed {
    color: var(--fh-green) !important;
}

/* ── Section headings ── */
.fh-form h2,
.fh-form .fh-section-title {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: var(--fh-text);
    margin: 32px 0 8px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--fh-accent);
}

.fh-form h3,
.fh-form .fh-subsection-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--fh-text);
    margin: 20px 0 8px 0;
}

/* ── Intro text ── */
.fh-intro {
    background: var(--fh-surface);
    border-left: 3px solid var(--fh-accent);
    border-radius: var(--fh-radius);
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 14px;
    font-style: italic;
    color: var(--fh-text-subtle);
    line-height: 1.6;
}

/* ── Fields ── */
.fh-form .jet-form-builder__field-wrap {
    margin-bottom: 16px;
}

.fh-form .jet-form-builder__label {
    color: var(--fh-text) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    margin-bottom: 6px !important;
}

.fh-form .jet-form-builder__field-desc {
    color: var(--fh-text-subtle) !important;
    font-size: 12px !important;
}

.fh-form input[type="text"],
.fh-form input[type="email"],
.fh-form input[type="tel"],
.fh-form input[type="number"],
.fh-form textarea,
.fh-form select {
    background: var(--fh-surface) !important;
    border: 1px solid var(--fh-border) !important;
    border-radius: var(--fh-radius) !important;
    color: var(--fh-text) !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    width: 100% !important;
    transition: border-color 0.2s;
}

.fh-form input:focus,
.fh-form textarea:focus,
.fh-form select:focus {
    border-color: var(--fh-accent) !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(194, 24, 91, 0.2) !important;
}

.fh-form textarea {
    min-height: 80px;
    resize: vertical;
}

/* ── Radio & Checkbox ── */
.fh-form .radio-wrap.checkradio-wrap,
.fh-form .jet-form-builder__field-wrap.radio-wrap {
    background: var(--fh-surface);
    border-radius: var(--fh-radius);
    padding: 8px 14px;
    margin-bottom: 4px;
    transition: background 0.15s;
    cursor: pointer;
}

.fh-form .radio-wrap.checkradio-wrap:hover,
.fh-form .jet-form-builder__field-wrap.radio-wrap:hover {
    background: var(--fh-surface-hover);
}

/* Force radio/checkbox labels and their spans to be light text */
.fh-form .jet-form-builder__field-label.for-radio,
.fh-form .jet-form-builder__field-label.for-radio span,
.fh-form .jet-form-builder__fields-group label,
.fh-form .jet-form-builder__fields-group label span,
.fh-form .radio-wrap label,
.fh-form .radio-wrap label span,
.fh-form .checkradio-wrap label,
.fh-form .checkradio-wrap label span {
    color: var(--fh-text) !important;
    font-size: 13px !important;
    cursor: pointer;
}

/* ── Range/Slider ── */

/* Hide JFB desc text on slider fields (we inject our own endpoints) */
.fh-form .range-wrap .jet-form-builder__field-desc,
.fh-form .fh-slider-enhanced .jet-form-builder__field-desc {
    display: none !important;
}

/* Hide JFB's default range value number (we use our badge) */
.fh-form .range-value,
.fh-form .jet-form-builder__field-value.range-value {
    display: none !important;
}

/* Override JFB's flex layout on range-wrap — force vertical stack */
.fh-form .jet-form-builder__field-wrap.range-wrap,
.fh-form .range-wrap.fh-slider-enhanced {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    margin: 8px 0 24px 0;
    padding: 16px 20px 12px;
    background: var(--fh-surface);
    border-radius: var(--fh-radius);
}

/* Instruction text — own line */
.fh-slider-instruction {
    display: block;
    width: 100%;
    font-size: 12px;
    color: var(--fh-text-subtle);
    font-style: italic;
    margin-bottom: 14px;
    text-align: center;
    line-height: 1.4;
}

/* Endpoint labels — own line, spread apart */
.fh-slider-endpoints {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 10px;
    gap: 20px;
}

.fh-slider-endpoint {
    font-size: 11px;
    color: var(--fh-text-subtle);
    line-height: 1.3;
    flex: 0 1 auto;
    max-width: 42%;
}

.fh-slider-endpoint--min {
    text-align: left;
}

.fh-slider-endpoint--max {
    text-align: right;
}

/* Range input — own line */
.fh-form input[type="range"],
.fh-form .range-field {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100% !important;
    height: 8px !important;
    border-radius: 4px !important;
    background: var(--fh-border) !important;
    border: none !important;
    outline: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
}

.fh-form input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--fh-accent);
    border: 3px solid var(--fh-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    cursor: grab;
    transition: transform 0.15s, background 0.2s;
}

.fh-form input[type="range"]::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.2);
}

.fh-form input[type="range"]::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--fh-accent);
    border: 3px solid var(--fh-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    cursor: grab;
}

/* Dynamic label badge — own line, centered */
.fh-slider-badge {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 12px;
}

.fh-slider-badge-label {
    display: inline-block;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    transition: background-color 0.3s;
    min-width: 130px;
}

/* ── Repeater ── */
.fh-form .jet-form-builder-repeater {
    border: 1px dashed var(--fh-border);
    border-radius: var(--fh-radius);
    padding: 16px;
    margin-bottom: 12px;
}

.fh-form .jet-form-builder-repeater__new {
    background: transparent !important;
    border: 1px solid var(--fh-accent) !important;
    color: var(--fh-accent) !important;
    border-radius: var(--fh-radius) !important;
    padding: 8px 16px !important;
    font-size: 13px !important;
    cursor: pointer;
    transition: background 0.15s;
}

.fh-form .jet-form-builder-repeater__new:hover {
    background: rgba(194, 24, 91, 0.1) !important;
}

/* ── Buttons (next/prev/submit) ── */
.fh-form .jet-form-builder__actions-wrap,
.fh-form .jet-form-builder-row.submit-type-row,
.fh-form .jet-form-builder__action-button-wrapper {
    margin-bottom: 48px !important;
}

.fh-form .jet-form-builder__next-page,
.fh-form .jet-form-builder__submit {
    background: var(--fh-accent) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--fh-radius) !important;
    padding: 12px 32px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.fh-form .jet-form-builder__next-page:hover,
.fh-form .jet-form-builder__submit:hover {
    background: #A01550 !important;
    transform: translateY(-1px);
}

.fh-form .jet-form-builder__prev-page {
    background: transparent !important;
    color: var(--fh-text-subtle) !important;
    border: 1px solid var(--fh-border) !important;
    border-radius: var(--fh-radius) !important;
    padding: 12px 24px !important;
    font-size: 14px !important;
    cursor: pointer;
}

.fh-form .jet-form-builder__prev-page:hover {
    border-color: var(--fh-text-subtle) !important;
    color: var(--fh-text) !important;
}

/* ── GDPR notice ── */
.fh-gdpr-notice {
    background: var(--fh-surface);
    border-radius: var(--fh-radius);
    padding: 14px 18px;
    margin: 24px 0;
    font-size: 12px;
    color: var(--fh-text-subtle);
    line-height: 1.5;
    border-left: 3px solid var(--fh-green);
}

/* ── Mobile responsive ── */
@media (max-width: 768px) {
    .fh-form {
        padding: 0 12px;
    }

    .fh-form h2 {
        font-size: 18px;
    }

    .fh-slider-endpoints {
        flex-direction: column;
        gap: 4px;
    }

    .fh-slider-endpoint {
        max-width: 100%;
        text-align: left;
    }

    .fh-form .jet-form-builder__next-page,
    .fh-form .jet-form-builder__submit {
        width: 100% !important;
    }

    .fh-form .jet-form-builder__prev-page {
        width: 100% !important;
        margin-bottom: 8px;
    }
}
