/* FlairFly Booking Form — tutte le classi hanno prefisso ffb- (nessun conflitto con la vecchia .ff-*) */
.ffb-form {
    --ffb-copper: #c57a4a;
    --ffb-copper-dark: #a86744;
    --ffb-ink: #233e49;
    --ffb-border: #d3dbe0;
    --ffb-border-dark: #5b6a72;
    --ffb-muted: #8a979e;
    font-family: inherit;
    color: var(--ffb-ink);
    position: relative;
    width: 100%;
    box-sizing: border-box;
}
.ffb-form *, .ffb-form *::before, .ffb-form *::after { box-sizing: border-box; }
.ffb-form [hidden] { display: none !important; }

/* radio andata / andata e ritorno */
.ffb-radio-row { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 22px; }
.ffb-radio, .ffb-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; line-height: 1.4; color: var(--ffb-ink); }
.ffb-radio input, .ffb-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.ffb-radio > span::before, .ffb-check > span::before {
    content: ""; display: inline-block; flex: 0 0 auto; vertical-align: middle;
    width: 16px; height: 16px; margin-right: 8px; border-radius: 50%;
    border: 1.5px solid var(--ffb-copper); background: #fff;
    transition: box-shadow .15s ease;
}
.ffb-radio input:checked + span::before { box-shadow: inset 0 0 0 3.5px #fff; background: var(--ffb-copper); }
.ffb-radio input:focus-visible + span::before, .ffb-check input:focus-visible + span::before { outline: 2px solid var(--ffb-ink); outline-offset: 2px; }

/* etichette viaggio */
.ffb-trip-label { font-size: 12px; font-weight: 700; letter-spacing: .18em; color: var(--ffb-copper); margin: 4px 0 10px; }
.ffb-row-ret { margin-top: 4px; }

/* griglia */
.ffb-fields { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 15px; }
.ffb-fields-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ffb-field { min-width: 0; position: relative; }
.ffb-field-full { margin-top: 18px; }

.ffb-label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 400; color: var(--ffb-ink); }
.ffb-req { color: #d63638; }

/* campi step 1 */
.ffb-control {
    display: block; width: 100%; min-height: 46px; padding: 0 14px;
    font: inherit; font-size: 14px; color: var(--ffb-ink);
    background: #fff; border: 1px solid var(--ffb-border) !important; border-radius: 10px !important;
    box-shadow: none; outline: none; margin: 0;
    -webkit-appearance: none; appearance: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.ffb-control::placeholder { color: var(--ffb-muted); opacity: 1; }
.ffb-control:focus { border-color: var(--ffb-copper) !important; box-shadow: 0 0 0 3px rgba(197, 122, 74, .15); }
.ffb-control[readonly] { cursor: pointer; }
.ffb-control[type="date"], .ffb-control[type="time"] { min-height: 46px; }

/* campi step 2: bordo scuro, angoli più netti */
.ffb-input2 { min-height: 40px; border: 1px solid var(--ffb-border-dark) !important; border-radius: 4px !important; }
.ffb-input2:focus { border-color: var(--ffb-ink) !important; box-shadow: none; }

/* errori */
.ffb-invalid { border-color: #d63638 !important; }
.ffb-err-msg { display: block; margin-top: 4px; font-size: 12px; color: #d63638; }
.ffb-error-box { margin: 14px 0 0; padding: 10px 14px; border-radius: 8px; background: #fcf0f0; color: #a02020; font-size: 14px; }

/* numero passeggeri */
.ffb-number { position: relative; }
.ffb-number .ffb-pax, .ffb-number .ffb-pax-rt, .ffb-number .ffb-patients { padding-right: 46px; -moz-appearance: textfield; }
.ffb-number input::-webkit-outer-spin-button, .ffb-number input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ffb-number-btns { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); display: flex; flex-direction: column; gap: 3px; }
.ffb-num-btn {
    width: 34px; height: 18px; padding: 0; line-height: 1; font-size: 13px; font-weight: 600;
    color: var(--ffb-copper); background: #fff; border: 1px solid var(--ffb-copper); border-radius: 4px; cursor: pointer;
}
.ffb-num-btn:hover { background: var(--ffb-copper); color: #fff; }

/* combobox (autocomplete) */
.ffb-combo { position: relative; }
.ffb-combo .ffb-control { padding-right: 34px; 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 d='M1 1l5 5 5-5' fill='none' stroke='%23233e49' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.ffb-combo .ffb-control:disabled { background-color: #f4f6f7; cursor: not-allowed; }
.ffb-list {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60;
    max-height: 260px; overflow-y: auto; margin: 0; padding: 6px 0; list-style: none;
    background: #fff; border: 1px solid var(--ffb-border); border-radius: 12px;
    box-shadow: 0 10px 24px rgba(20, 35, 45, .12);
}
.ffb-list li { margin: 0; padding: 9px 14px; font-size: 14px; cursor: pointer; color: var(--ffb-ink); list-style: none; }
.ffb-list li::before { content: none !important; }
.ffb-list li:hover, .ffb-list li.ffb-active { background: #f6efe9; }
.ffb-list li.ffb-empty { color: var(--ffb-muted); cursor: default; }
.ffb-list li.ffb-empty:hover { background: transparent; }

/* checkbox step 2 */
.ffb-checks { margin-top: 20px; }
.ffb-checks .ffb-label { margin-bottom: 8px; }
.ffb-check { margin: 0 0 14px; }
.ffb-check > span { display: inline; }
.ffb-check > span::before { width: 18px; height: 18px; border-width: 2px; margin-right: 12px; }
.ffb-check input:checked + span::before { background: var(--ffb-copper); box-shadow: inset 0 0 0 3.5px #fff; }
.ffb-check strong, .ffb-check a { font-weight: 700; color: var(--ffb-ink); text-decoration: none; }
.ffb-check a:hover { color: var(--ffb-copper); }
.ffb-field-check.ffb-has-error .ffb-check > span::before { border-color: #d63638; }

/* bottoni */
.ffb-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 18px; }
.ffb-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 40px; padding: 0 26px; font: inherit; font-size: 14px; font-weight: 600; line-height: 1;
    color: #fff !important; background: var(--ffb-copper); border: 1px solid var(--ffb-copper); border-radius: 10px;
    cursor: pointer; box-shadow: none; text-decoration: none;
    transition: background .2s ease, border-color .2s ease;
}
.ffb-btn:hover, .ffb-btn:focus-visible { background: var(--ffb-copper-dark); border-color: var(--ffb-copper-dark); color: #fff !important; }
.ffb-btn:disabled { opacity: .65; cursor: wait; }

/* honeypot */
.ffb-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* conferma */
.ffb-done { padding: 28px 24px; border: 1px solid var(--ffb-border); border-radius: 12px; background: #fff; text-align: center; }
.ffb-done strong { display: block; margin-bottom: 6px; font-size: 18px; color: var(--ffb-ink); }
.ffb-done p { margin: 0; font-size: 14px; color: var(--ffb-ink); }

/* responsive (stessi breakpoint della form attuale) */
@media (max-width: 1024px) {
    .ffb-fields, .ffb-fields-4 { grid-template-columns: 1fr; }
    .ffb-actions { justify-content: stretch; }
    .ffb-actions .ffb-btn { flex: 1 1 0; }
}

/* ambulanza aerea: spunte sotto i campi */
.ffb-checks-aa { margin-top: 18px; }
.ffb-checks-aa .ffb-check { display: flex; }
.ffb-weight, .ffb-volume { -moz-appearance: textfield; }
.ffb-weight::-webkit-outer-spin-button, .ffb-weight::-webkit-inner-spin-button, .ffb-volume::-webkit-outer-spin-button, .ffb-volume::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ===== Layout in base alla larghezza del CONTENITORE (non dello schermo) =====
   Le classi ffb-compact / ffb-narrow le mette il JS in base alla larghezza reale della form.
   (niente container-type: dentro i contenitori flex di Elementor poteva alterare le dimensioni) */
.ffb-form.ffb-compact .ffb-fields { grid-template-columns: 1fr; }
.ffb-form.ffb-compact .ffb-fields-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ffb-form.ffb-compact.ffb-narrow .ffb-fields-4 { grid-template-columns: 1fr; }
.ffb-form.ffb-compact .ffb-actions { justify-content: stretch; }
.ffb-form.ffb-compact .ffb-actions .ffb-btn { flex: 1 1 0; }

/* ===== Richiesta volo: bottone in linea con i campi, form piu' bassa ===== */
.ffb-fields.ffb-inline { grid-template-columns: repeat(5, minmax(0, 1fr)) 110px; }
.ffb-field-btn { align-self: end; }
.ffb-field-btn .ffb-btn { width: 100%; min-height: 46px; padding: 0 10px; }
.ffb-actions-alt { display: none; }
.ffb-checks-aa { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 12px; }
.ffb-checks-aa .ffb-check { margin: 0; }
/* layout a colonna (schermi stretti o form in colonna stretta): campi uno sotto l'altro, bottone sotto */
@media (max-width: 1024px) {
    .ffb-fields.ffb-inline { grid-template-columns: 1fr; }
    .ffb-field-btn { display: none; }
    .ffb-actions-alt { display: flex; }
}
.ffb-form.ffb-compact .ffb-fields.ffb-inline { grid-template-columns: 1fr; }
.ffb-form.ffb-compact .ffb-field-btn { display: none; }
.ffb-form.ffb-compact .ffb-actions-alt { display: flex; }

