/* ResultsAiX Forms - front-end styles. Scoped under .rxf-form-wrap and themed
   by one variable (--rxf-accent) so nothing leaks in or out of the host theme. */

.rxf-form-wrap {
    --rxf-accent: #2271b1;
    --rxf-fw-bg: #ffffff;
    --rxf-fw-text: #1f2937;
    --rxf-fw-muted: #6b7280;
    --rxf-fw-border: #d1d5db;
    --rxf-fw-input-bg: #ffffff;
    box-sizing: border-box;
    max-width: 720px;
    margin: 0 auto;
    padding: 26px 28px;
    border: 1px solid var(--rxf-fw-border);
    border-radius: 16px;
    background: var(--rxf-fw-bg);
    color: var(--rxf-fw-text);
    font-family: inherit;
    box-shadow: 0 8px 30px -18px rgba(15, 23, 42, .25);
}
.rxf-form-wrap *, .rxf-form-wrap *::before, .rxf-form-wrap *::after { box-sizing: border-box; }
.rxf-form-wrap[hidden], .rxf-form-wrap [hidden] { display: none !important; }

.rxf-theme-dark {
    --rxf-fw-bg: #111827;
    --rxf-fw-text: #f3f4f6;
    --rxf-fw-muted: #9ca3af;
    --rxf-fw-border: #374151;
    --rxf-fw-input-bg: #1f2937;
}

/* Honeypot: visually gone, still in the DOM for bots to fill. */
.rxf-form-wrap .rxf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* Field grid */
.rxf-fields { display: flex; flex-wrap: wrap; gap: 16px 4%; }
.rxf-field { width: 100%; position: relative; }
.rxf-field.rxf-w-half { width: 48%; }
@media (max-width: 560px) { .rxf-field.rxf-w-half { width: 100%; } }

.rxf-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--rxf-fw-text); }
.rxf-req { color: #dc2626; }

.rxf-input {
    width: 100%; padding: 11px 14px; font-size: 15px; line-height: 1.4;
    border: 1px solid var(--rxf-fw-border); border-radius: 9px;
    background: var(--rxf-fw-input-bg); color: var(--rxf-fw-text);
    transition: border-color .15s, box-shadow .15s;
}
.rxf-input:focus { outline: none; border-color: var(--rxf-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rxf-accent) 18%, transparent); }
.rxf-input::placeholder { color: var(--rxf-fw-muted); opacity: .8; }
textarea.rxf-input { resize: vertical; min-height: 96px; }
.rxf-select { appearance: none; -webkit-appearance: none; 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 12px center; background-size: 16px; padding-right: 38px; }
.rxf-file { padding: 9px; }

.rxf-split { display: flex; gap: 10px; }
.rxf-split .rxf-input { flex: 1 1 0; min-width: 0; }
.rxf-address { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 480px) { .rxf-split { flex-direction: column; } }

/* Options (radio / checkbox) */
.rxf-options { display: flex; flex-direction: column; gap: 8px; }
.rxf-option {
    display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; cursor: pointer;
    border: 1px solid var(--rxf-fw-border); border-radius: 9px; background: var(--rxf-fw-input-bg);
    font-size: 14.5px; transition: border-color .12s, background .12s;
}
.rxf-option:hover { border-color: var(--rxf-accent); }
.rxf-option.is-checked { border-color: var(--rxf-accent); background: color-mix(in srgb, var(--rxf-accent) 8%, var(--rxf-fw-input-bg)); }
.rxf-option input { margin-top: 3px; accent-color: var(--rxf-accent); }
.rxf-gdpr { border-style: dashed; }

/* Stars */
.rxf-stars { display: inline-flex; gap: 4px; margin-top: 2px; }
.rxf-star { cursor: pointer; }
.rxf-star input { position: absolute; opacity: 0; pointer-events: none; }
.rxf-star span { font-size: 30px; color: #d1d5db; transition: color .12s, transform .12s; display: inline-block; }
.rxf-star:hover span { transform: scale(1.15); }
.rxf-star.is-lit span { color: #f59e0b; }

/* Section break + notes */
.rxf-section-break { border-top: 1px solid var(--rxf-fw-border); padding-top: 16px; margin-top: 4px; }
.rxf-section-break h3 { margin: 0 0 4px; font-size: 17px; font-weight: 700; color: var(--rxf-fw-text); }
.rxf-section-break p { margin: 0; font-size: 13.5px; color: var(--rxf-fw-muted); }
.rxf-note { margin: 6px 0 0; font-size: 12.5px; color: var(--rxf-fw-muted); }
.rxf-counter { display: block; margin-top: 4px; font-size: 12px; color: var(--rxf-fw-muted); text-align: right; }

/* Errors */
.rxf-error { margin: 6px 0 0; font-size: 13px; color: #dc2626; font-weight: 600; }
.rxf-field.rxf-invalid .rxf-input, .rxf-field.rxf-invalid .rxf-option { border-color: #dc2626; }
.rxf-fail { margin: 14px 0 0; font-size: 14px; color: #dc2626; font-weight: 600; }

/* Floating labels variant */
.rxf-float .rxf-field.rxf-type-text .rxf-label,
.rxf-float .rxf-field.rxf-type-email .rxf-label,
.rxf-float .rxf-field.rxf-type-phone .rxf-label,
.rxf-float .rxf-field.rxf-type-url .rxf-label,
.rxf-float .rxf-field.rxf-type-number .rxf-label {
    position: absolute; left: 12px; top: 12px; margin: 0; padding: 0 4px; font-size: 14px; font-weight: 500;
    color: var(--rxf-fw-muted); background: transparent; pointer-events: none;
    transition: top .14s, font-size .14s, color .14s, background .14s;
}
.rxf-float .rxf-field.rxf-type-text .rxf-input,
.rxf-float .rxf-field.rxf-type-email .rxf-input,
.rxf-float .rxf-field.rxf-type-phone .rxf-input,
.rxf-float .rxf-field.rxf-type-url .rxf-input,
.rxf-float .rxf-field.rxf-type-number .rxf-input { padding-top: 15px; }
.rxf-float .rxf-field.rxf-type-text .rxf-input::placeholder,
.rxf-float .rxf-field.rxf-type-email .rxf-input::placeholder,
.rxf-float .rxf-field.rxf-type-phone .rxf-input::placeholder,
.rxf-float .rxf-field.rxf-type-url .rxf-input::placeholder,
.rxf-float .rxf-field.rxf-type-number .rxf-input::placeholder { color: transparent; }
.rxf-float .rxf-field.rxf-hasvalue .rxf-label,
.rxf-float .rxf-field:focus-within .rxf-label {
    top: -8px; font-size: 11.5px; color: var(--rxf-accent); background: var(--rxf-fw-input-bg); border-radius: 4px;
}

/* Submit button - four styles + alignment */
.rxf-actions { margin-top: 20px; display: flex; }
.rxf-btnalign-left .rxf-actions { justify-content: flex-start; }
.rxf-btnalign-center .rxf-actions { justify-content: center; }
.rxf-btnalign-right .rxf-actions { justify-content: flex-end; }
.rxf-btnalign-stretch .rxf-actions .rxf-submit { width: 100%; }

.rxf-submit {
    cursor: pointer; font-size: 15.5px; font-weight: 700; padding: 13px 34px; border-radius: 10px;
    border: 2px solid var(--rxf-accent); background: var(--rxf-accent); color: #fff;
    transition: filter .15s, transform .1s, box-shadow .15s; line-height: 1.3;
}
.rxf-submit:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 8px 20px -10px var(--rxf-accent); }
.rxf-submit:disabled { opacity: .65; cursor: wait; transform: none; }
.rxf-submit.is-busy::after { content: '…'; }

.rxf-btnstyle-outline .rxf-submit { background: transparent; color: var(--rxf-accent); }
.rxf-btnstyle-outline .rxf-submit:hover { background: var(--rxf-accent); color: #fff; }
.rxf-btnstyle-gradient .rxf-submit { border: none; padding: 15px 36px; background: linear-gradient(120deg, var(--rxf-accent), color-mix(in srgb, var(--rxf-accent) 55%, #7c3aed)); }
.rxf-btnstyle-minimal .rxf-submit { border: none; background: transparent; color: var(--rxf-accent); padding: 10px 14px; text-decoration: underline; text-underline-offset: 4px; }
.rxf-btnstyle-minimal .rxf-submit:hover { box-shadow: none; filter: none; }

/* Success panel */
.rxf-success { text-align: center; padding: 26px 10px; }
.rxf-success-ico {
    width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 50%;
    background: color-mix(in srgb, var(--rxf-accent) 14%, var(--rxf-fw-bg));
    color: var(--rxf-accent); font-size: 30px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
.rxf-success h3 { margin: 0 0 8px; font-size: 22px; font-weight: 800; color: var(--rxf-fw-text); }
.rxf-success p { margin: 0; font-size: 15px; color: var(--rxf-fw-muted); line-height: 1.6; }
