/* =========================================================================
 * BOOM Forms — public standalone page
 * RTL-first, mobile-first, brand color via --bf-brand (set inline per form)
 * ====================================================================== */

:root {
    --bf-brand: #6c5ce7;
    --bf-bg: #f3f4f6;
    --bf-card: #ffffff;
    --bf-text: #111827;
    --bf-muted: #6b7280;
    --bf-border: #d1d5db;
    --bf-error: #dc2626;
    --bf-radius: 14px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

.bf-body {
    font-family: 'Tajawal', Tahoma, Arial, sans-serif;
    background: var(--bf-bg);
    color: var(--bf-text);
    font-size: 16px;
    line-height: 1.65;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.bf-shell {
    max-width: 680px;
    margin: 0 auto;
    padding: 24px 14px 40px;
}

.bf-card {
    background: var(--bf-card);
    border-radius: var(--bf-radius);
    box-shadow: 0 8px 30px rgba(17, 24, 39, 0.08);
    padding: 28px 22px;
    border-top: 5px solid var(--bf-brand);
}

@media (min-width: 640px) {
    .bf-shell { padding: 44px 16px 56px; }
    .bf-card  { padding: 40px 44px; }
}

/* ── header ── */
.bf-head { text-align: center; margin-bottom: 24px; }
.bf-logo { max-height: 64px; max-width: 220px; object-fit: contain; margin-bottom: 12px; }
.bf-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    color: var(--bf-text);
}
.bf-page-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--bf-brand);
}

/* ── alerts ── */
.bf-alert {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 500;
}

/* ── progress (multi-page) ── */
.bf-progress {
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 6px;
}
.bf-progress-bar {
    height: 100%;
    width: 0;
    background: var(--bf-brand);
    border-radius: 999px;
    transition: width 0.35s ease;
}
.bf-steps-label {
    font-size: 12px;
    color: var(--bf-muted);
    margin-bottom: 18px;
}

/* ── fields ── */
.bf-field { margin-bottom: 20px; }
.bf-label {
    display: block;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 7px;
}
.bf-req { color: var(--bf-error); }
.bf-desc {
    font-size: 13px;
    color: var(--bf-muted);
    margin: 6px 0 0;
}
.bf-error {
    font-size: 13px;
    color: var(--bf-error);
    font-weight: 500;
    margin: 6px 0 0;
}

.bf-input {
    display: block;
    width: 100%;
    padding: 11px 14px;
    font: inherit;
    color: var(--bf-text);
    background: #fff;
    border: 1.5px solid var(--bf-border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}
select.bf-input {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    padding-inline-end: 14px;
    padding-inline-start: 32px;
}
[dir="ltr"] select.bf-input {
    background-position: right 14px center;
    padding-inline-start: 14px;
    padding-inline-end: 32px;
}
select.bf-input[multiple] { background-image: none; padding: 11px 14px; }
.bf-input:focus {
    border-color: var(--bf-brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--bf-brand) 18%, transparent);
}
.bf-has-error .bf-input,
.bf-has-error .bf-choices {
    border-color: var(--bf-error);
}
textarea.bf-input { resize: vertical; min-height: 90px; }

/* ── choices (radio / checkboxes) ── */
.bf-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1.5px solid transparent;
    border-radius: 10px;
}
.bf-choice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f9fafb;
    border: 1.5px solid var(--bf-border);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: border-color 0.15s ease, background 0.15s ease;
    margin: 0;
}
.bf-choice:hover { border-color: var(--bf-brand); }
.bf-choice input {
    accent-color: var(--bf-brand);
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin: 0;
}
.bf-choice input:checked + span { color: var(--bf-brand); font-weight: 700; }

/* ── file ── */
.bf-file { padding: 9px 12px; background: #f9fafb; cursor: pointer; }
.bf-file::file-selector-button {
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: var(--bf-brand);
    border: 0;
    border-radius: 8px;
    padding: 7px 16px;
    margin-inline-end: 12px;
    cursor: pointer;
}
.bf-file-hint {
    font-size: 12px;
    color: var(--bf-muted);
    margin: 6px 0 0;
}

/* ── divider / html blocks ── */
.bf-divider h3 {
    font-size: 17px;
    font-weight: 800;
    color: var(--bf-brand);
    border-bottom: 2px solid color-mix(in srgb, var(--bf-brand) 25%, transparent);
    padding-bottom: 8px;
    margin: 8px 0 4px;
}
.bf-divider hr {
    border: 0;
    border-top: 1.5px solid var(--bf-border);
}
.bf-field-html img { max-width: 100%; height: auto; }

/* ── honeypot: visually removed, still in the DOM for bots ── */
.bf-hp {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

/* ── actions ── */
.bf-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 26px;
}
.bf-btn {
    font: inherit;
    font-weight: 700;
    font-size: 16px;
    border: 0;
    border-radius: 10px;
    padding: 12px 30px;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.05s ease;
}
.bf-btn:active { transform: translateY(1px); }
.bf-btn-primary {
    background: var(--bf-brand);
    color: #fff;
    flex: 1;
}
.bf-btn-primary:hover { filter: brightness(1.08); }
.bf-btn-primary:disabled { opacity: 0.6; cursor: wait; }
.bf-btn-ghost {
    background: transparent;
    color: var(--bf-muted);
    border: 1.5px solid var(--bf-border);
}
.bf-btn-ghost:hover { color: var(--bf-text); border-color: var(--bf-muted); }

/* ── confirmation ── */
.bf-confirm { text-align: center; padding-top: 40px; padding-bottom: 44px; }
.bf-confirm-icon { color: var(--bf-brand); margin-bottom: 14px; }
.bf-confirm-message {
    font-size: 17px;
    color: var(--bf-text);
    margin: 12px auto 0;
    max-width: 480px;
}

/* ── advanced: field size ── */
.bf-field.bf-size-small  { max-width: 220px; }
.bf-field.bf-size-medium { max-width: 420px; }
.bf-field.bf-size-large  { max-width: 100%; }

/* ── advanced: hidden label (kept for screen readers) ── */
.bf-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ── choice layout (columns / inline) ── */
.bf-choices.bf-layout-two,
.bf-choices.bf-layout-three {
    display: grid;
    gap: 8px;
}
.bf-choices.bf-layout-two   { grid-template-columns: 1fr 1fr; }
.bf-choices.bf-layout-three { grid-template-columns: 1fr 1fr 1fr; }
.bf-choices.bf-layout-inline {
    flex-direction: row;
    flex-wrap: wrap;
}
.bf-choices.bf-layout-inline .bf-choice { flex: 0 1 auto; }
@media (max-width: 520px) {
    .bf-choices.bf-layout-two,
    .bf-choices.bf-layout-three { grid-template-columns: 1fr; }
}

/* ── name / address sub-fields ── */
.bf-subfields,
.bf-address {
    display: grid;
    gap: 12px;
}
.bf-subfields-2 { grid-template-columns: 1fr 1fr; }
.bf-address     { grid-template-columns: 1fr 1fr; }
.bf-addr-street { grid-column: 1 / -1; }
.bf-subfield .bf-sublabel {
    display: block;
    font-size: 12px;
    color: var(--bf-muted);
    margin-top: 5px;
}
@media (max-width: 520px) {
    .bf-subfields-2,
    .bf-address { grid-template-columns: 1fr; }
}

/* ── international phone (custom country combobox + number) ── */
.bf-phone-intl { display: flex; gap: 8px; align-items: flex-start; }
.bf-phone-picker { position: relative; flex: 0 0 auto; }
.bf-phone-btn {
    display: inline-flex; align-items: center; gap: 6px;
    width: auto; min-width: 96px; cursor: pointer; white-space: nowrap; text-align: start;
}
.bf-phone-btn .bf-phone-flag { font-size: 1.1em; line-height: 1; }
.bf-phone-btn .bf-phone-dial { direction: ltr; font-weight: 600; }
.bf-phone-btn .bf-phone-caret { margin-inline-start: 4px; color: var(--bf-muted); font-size: 11px; }
.bf-phone-number { flex: 1 1 auto; min-width: 0; }
.bf-phone-number .bf-input { width: 100%; }
.bf-phone-number input[type="tel"] { direction: ltr; text-align: start; }

.bf-phone-panel {
    position: absolute; z-index: 60; inset-inline-start: 0; top: calc(100% + 4px);
    width: min(280px, 80vw); background: #fff;
    border: 1px solid #e4e7ec; border-radius: 10px;
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.16); padding: 6px;
}
.bf-phone-panel[hidden] { display: none; }
.bf-phone-search {
    width: 100%; box-sizing: border-box; margin-bottom: 6px;
    padding: 8px 10px; border: 1px solid #e4e7ec; border-radius: 8px; font-size: 14px;
}
.bf-phone-list { list-style: none; margin: 0; padding: 0; max-height: 204px; overflow-y: auto; }
.bf-phone-opt {
    display: flex; align-items: center; gap: 8px;
    padding: 8px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.bf-phone-opt[hidden] { display: none; }
.bf-phone-opt:hover, .bf-phone-opt.bf-phone-active { background: #f3eefe; }
.bf-phone-opt.bf-phone-opt-sel { background: #ede4ff; font-weight: 600; }
.bf-phone-opt .bf-phone-flag { font-size: 1.15em; width: 1.5em; text-align: center; flex: 0 0 auto; }
.bf-phone-opt .bf-phone-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bf-phone-opt .bf-phone-optdial { direction: ltr; color: var(--bf-muted); font-size: 13px; flex: 0 0 auto; }
.bf-phone-empty { padding: 12px; text-align: center; color: var(--bf-muted); font-size: 13px; }
@media (max-width: 520px) {
    .bf-phone-intl { flex-direction: column; }
    .bf-phone-picker { width: 100%; }
    .bf-phone-btn { width: 100%; justify-content: flex-start; }
    .bf-phone-panel { width: 100%; }
}

/* ── number slider ── */
.bf-slider-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}
.bf-slider {
    flex: 1;
    accent-color: var(--bf-brand);
    height: 6px;
    cursor: pointer;
}
.bf-slider-val {
    min-width: 46px;
    text-align: center;
    font-weight: 700;
    color: var(--bf-brand);
    background: #f9fafb;
    border: 1.5px solid var(--bf-border);
    border-radius: 8px;
    padding: 4px 8px;
}

/* ── rating stars ── */
.bf-rating {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.bf-star {
    font-size: 30px;
    line-height: 1;
    background: none;
    border: 0;
    padding: 0 2px;
    cursor: pointer;
    color: #d1d5db;
    transition: color 0.12s ease, transform 0.05s ease;
}
.bf-star:hover  { transform: scale(1.12); }
.bf-star:active { transform: translateY(1px); }
.bf-star.bf-star-on { color: #f5b301; }
.bf-has-error .bf-rating { outline: none; }

/* ── footer ── */
.bf-powered {
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 18px;
    letter-spacing: 0.4px;
}

/* ── rendered rich content (imported HTML / WPForms Scriptor) ── */
.bf-content { line-height: 1.85; }
.bf-content > div, .bf-content p { margin: 0 0 8px; }
.bf-content div div { margin: 0; }            /* collapse nested scriptor wrappers */
.bf-content h1,.bf-content h2,.bf-content h3 { margin: 14px 0 8px; font-weight: 700; }
.bf-content ul,.bf-content ol { margin: 0 0 8px; padding-inline-start: 22px; }
.bf-content strong { font-weight: 700; }
.bf-content a { color: var(--bf-brand); }
.bf-content img { max-width: 100%; height: auto; }
