/**
 * FormsKit — Frontend CSS
 * Clean, modern form styling.
 */

/* ───── Design Tokens ──────────────────────────────────────────────── */
:root {
    --rf-primary: #013088;
    --rf-primary-dark: #011B52;
    --rf-primary-light: #e8eef8;
    --rf-danger: #dc2626;
    --rf-success: #16a34a;
    --rf-gray-100: #f1f5f9;
    --rf-gray-200: #e2e8f0;
    --rf-gray-300: #cbd5e1;
    --rf-gray-500: #64748b;
    --rf-gray-600: #475569;
    --rf-gray-700: #334155;
    --rf-gray-800: #1e293b;
    --rf-gray-900: #0f172a;
    --rf-radius: 8px;
    --rf-radius-sm: 4px;
    --rf-transition: all 0.2s ease;
    --rf-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ───── Form Container ─────────────────────────────────────────────── */
.rf-form-container {
    max-width: 680px;
    margin: 0 auto;
    font-family: var(--rf-font);
    text-align: left;
    background: var(--rf-bg-clr, transparent);
    padding: var(--rf-container-padding, 0);
    border-style: var(--rf-container-border-style, none);
    border-width: var(--rf-container-border-size, 0);
    border-color: var(--rf-container-border-clr, transparent);
    border-radius: var(--rf-container-radius, 0);
    box-shadow: var(--rf-container-shadow, none);
}

/* ───── Field Wrapper ──────────────────────────────────────────────── */
.rf-field {
    margin-bottom: 20px;
    transition: var(--rf-transition);
    text-align: left;
}

/* ───── Labels ─────────────────────────────────────────────────────── */
.rf-field-label {
    display: block;
    font-size: var(--rf-label-size, 14px);
    font-family: var(--rf-label-font-family, inherit);
    font-weight: var(--rf-label-font-weight, 600);
    color: var(--rf-label-clr, var(--rf-gray-800));
    text-transform: var(--rf-label-transform, none);
    letter-spacing: var(--rf-label-spacing, 0px);
    margin-bottom: 6px;
    text-align: left;
}

.rf-required-mark {
    color: var(--rf-danger);
    margin-left: 2px;
}

.rf-sublabel {
    display: block;
    font-size: 11px;
    color: var(--rf-sublabel-clr, var(--rf-gray-500));
    margin-top: 4px;
}

.rf-field-description {
    display: block;
    font-size: 13px;
    color: var(--rf-gray-500);
    margin: 4px 0 0;
    padding: 0;
    line-height: 1.4;
    font-style: italic;
}

/* When description is active: error floats to right end of the field */
.rf-has-description {
    position: relative;
}

.rf-has-description > .rf-field-error {
    position: absolute;
    right: 0;
    bottom: 0;
    text-align: right;
    margin: 0;
}

/* Selection hint & character counter share description styling */
.rf-selection-hint,
.rf-char-limit {
    font-size: 13px;
    color: var(--rf-gray-500);
    margin: 4px 0 0;
    padding: 0;
    line-height: 1.4;
    font-style: italic;
}

/* ───── Rich Text Toolbar ──────────────────────────────────────────── */
.rf-richtext-wrap {
    border: 1px solid var(--rf-gray-300);
    border-radius: var(--rf-radius);
    overflow: hidden;
    transition: var(--rf-transition);
}

.rf-richtext-wrap:focus-within {
    border-color: var(--rf-primary);
    box-shadow: 0 0 0 3px var(--rf-primary-light);
}

.rf-richtext-toolbar {
    display: flex;
    gap: 2px;
    padding: 6px 8px;
    background: var(--rf-gray-100);
    border-bottom: 1px solid var(--rf-gray-200);
    flex-wrap: wrap;
}

.rf-richtext-toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: var(--rf-gray-600);
    transition: all .15s;
}

.rf-richtext-toolbar button:hover {
    background: var(--rf-gray-200);
    color: var(--rf-gray-900);
}

.rf-richtext-toolbar button.rf-rt-active {
    background: var(--rf-primary-light);
    color: var(--rf-primary);
}

.rf-richtext-toolbar .rf-rt-sep {
    width: 1px;
    height: 20px;
    background: var(--rf-gray-300);
    margin: 4px 4px;
}

.rf-richtext-wrap .rf-richtext-editor {
    min-height: 120px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--rf-gray-900);
    outline: none;
    line-height: 1.6;
    font-family: inherit;
}

.rf-richtext-wrap .rf-richtext-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--rf-gray-500);
}

.rf-richtext-toolbar .rf-rt-heading {
    padding: 2px 4px;
    border: 1px solid var(--rf-gray-300);
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
    color: var(--rf-gray-700);
    cursor: pointer;
    height: 28px;
}

.rf-richtext-wrap .rf-richtext-editor blockquote {
    border-left: 3px solid var(--rf-primary, #6C5CE7);
    margin: 8px 0;
    padding: 4px 12px;
    color: var(--rf-gray-600);
    background: var(--rf-gray-100, #f9fafb);
}

.rf-richtext-wrap .rf-richtext-editor hr {
    border: none;
    border-top: 1px solid var(--rf-gray-300);
    margin: 12px 0;
}

/* Font size dropdown */
.rf-richtext-toolbar .rf-rt-fontsize {
    padding: 2px 4px;
    border: 1px solid var(--rf-gray-300);
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
    color: var(--rf-gray-700);
    cursor: pointer;
    height: 28px;
}

/* Color / Highlight picker wrapper */
.rf-rt-color-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.rf-rt-color-wrap input[type="color"] {
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 28px;
    height: 0;
    padding: 0;
    border: none;
    opacity: 0;
    pointer-events: none;
}

.rf-rt-color-btn,
.rf-rt-highlight-btn {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: var(--rf-gray-600);
    transition: all .15s;
}

.rf-rt-color-btn:hover,
.rf-rt-highlight-btn:hover {
    background: var(--rf-gray-200);
}

.rf-rt-color-bar {
    display: block;
    width: 16px;
    height: 3px;
    border-radius: 1px;
    margin-top: 1px;
}

/* Media upload button */
.rf-rt-media-btn {
    font-size: 15px !important;
}

/* Editor table styling */
.rf-richtext-wrap .rf-richtext-editor table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
}

.rf-richtext-wrap .rf-richtext-editor td,
.rf-richtext-wrap .rf-richtext-editor th {
    border: 1px solid var(--rf-gray-300);
    padding: 8px;
    min-width: 40px;
}

/* Editor image styling */
.rf-richtext-wrap .rf-richtext-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 8px 0;
}

/* Subscript / Superscript buttons */
.rf-rt-sub,
.rf-rt-sup {
    font-size: 11px !important;
    line-height: 1;
}


/* ───── Inputs ─────────────────────────────────────────────────────── */
.rf-input {
    width: 100%;
    padding: var(--rf-field-padding, 10px 14px);
    border: var(--rf-field-border-size, 1px) var(--rf-field-border-style, solid) var(--rf-field-border-clr, var(--rf-gray-300));
    border-radius: var(--rf-field-radius, var(--rf-radius));
    font-size: var(--rf-field-font-size, 14px);
    font-family: var(--rf-field-font-family, inherit);
    font-weight: var(--rf-field-font-weight, 400);
    color: var(--rf-field-text-clr, var(--rf-gray-900));
    background: var(--rf-field-bg, #fff);
    box-shadow: var(--rf-field-shadow, none);
    transition: var(--rf-transition);
    box-sizing: border-box;
}

.rf-input:focus {
    border-color: var(--rf-primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--rf-primary-light);
}

.rf-input::placeholder {
    color: var(--rf-gray-500);
}

/* Ensure all input types get consistent border-radius */
input.rf-input,
select.rf-input,
textarea.rf-input {
    border-radius: var(--rf-field-radius, var(--rf-radius));
}

/* Dropdown arrow for select fields */
select.rf-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 36px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    background-size: 12px 7px;
    cursor: pointer;
}

/* ───── Clickable Choice Cards ─────────────────────────────────────── */
.rf-choice-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid var(--rf-gray-200);
    border-radius: var(--rf-radius);
    padding: 12px;
    cursor: pointer;
    transition: var(--rf-transition);
    text-align: center;
    background: #fff;
}

.rf-choice-card:hover {
    border-color: var(--rf-primary-light);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.rf-choice-card:has(input:checked) {
    border-color: var(--rf-primary);
    background: var(--rf-primary-light);
    box-shadow: 0 0 0 2px var(--rf-primary-light);
}

.rf-choice-card input[type="checkbox"],
.rf-choice-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rf-choice-card .rf-choice-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.rf-choice-card .rf-choice-img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
    border-radius: var(--rf-radius-sm);
}

.rf-choice-card .rf-choice-icon {
    font-size: 32px;
    color: var(--rf-gray-600);
}

.rf-choice-card:has(input:checked) .rf-choice-icon {
    color: var(--rf-primary);
}

/* Image choices grid layout */
.rf-choices-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

/* Icon choices grid layout */
.rf-choices-icons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

/* ───── "Other" Option ─────────────────────────────────────────────── */
.rf-other-input {
    max-width: 100%;
    margin-top: 6px;
}

/* Prefix / Suffix addon group */
.rf-addon-wrap {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--rf-gray-300);
    border-radius: var(--rf-radius);
    overflow: hidden;
    transition: var(--rf-transition);
    background: #fff;
}

.rf-addon-wrap:focus-within {
    border-color: var(--rf-primary);
    box-shadow: 0 0 0 3px var(--rf-primary-light);
}

.rf-addon-wrap .rf-input {
    border: none;
    border-radius: 0;
    box-shadow: none;
    flex: 1;
    min-width: 0;
}

.rf-addon-wrap .rf-input:focus {
    box-shadow: none;
}

.rf-addon {
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 14px;
    color: var(--rf-gray-600);
    background: var(--rf-gray-100);
    white-space: nowrap;
    user-select: none;
}

.rf-addon-prefix {
    border-right: 1px solid var(--rf-gray-300);
}

.rf-addon-suffix {
    border-left: 1px solid var(--rf-gray-300);
}

/* Hide spinner arrows on number inputs */
.rf-no-spinner::-webkit-outer-spin-button,
.rf-no-spinner::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.rf-no-spinner {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Field sizes — constrain the entire field wrapper */
.rf-field-size-small {
    max-width: 33%;
}

.rf-field-size-medium {
    max-width: 50%;
}

.rf-field-size-large {
    max-width: 100%;
}

/* Inputs inside sized wrappers fill their container fully */
.rf-field-size-small .rf-input,
.rf-field-size-medium .rf-input {
    max-width: 100%;
    width: 100%;
}

/* ───── Choices (Radio/Checkbox) ───────────────────────────────────── */
.rf-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rf-choices-one_column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rf-choices-two_columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
}

.rf-choices-three_columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px 16px;
}

.rf-choices-single_row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
}

.rf-choices-single_row .rf-choice {
    flex: 1 0 0;
    min-width: 0;
}

.rf-choices-horizontal,
.rf-choices-inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
}

.rf-choice {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--rf-gray-700);
    cursor: pointer;
}

.rf-choice input[type="radio"],
.rf-choice input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--rf-primary);
}

/* ───── Name Sub-fields ────────────────────────────────────────────── */
.rf-name-fields {
    display: flex;
    gap: 10px;
}

.rf-name-first,
.rf-name-middle,
.rf-name-last {
    flex: 1;
    min-width: 0;
}

/* Inputs inside multi-column rows always fill their column */
.rf-name-fields .rf-input,
.rf-address-row .rf-input,
.rf-address-row select {
    max-width: 100% !important;
    width: 100%;
}

/* ───── Address Fields ─────────────────────────────────────────────── */
.rf-address-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rf-address-row {
    display: flex;
    gap: 10px;
}

.rf-address-row>div {
    flex: 1;
    min-width: 0;
}

.rf-address-line1,
.rf-address-line2 {
    width: 100%;
}

/* ───── Slider ─────────────────────────────────────────────────────── */
/* ───── Number Slider ──────────────────────────────────────────────── */
.rf-slider-wrap {
    position: relative;
    padding: 40px 0 10px;
}

/* Thin grey background track */
.rf-slider-track {
    position: absolute;
    top: 47px;
    left: 0; right: 0;
    height: 10px;
    background: #d4dbe3;
    border-radius: 5px;
    z-index: 0;
    pointer-events: none;
}

/* Blue fill between thumbs */
.rf-slider-fill {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--rf-slider-color, #2196F3);
    border-radius: 5px;
}

/* Range input — sits exactly on the track */
.rf-range {
    position: absolute;
    top: 47px;
    left: 0;
    z-index: 2;
    width: 100%;
    height: 10px;
    background: transparent !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    outline: none !important;
    border: 0 !important;
    box-shadow: none !important;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

.rf-range:focus {
    outline: none !important;
    box-shadow: none !important;
}

.rf-range::-webkit-slider-container {
    -webkit-appearance: none;
    background: transparent;
}

.rf-range::-webkit-slider-runnable-track {
    -webkit-appearance: none;
    height: 10px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Solid blue dot thumb — centered on track */
.rf-range::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--rf-slider-color, #2196F3);
    border: none !important;
    box-shadow: none !important;
    cursor: pointer;
    pointer-events: all;
    margin-top: -3px;
    position: relative;
    z-index: 3;
    transition: box-shadow .15s;
}

/* Active/focus halo glow */
.rf-range:active::-webkit-slider-thumb,
.rf-range:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 10px rgba(33, 150, 243, .18) !important;
}

.rf-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--rf-slider-color, #2196F3);
    border: none !important;
    box-shadow: none !important;
    cursor: pointer;
    pointer-events: all;
}

.rf-range:active::-moz-range-thumb,
.rf-range:focus::-moz-range-thumb {
    box-shadow: 0 0 0 10px rgba(33, 150, 243, .18) !important;
}

.rf-range::-moz-range-track {
    height: 10px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Dual handle */
.rf-slider-dual {
    padding-top: 40px;
    padding-bottom: 10px;
}

.rf-slider-dual .rf-range {
    position: absolute;
    top: 47px;
    left: 0;
    width: 100%;
}

.rf-slider-dual .rf-range-max {
    z-index: 3;
}

/* Bounds labels — hidden by default, optional */
.rf-slider-bounds {
    display: none;
}

/* Dark grey tooltip above each thumb */
.rf-slider-tooltip {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    background: #4a4a4a;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
    line-height: 1.4;
}

.rf-slider-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #4a4a4a;
}

/* Tick marks */
.rf-slider-ticks {
    position: absolute;
    top: 54px;
    left: 0; right: 0;
    height: 6px;
    z-index: 1;
    pointer-events: none;
}

.rf-tick {
    position: absolute;
    width: 1px;
    height: 6px;
    background: #ccc;
}

/* ───── International Phone (intl-tel-input overrides) ─────────────── */
.rf-intl-phone.iti {
    width: 100%;
}

.rf-intl-phone .iti__tel-input {
    width: 100%;
    height: auto;
    padding: 10px 14px 10px 52px;
    font-size: 14px;
    border: 1px solid var(--rf-border, #d0d5dd);
    border-radius: var(--rf-radius, 6px);
    transition: border-color .15s;
}

.rf-intl-phone .iti__tel-input:focus {
    border-color: var(--rf-primary-color, #2271b1);
    box-shadow: 0 0 0 2px rgba(34, 113, 177, .15);
    outline: none;
}

.rf-intl-phone .iti__flag-container {
    padding-left: 8px;
}

.rf-intl-phone .iti__selected-dial-code {
    font-size: 14px;
    color: #333;
    padding-left: 4px;
}

.rf-intl-phone .iti__country-list {
    max-height: 220px;
    z-index: 100;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
}

.rf-intl-phone .iti__search-input {
    padding: 8px 10px;
    font-size: 13px;
}

.rf-intl-phone .iti__selected-country-primary:hover,
.rf-intl-phone .iti__selected-country:has(+ .iti__dropdown-content:hover) .iti__selected-country-primary {
    background-color: transparent !important;
}

/* ───── Password ───────────────────────────────────────────────────── */
.rf-password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.rf-password-wrap .rf-input {
    padding-right: 40px;
}

.rf-password-toggle {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
}

.rf-password-strength {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
    position: relative;
}

.rf-password-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: width .3s ease, background-color .3s ease;
}

.rf-password-strength-label {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
    min-height: 16px;
}

/* Requirements checklist */
.rf-password-requirements {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
}

.rf-password-requirements li {
    font-size: 13px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color .2s;
}

.rf-password-requirements li::before {
    content: '✗';
    font-size: 12px;
    font-weight: 700;
    color: #ef4444;
    flex-shrink: 0;
    transition: color .2s;
}

.rf-password-requirements li.rf-req-met {
    color: #22c55e;
}

.rf-password-requirements li.rf-req-met::before {
    content: '✓';
    color: #22c55e;
}
/* ───── File Upload ────────────────────────────────────────────────── */
.rf-file-upload-area {
    border: 2px dashed var(--rf-gray-300);
    border-radius: var(--rf-radius);
    padding: 20px;
    text-align: center;
    transition: var(--rf-transition);
}

.rf-file-upload-area:hover {
    border-color: var(--rf-primary);
    background: var(--rf-primary-light);
}

.rf-file-upload-hint {
    font-size: 12px;
    color: var(--rf-gray-500);
    margin-top: 8px;
}

.rf-file-preview {
    margin-top: 8px;
}

.rf-file-item {
    padding: 6px 10px;
    background: var(--rf-gray-100);
    border-radius: var(--rf-radius-sm);
    font-size: 12px;
    margin-top: 4px;
}

/* ───── Consent ────────────────────────────────────────────────────── */
.rf-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--rf-gray-700);
    cursor: pointer;
    line-height: 1.5;
}

.rf-consent-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: var(--rf-primary);
    flex-shrink: 0;
}

/* ───── Divider ────────────────────────────────────────────────────── */
.rf-divider {
    margin: 24px 0;
}

.rf-divider-title {
    font-size: 18px;
    margin: 0 0 4px;
    color: var(--rf-gray-900);
}

.rf-divider-desc {
    font-size: 13px;
    color: var(--rf-gray-600);
    margin: 0 0 12px;
}

.rf-divider-line {
    border: none;
    border-top: 1px solid var(--rf-gray-200);
}

/* ───── Page Break ─────────────────────────────────────────────────── */
.rf-page-break {
    margin: 16px 0;
}

.rf-page-title {
    text-align: center;
    font-size: 18px;
    color: var(--rf-gray-800);
    margin: 0 0 16px;
}

/* ───── Char Limit ─────────────────────────────────────────────────── */
.rf-char-limit {
    font-size: 11px;
    color: var(--rf-gray-500);
    text-align: right;
    margin-top: 4px;
}

/* ───── Submit Button ──────────────────────────────────────────────── */
.rf-submit-wrap {
    margin-top: 24px;
    text-align: left;
}

.rf-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: var(--rf-btn-padding, 12px 32px);
    background: var(--rf-btn-gradient, var(--rf-btn-bg, var(--rf-primary)));
    color: var(--rf-btn-text-clr, #fff);
    border: var(--rf-btn-border-size, 0) var(--rf-btn-border-style, none) var(--rf-btn-border-clr, transparent);
    border-radius: var(--rf-btn-radius, var(--rf-radius));
    font-size: var(--rf-btn-font-size, 16px);
    font-weight: var(--rf-btn-font-weight, 600);
    box-shadow: var(--rf-btn-shadow, none);
    cursor: pointer;
    transition: var(--rf-transition);
    font-family: inherit;
}

.rf-submit-btn:hover {
    background: var(--rf-btn-hover-bg, var(--rf-primary-dark));
    color: var(--rf-btn-hover-text, var(--rf-btn-text-clr, #fff));
}

.rf-submit-btn:disabled {
    opacity: .7;
    cursor: not-allowed;
}

.rf-submit-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rf-spin .6s linear infinite;
}

@keyframes rf-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ───── Validation Errors ──────────────────────────────────────────── */
.rf-field-error {
    font-size: 12px;
    color: var(--rf-error-clr, var(--rf-danger));
    margin-top: 4px;
    font-weight: 500;
}

.rf-field-has-error .rf-input {
    border-color: var(--rf-danger);
    box-shadow: 0 0 0 3px rgba(239, 71, 111, .1);
}

/* ───── Success / Error Messages ───────────────────────────────────── */
.rf-success {
    padding: 20px;
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: var(--rf-radius);
    color: #2e7d32;
    text-align: center;
    font-size: 16px;
}

.rf-error {
    padding: 12px 16px;
    background: #fce4ec;
    border: 1px solid #f8bbd0;
    border-radius: var(--rf-radius);
    color: var(--rf-danger);
    font-size: 14px;
    margin-bottom: 16px;
}

/* ───── CAPTCHA ────────────────────────────────────────────────────── */
.rf-captcha-widget {
    margin: 16px 0;
}

.rf-hp-field {
    position: absolute !important;
    left: -9999px !important;
}

/* ───── Layout Columns (Frontend) ──────────────────────────────────── */
.rf-layout {
    width: 100%;
}

.rf-layout-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

/* Fields inside layout columns always fill 100% */
.rf-layout-col .rf-field {
    max-width: 100% !important;
}

/* ───── Signature Pad ─────────────────────────────────────────────── */
.rf-signature-wrap {
    width: 100%;
}

.rf-signature-canvas-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
}

.rf-signature-pad {
    display: block;
    width: 100%;
    border: 2px solid #3b82f6;
    border-radius: 6px;
    cursor: crosshair;
    touch-action: none;
}

.rf-signature-clear {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, .35);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s ease;
    padding: 0;
    z-index: 2;
}

.rf-signature-clear:hover {
    background: rgba(0, 0, 0, .6);
}

/* ───── Likert Scale ──────────────────────────────────────────────── */
.rf-likert {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rf-likert-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.rf-likert-table th,
.rf-likert-table td {
    padding: 10px 14px;
    text-align: center;
    vertical-align: middle;
}

.rf-likert-table th:first-child,
.rf-likert-row-label {
    text-align: left;
    font-weight: 500;
}

.rf-likert-table thead th {
    font-weight: 600;
    font-size: 13px;
    color: #374151;
    white-space: nowrap;
}

.rf-likert-cell input[type="radio"],
.rf-likert-cell input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--rf-primary, #6C5CE7);
}

/* ── Classic Style ────────────────────────────────────────── */
.rf-likert-classic .rf-likert-table {
    border: 1px solid #e5e7eb;
}

.rf-likert-classic .rf-likert-table th,
.rf-likert-classic .rf-likert-table td {
    border: 1px solid #e5e7eb;
}

.rf-likert-classic .rf-likert-table thead th {
    background: #f9fafb;
}

/* ── Modern Style ─────────────────────────────────────────── */
.rf-likert-modern .rf-likert-table {
    border: none;
}

.rf-likert-modern .rf-likert-table th,
.rf-likert-modern .rf-likert-table td {
    border: none;
    padding: 14px 14px;
}

.rf-likert-modern .rf-likert-table thead th {
    border-bottom: 2px solid #e5e7eb;
}

.rf-likert-modern .rf-likert-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.rf-likert-modern .rf-likert-table tbody tr:hover {
    background: rgba(108, 92, 231, .05);
}

/* ── Field Sizes ──────────────────────────────────────────── */
.rf-likert-size-small .rf-likert-table { font-size: 12px; }
.rf-likert-size-small .rf-likert-table th,
.rf-likert-size-small .rf-likert-table td { padding: 6px 8px; }
.rf-likert-size-small .rf-likert-cell input[type="radio"],
.rf-likert-size-small .rf-likert-cell input[type="checkbox"] { width: 14px; height: 14px; }

.rf-likert-size-medium .rf-likert-table { font-size: 13px; }
.rf-likert-size-medium .rf-likert-table th,
.rf-likert-size-medium .rf-likert-table td { padding: 8px 10px; }
.rf-likert-size-medium .rf-likert-cell input[type="radio"],
.rf-likert-size-medium .rf-likert-cell input[type="checkbox"] { width: 16px; height: 16px; }

.rf-likert-size-large .rf-likert-table { font-size: 14px; }
.rf-likert-size-large .rf-likert-table th,
.rf-likert-size-large .rf-likert-table td { padding: 10px 14px; }
.rf-likert-size-large .rf-likert-cell input[type="radio"],
.rf-likert-size-large .rf-likert-cell input[type="checkbox"] { width: 18px; height: 18px; }

/* ── Responsive: horizontal scroll on mobile ────────────── */
@media (max-width: 600px) {
    .rf-likert {
        margin: 0 -8px;
        padding: 0 8px;
    }
    .rf-likert-table {
        min-width: 500px;
    }
}
/* ───── Repeater Field ────────────────────────────────────────────── */
.rf-repeater {
    width: 100%;
}

.rf-repeater-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Row (Card) ────────────────────────────────────────── */
.rf-repeater-row {
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e5ea;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    overflow: hidden;
}

/* ── macOS Title Bar ───────────────────────────────────── */
.rf-repeater-titlebar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: linear-gradient(180deg, #f6f6f6 0%, #ececec 100%);
    border-bottom: 1px solid #d5d5d5;
    user-select: none;
}

.rf-repeater-dots {
    display: flex;
    gap: 7px;
    align-items: center;
}

.rf-repeater-row-label {
    font-size: 12px;
    font-weight: 500;
    color: #8c8c8c;
    letter-spacing: 0.02em;
    margin-left: auto;
}

/* ── Traffic Light Dots ────────────────────────────────── */
.rf-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
    border: none;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    position: relative;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.rf-dot:hover,
.rf-dot:focus,
.rf-dot:active,
.rf-dot:focus-visible {
    outline: none;
    box-shadow: 0 0 0 0.5px rgba(0,0,0,0.12) inset;
    transform: none;
    filter: none;
}

.rf-dot span {
    font-size: 9px;
    line-height: 1;
    font-weight: 600;
    color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Red dot — close / remove */
.rf-dot-red,
.rf-dot-red:hover,
.rf-dot-red:focus,
.rf-dot-red:active,
.rf-dot-red:focus-visible {
    background: #ff5f57 !important;
    background-color: #ff5f57 !important;
    box-shadow: 0 0 0 0.5px rgba(0,0,0,0.12) inset;
}

/* Green dot — add */
.rf-dot-green,
.rf-dot-green:hover,
.rf-dot-green:focus,
.rf-dot-green:active,
.rf-dot-green:focus-visible {
    background: #28c840 !important;
    background-color: #28c840 !important;
    box-shadow: 0 0 0 0.5px rgba(0,0,0,0.12) inset;
}

/* ── Row Content Area ──────────────────────────────────── */
.rf-repeater-row-fields {
    padding: 20px;
}

/* Per-column containers */
.rf-repeater-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Fields inside repeater columns always fill 100% */
.rf-repeater-col .rf-field {
    max-width: 100% !important;
}

/* ── Rows Display (Simplified) ─────────────────────────── */
/* Same card structure — rows display just uses 100% width single column */

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 600px) {
    .rf-repeater-row-fields {
        grid-template-columns: 1fr !important;
        padding: 14px;
    }
    .rf-repeater-titlebar {
        padding: 7px 10px;
    }
}

/* ── Row Add/Remove Animations ─────────────────────────── */
@keyframes rf-row-slide-in {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        max-height: 500px;
        padding-top: 12px;
        padding-bottom: 12px;
        transform: translateY(0);
    }
}

@keyframes rf-row-slide-out {
    from {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin-bottom: 0;
        border-width: 0;
        transform: translateY(-8px);
    }
}

.rf-repeater-row-enter {
    animation: rf-row-slide-in 0.3s ease-out;
}

.rf-repeater-row-exit {
    animation: rf-row-slide-out 0.25s ease-in forwards;
    overflow: hidden;
    pointer-events: none;
}

/* ───── Camera Field ──────────────────────────────────────────────── */
.rf-camera-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rf-camera-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid var(--rf-gray-300);
    border-radius: var(--rf-radius);
    background: #fff;
    color: var(--rf-gray-700);
    font-size: 14px;
    cursor: pointer;
    transition: var(--rf-transition);
}

.rf-camera-trigger:hover {
    border-color: var(--rf-primary);
    color: var(--rf-primary);
}

.rf-camera-trigger .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
}

.rf-camera-file-label {
    color: var(--rf-gray-600);
    font-size: 14px;
    cursor: pointer;
    transition: color .15s;
}

.rf-camera-file-label:hover {
    color: var(--rf-primary);
}

.rf-camera-file-input {
    display: none;
}

/* ── Camera Gallery ── */
.rf-camera-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.rf-camera-gallery:empty {
    display: none;
}

.rf-camera-thumb {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--rf-gray-300);
}

.rf-camera-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rf-camera-thumb-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px !important;
    height: 20px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 20px !important;
    max-height: 20px !important;
    padding: 0 !important;
    margin: 0;
    border: none !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.55) !important;
    color: #fff !important;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity .15s, background .15s;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    z-index: 2;
}

.rf-camera-thumb-remove:hover {
    background: rgba(220, 38, 38, 0.85) !important;
}

.rf-camera-thumb:hover .rf-camera-thumb-remove {
    opacity: 1;
}

/* ── Camera Modal ── */
.rf-camera-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rf-camera-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.rf-camera-modal-box {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 560px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    z-index: 1;
}

.rf-camera-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #e5e7eb;
}

.rf-camera-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.rf-camera-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.rf-camera-modal-close:hover {
    color: #111827;
}

.rf-camera-modal-body {
    background: #e5e7eb;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.rf-camera-video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
}

.rf-camera-error {
    color: #dc2626;
    font-size: 14px;
    text-align: center;
    padding: 40px 20px;
}

.rf-camera-modal-footer {
    display: flex;
    justify-content: center;
    padding: 14px;
    background: #fff;
}

.rf-camera-snap {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--rf-primary, #6C5CE7);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

.rf-camera-snap:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(108, 92, 231, 0.4);
}

.rf-camera-snap .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
    line-height: 22px;
}

/* ───── Net Promoter Score ────────────────────────────────────────── */
.rf-nps {
    width: 100%;
    --nps-detractor: #e74c3c;
    --nps-passive: #f39c12;
    --nps-promoter: #27ae60;
}

.rf-nps-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: #6b7280;
}

.rf-nps-scores {
    display: flex;
    width: 100%;
}

/* ── Modern Style (bordered boxes) ───────────────────────── */
.rf-nps-modern .rf-nps-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 36px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    background: #fff;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
    transition: all .15s ease;
    margin-left: -1px;
    padding: 0;
}

.rf-nps-modern .rf-nps-btn:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.rf-nps-modern .rf-nps-btn:last-child { border-radius: 0 6px 6px 0; }

/* Zone hover colors */
.rf-nps-modern .rf-nps-btn.rf-nps-zone-detractor:hover {
    background: color-mix(in srgb, var(--nps-detractor) 10%, #fff);
    border-color: var(--nps-detractor);
    z-index: 1; position: relative;
}
.rf-nps-modern .rf-nps-btn.rf-nps-zone-passive:hover {
    background: color-mix(in srgb, var(--nps-passive) 10%, #fff);
    border-color: var(--nps-passive);
    z-index: 1; position: relative;
}
.rf-nps-modern .rf-nps-btn.rf-nps-zone-promoter:hover {
    background: color-mix(in srgb, var(--nps-promoter) 10%, #fff);
    border-color: var(--nps-promoter);
    z-index: 1; position: relative;
}

/* Zone active colors */
.rf-nps-modern .rf-nps-btn.rf-nps-zone-detractor.rf-nps-active {
    background: var(--nps-detractor); color: #fff;
    border-color: var(--nps-detractor); z-index: 2; position: relative;
}
.rf-nps-modern .rf-nps-btn.rf-nps-zone-passive.rf-nps-active {
    background: var(--nps-passive); color: #fff;
    border-color: var(--nps-passive); z-index: 2; position: relative;
}
.rf-nps-modern .rf-nps-btn.rf-nps-zone-promoter.rf-nps-active {
    background: var(--nps-promoter); color: #fff;
    border-color: var(--nps-promoter); z-index: 2; position: relative;
}

/* ── Classic Style (radio circles + numbers) ─────────────── */
.rf-nps-classic .rf-nps-scores {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
}

.rf-nps-classic .rf-nps-score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    cursor: pointer;
    padding: 8px 12px;
    gap: 4px;
    border-right: 1px solid #e5e7eb;
    background: #fff;
    transition: background .15s ease;
}

.rf-nps-classic .rf-nps-score-item:last-child { border-right: none; }

.rf-nps-classic .rf-nps-radio {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: #fff;
    transition: all .15s ease;
}

.rf-nps-classic .rf-nps-number {
    font-weight: 500;
    font-size: 13px;
    color: #374151;
}

.rf-nps-classic .rf-nps-score-item:hover { background: #f9fafb; }

/* Classic zone active */
.rf-nps-classic .rf-nps-zone-detractor.rf-nps-active .rf-nps-radio {
    border-color: var(--nps-detractor); background: var(--nps-detractor);
    box-shadow: inset 0 0 0 3px #fff;
}
.rf-nps-classic .rf-nps-zone-passive.rf-nps-active .rf-nps-radio {
    border-color: var(--nps-passive); background: var(--nps-passive);
    box-shadow: inset 0 0 0 3px #fff;
}
.rf-nps-classic .rf-nps-zone-promoter.rf-nps-active .rf-nps-radio {
    border-color: var(--nps-promoter); background: var(--nps-promoter);
    box-shadow: inset 0 0 0 3px #fff;
}

.rf-nps-classic .rf-nps-score-item.rf-nps-active { background: #f9fafb; }

/* ── Field Sizes ─────────────────────────────────────────── */
/* Small */
.rf-nps.rf-nps-size-small .rf-nps-btn { height: 28px; font-size: 12px; }
.rf-nps.rf-nps-size-small .rf-nps-labels { font-size: 11px; }
.rf-nps.rf-nps-size-small .rf-nps-score-item { padding: 6px 4px; gap: 2px; }
.rf-nps.rf-nps-size-small .rf-nps-radio { width: 12px; height: 12px; }
.rf-nps.rf-nps-size-small .rf-nps-number { font-size: 11px; }

/* Medium */
.rf-nps.rf-nps-size-medium .rf-nps-btn { height: 36px; font-size: 14px; }
.rf-nps.rf-nps-size-medium .rf-nps-labels { font-size: 13px; }
.rf-nps.rf-nps-size-medium .rf-nps-score-item { padding: 8px 6px; gap: 4px; }
.rf-nps.rf-nps-size-medium .rf-nps-radio { width: 16px; height: 16px; }
.rf-nps.rf-nps-size-medium .rf-nps-number { font-size: 13px; }

/* Large */
.rf-nps.rf-nps-size-large .rf-nps-btn { height: 44px; font-size: 16px; }
.rf-nps.rf-nps-size-large .rf-nps-labels { font-size: 14px; }
.rf-nps.rf-nps-size-large .rf-nps-score-item { padding: 10px 8px; gap: 6px; }
.rf-nps.rf-nps-size-large .rf-nps-radio { width: 20px; height: 20px; }
.rf-nps.rf-nps-size-large .rf-nps-number { font-size: 15px; }

/* ───── Rating Field ──────────────────────────────────────────────── */
.rf-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.rf-rating-icon {
    color: #d1d5db;
    transition: color .15s ease, transform .15s ease;
    user-select: none;
    line-height: 1;
}

.rf-rating-small  .rf-rating-icon { font-size: 20px; }
.rf-rating-medium .rf-rating-icon { font-size: 28px; }
.rf-rating-large  .rf-rating-icon { font-size: 38px; }

.rf-rating-icon.rf-rating-active {
    color: var(--rf-rating-color, #FFB900);
}

.rf-rating-icon.rf-rating-hover {
    color: var(--rf-rating-color, #FFB900);
    transform: scale(1.2);
}

/* Half-precision: left-half icon */
.rf-rating-icon.rf-rating-half {
    clip-path: inset(0 50% 0 0);
    margin-right: -0.5em;
}

/* ───── Multi-Page (Page Break) ───────────────────────────────────── */

/* ── Progress Indicator ────────────────────────────────────────────── */
.rf-progress-indicator {
    margin-bottom: 24px;
}

/* Progress Bar */
.rf-progress-bar-track {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.rf-progress-bar-fill {
    height: 100%;
    background: var(--rf-progress-color, #6C5CE7);
    border-radius: 4px;
    transition: width .4s ease;
}

.rf-progress-bar-text {
    font-size: 13px;
    color: #6b7280;
    margin-top: 6px;
    text-align: center;
}

/* Animated Striped Track */
@keyframes rf-stripes {
    from { background-position: 1rem 0; }
    to { background-position: 0 0; }
}

.rf-progress-indicator.rf-track-animated .rf-progress-bar-fill {
    background-image: linear-gradient(45deg, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
    animation: rf-stripes 1s linear infinite;
}

/* ── Circle Steps — matching reference design ─────────────────────── */
.rf-progress-circles {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    padding: 0;
    margin: 0 0 20px 0; /* Add bottom margin so the title bar clears */
    width: 100%;
}

/* Each step takes equal width — distributes circles evenly along track */
.rf-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
}

/* BASE GREY TRACK: per-segment line from this circle's center to the next */
.rf-step:not(:last-child)::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 6px;
    background: linear-gradient(to bottom, #bfc3c7, #dde0e2 40%, #c8ccce);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.12), 0 1px 0 rgba(255,255,255,.6);
    border-radius: 3px;
    z-index: -2;
    transform: translateY(-50%);
}

/* Flat track variant (no 3D) */
.rf-progress-circles.rf-track-flat .rf-step:not(:last-child)::before {
    height: 4px;
    background: #e0e0e0;
    box-shadow: none;
    border-radius: 2px;
}

/* COLORED FILLED TRACK: overlays the grey track when completed */
.rf-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 0; /* Starts at 0, filled via JS or CSS */
    height: 6px;
    background: var(--rf-progress-color, #6C5CE7);
    box-shadow: inset 0 1px 1px rgba(0,0,0,.08);
    border-radius: 3px;
    z-index: -1;
    transform: translateY(-50%);
    transition: width .4s ease;
}

/* When a step is COMPLETE, its filled segment spans 100% */
.rf-step.rf-step-complete:not(:last-child)::after {
    width: 100%;
}

.rf-progress-indicator.rf-track-animated .rf-step.rf-step-complete:not(:last-child)::after {
    background-image: linear-gradient(45deg, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
    animation: rf-stripes 1s linear infinite;
}

/* Flat filled track variant */
.rf-progress-circles.rf-track-flat .rf-step:not(:last-child)::after {
    height: 4px;
    box-shadow: none;
    border-radius: 2px;
}

/* ── Circle Node — sits ON the track line ───────────────────── */
.rf-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    border: 3px solid #d5d8da;
    background: #fff;
    color: #b0b0b0;
    position: relative;
    z-index: 2;
    transition: all .3s ease;
    flex-shrink: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Active — filled circle with outer glow ring */
.rf-step-active .rf-step-circle {
    width: 44px;
    height: 44px;
    font-size: 17px;
    border-color: var(--rf-progress-color, #6C5CE7);
    background: var(--rf-progress-color, #6C5CE7);
    color: #fff;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--rf-progress-color, #6C5CE7) 18%, transparent);
}

/* Completed — solid filled, no glow */
.rf-step-complete .rf-step-circle {
    border-color: var(--rf-progress-color, #6C5CE7);
    background: var(--rf-progress-color, #6C5CE7);
    color: #fff;
}

/* ── Step Label (subtitle under each circle) ─────────────── */
.rf-step-label {
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .3s ease;
    padding: 0 2px;
}

.rf-step-active .rf-step-label {
    color: var(--rf-progress-color, #6C5CE7);
    font-weight: 600;
}

.rf-step-complete .rf-step-label {
    color: #374151;
    font-weight: 500;
}



/* Connector Steps */
.rf-progress-connector {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.rf-connector-step {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rf-connector-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e5e7eb;
    transition: background .3s ease;
}

.rf-connector-step.rf-step-active .rf-connector-dot {
    background: var(--rf-progress-color, #6C5CE7);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--rf-progress-color, #6C5CE7) 20%, transparent);
}

.rf-connector-step.rf-step-complete .rf-connector-dot {
    background: var(--rf-progress-color, #6C5CE7);
}

.rf-connector-label {
    font-size: 13px;
    color: #9ca3af;
}

.rf-connector-step.rf-step-active .rf-connector-label {
    color: var(--rf-progress-color, #6C5CE7);
    font-weight: 600;
}

.rf-connector-step.rf-step-complete .rf-connector-label {
    color: #374151;
}

/* ── Navigation Buttons ────────────────────────────────────────────── */
.rf-page-nav {
    display: flex;
    gap: 10px;
    padding: 16px 0 4px;
}

.rf-page-nav.rf-nav-center { justify-content: center; }
.rf-page-nav.rf-nav-right  { justify-content: flex-end; }

.rf-page-prev,
.rf-page-next {
    padding: 10px 28px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background .2s, transform .1s;
}

.rf-page-prev {
    background: #e5e7eb;
    color: #374151;
}

.rf-page-prev:hover {
    background: #d1d5db;
}

.rf-page-next {
    background: var(--rf-nav-next-color, var(--rf-progress-color, #6C5CE7));
    color: #fff;
}

.rf-page-next:hover {
    background: color-mix(in srgb, var(--rf-nav-next-color, var(--rf-progress-color, #6C5CE7)) 85%, #000);
    transform: translateY(-1px);
}

/* Fade animation */
@keyframes rfPageFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ───── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 600px) {

    .rf-name-fields,
    .rf-address-row {
        flex-direction: column;
        gap: 8px;
    }

    .rf-choices-horizontal,
    .rf-choices-inline {
        flex-direction: column;
    }

    .rf-layout-stack.rf-layout {
        grid-template-columns: 1fr !important;
    }

    .rf-field-size-small,
    .rf-field-size-medium {
        max-width: 100%;
    }
}

/* ───── Payment Fields ────────────────────────────────────────────── */

/* Total amount display */
.rf-total-wrap {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--rf-primary-light), #f0f4ff);
    border: 1px solid var(--rf-gray-200);
    border-radius: var(--rf-radius);
}

.rf-total-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--rf-primary-dark, var(--rf-primary));
    letter-spacing: -0.5px;
}

/* Order summary table */
.rf-order-summary {
    margin-bottom: 12px;
}

.rf-order-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.rf-order-summary-table th {
    background: var(--rf-gray-100);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--rf-gray-600);
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--rf-gray-200);
}

.rf-order-summary-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--rf-gray-100);
    color: var(--rf-gray-700);
}

.rf-order-summary-table tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.5);
}

.rf-summary-total-row td {
    border-top: 2px solid var(--rf-gray-300);
    font-size: 15px;
    color: var(--rf-gray-900);
}

.rf-summary-discount-row td {
    color: var(--rf-success);
}

.rf-summary-qty,
.rf-summary-amount {
    text-align: right;
}

.rf-order-summary-table td:nth-child(2),
.rf-order-summary-table td:nth-child(3) {
    text-align: right;
}

/* Quantity dropdown */
.rf-quantity-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.rf-quantity-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--rf-gray-600);
}

.rf-quantity-select {
    width: auto;
    min-width: 60px;
    padding: 6px 28px 6px 10px;
    font-size: 13px;
}

/* Item price badge */
.rf-item-price {
    display: inline-block;
    background: var(--rf-primary-light);
    color: var(--rf-primary);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 6px;
}

/* Item total display */
.rf-items-total:empty {
    display: none;
}

.rf-items-total {
    font-size: 14px;
    color: var(--rf-primary);
}

/* Min price notice */
.rf-min-price-notice {
    display: block;
    font-size: 12px;
    color: var(--rf-gray-500);
    margin-top: 4px;
    font-style: italic;
}

/* Coupon field */
.rf-coupon-wrap {
    max-width: 400px;
}

.rf-coupon-input-group {
    display: flex;
    gap: 0;
    border: 1px solid var(--rf-gray-300);
    border-radius: var(--rf-radius);
    overflow: hidden;
    transition: var(--rf-transition);
}

.rf-coupon-input-group:focus-within {
    border-color: var(--rf-primary);
    box-shadow: 0 0 0 3px var(--rf-primary-light);
}

.rf-coupon-input {
    flex: 1;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 10px 14px;
    font-size: 14px;
    min-width: 0;
}

.rf-coupon-input:focus {
    box-shadow: none !important;
    outline: none;
}

.rf-coupon-apply {
    padding: 10px 20px;
    background: var(--rf-primary);
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.rf-coupon-apply:hover {
    background: var(--rf-primary-dark);
}

.rf-coupon-apply:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Coupon messages */
.rf-coupon-message {
    font-size: 13px;
    padding: 6px 10px;
    margin-top: 6px;
    border-radius: var(--rf-radius-sm);
}

.rf-coupon-success {
    background: #f0fdf4;
    color: var(--rf-success);
    border: 1px solid #bbf7d0;
}

.rf-coupon-error {
    background: #fef2f2;
    color: var(--rf-danger);
    border: 1px solid #fecaca;
}

/* Applied coupon badge */
.rf-coupon-discount {
    margin-top: 6px;
}

.rf-coupon-applied {
    display: inline-block;
    background: #f0fdf4;
    color: var(--rf-success);
    font-size: 13px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 16px;
    border: 1px solid #bbf7d0;
}

/* Payment choice items */
.rf-choices-items .rf-choice-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--rf-gray-200);
    border-radius: var(--rf-radius);
    transition: var(--rf-transition);
    cursor: pointer;
}

.rf-choices-items .rf-choice-item:hover {
    border-color: var(--rf-primary-light);
    background: #fafbff;
}

.rf-choices-items .rf-choice-item:has(input:checked) {
    border-color: var(--rf-primary);
    background: var(--rf-primary-light);
    box-shadow: 0 0 0 1px var(--rf-primary);
}

/* Payment field responsive */
@media (max-width: 600px) {
    .rf-total-amount {
        font-size: 22px;
    }

    .rf-coupon-wrap {
        max-width: 100%;
    }

    .rf-quantity-wrap {
        display: flex;
        width: 100%;
    }

    .rf-quantity-select {
        flex: 1;
    }
}

/* ───── Elementor Editor Placeholder ──────────────────────────────── */
.fkit-elementor-placeholder {
    padding: 40px;
    text-align: center;
    background: #f0f0f1;
    border-radius: 8px;
    border: 2px dashed #ccc;
}

.fkit-elementor-placeholder-title {
    font-size: 16px;
    color: #666;
    margin: 0;
}

.fkit-elementor-placeholder-text {
    color: #999;
    margin: 8px 0 0;
}
/* Preview wrapper (admin-only form preview via ?fkit_preview=) */
.fkit-preview-wrap {
    max-width: 740px;
    margin: 40px auto;
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ═══════════════════════════════════════════════════════════════════════
   AccessKit Membership Field — styles for the integrated payment/
   membership UI rendered inside FormsKit forms.
   ═══════════════════════════════════════════════════════════════════════ */

/* Section spacing */
.rf-akit-section {
    margin-top: 16px;
}

/* Notice (AccessKit not installed) */
.rf-akit-notice {
    padding: 16px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
    color: #92400e;
    font-size: 14px;
    text-align: center;
}

/* Plan badge (preselected) */
.rf-akit-plan-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 10px;
    font-weight: 600;
    color: #0369a1;
}

.rf-akit-plan-icon {
    font-size: 24px;
}

.rf-akit-plan-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rf-akit-plan-price {
    font-size: 13px;
    font-weight: 400;
    opacity: 0.8;
}

/* Plan selector label */
.rf-akit-section-label {
    display: block;
    font-size: var(--rf-label-size, 14px);
    font-weight: var(--rf-label-font-weight, 600);
    color: var(--rf-label-clr, #1e293b);
    margin-bottom: 6px;
}

/* Plan select dropdown */
.rf-akit-plan-select {
    width: 100%;
}

/* ── Divider ── */
.rf-akit-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--rf-gray-500, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rf-akit-divider::before,
.rf-akit-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--rf-gray-200, #e2e8f0);
}

/* ── Gateway Cards ── */
.rf-akit-gateway-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.rf-akit-gateway-option {
    flex: 1;
    min-width: 140px;
    cursor: pointer;
}

.rf-akit-gateway-option input[type="radio"] {
    display: none;
}

.rf-akit-gateway-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    border: 2px solid var(--rf-gray-200, #e2e8f0);
    border-radius: 10px;
    background: #fff;
    transition: all 0.2s ease;
    text-align: center;
}

.rf-akit-gateway-card:hover {
    border-color: var(--rf-primary, #013088);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.rf-akit-gateway-option input[type="radio"]:checked + .rf-akit-gateway-card {
    border-color: var(--rf-primary, #013088);
    background: var(--rf-primary-light, #e8eef8);
    box-shadow: 0 0 0 3px rgba(1, 48, 136, 0.1);
}

.rf-akit-gateway-icon {
    font-size: 28px;
}

.rf-akit-gateway-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--rf-gray-800, #1e293b);
}

.rf-akit-gateway-via {
    font-size: 11px;
    color: var(--rf-gray-500, #64748b);
}

.rf-akit-payment-note {
    font-size: 12px;
    color: var(--rf-gray-500, #64748b);
    margin: 10px 0 0;
    text-align: center;
}

/* ── Coupon Section ── */
.rf-akit-coupon-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.rf-akit-coupon-input {
    flex: 1;
}

.rf-akit-coupon-btn {
    padding: 0 20px;
    border: 1px solid var(--rf-primary, #013088);
    background: var(--rf-primary, #013088);
    color: #fff;
    border-radius: var(--rf-field-radius, 8px);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.rf-akit-coupon-btn:hover {
    opacity: 0.9;
}

.rf-akit-coupon-msg {
    margin-top: 8px;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 6px;
}

/* ── Terms & Privacy ── */
.rf-akit-terms-section {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rf-akit-terms-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    color: var(--rf-gray-700, #334155);
    cursor: pointer;
    line-height: 1.5;
}

.rf-akit-terms-label input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: var(--rf-primary, #013088);
    flex-shrink: 0;
}

.rf-akit-terms-label a {
    color: var(--rf-primary, #013088);
    text-decoration: underline;
}

.rf-akit-terms-label a:hover {
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 480px) {
    .rf-akit-gateway-options {
        flex-direction: column;
    }

    .rf-akit-coupon-row {
        flex-direction: column;
    }

    .rf-akit-coupon-btn {
        padding: 10px 20px;
    }
}
