/* ============================================================
   Hasset Form - Public Styles v3.0
   ============================================================ */

.hf-public-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.hf-form-title {
    margin-bottom: 20px;
    color: #1d2327;
    font-size: 1.5em;
}

/* === FORM CONTAINER === */

.hf-public-form {
    background: #fff;
    padding: 25px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 0 18px;
}

/* === CAMPI === */

.hf-form-field {
    margin-bottom: 18px;
    box-sizing: border-box;
}

/* 100% = a tutta riga */
.hf-form-field.hf-col-100 {
    width: 100%;
}

/* 50% = mezza riga */
.hf-form-field.hf-col-50 {
    width: calc(50% - 9px);
}

/* 33% = un terzo */
.hf-form-field.hf-col-33 {
    width: calc(33.333% - 12px);
}

.hf-form-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #1d2327;
}

.hf-required {
    color: #d63638;
    margin-left: 2px;
}

.hf-input,
input[type="date"].hf-input,
input[type="time"].hf-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    height: 42px;
    background: #fff;
    color: #1d2327;
}

.hf-input:focus,
input[type="date"].hf-input:focus,
input[type="time"].hf-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

select.hf-input {
    appearance: auto;
    cursor: pointer;
    height: 42px;
}

textarea.hf-input {
    resize: vertical;
    min-height: 80px;
    height: auto;
}

input[type="date"].hf-input::-webkit-calendar-picker-indicator,
input[type="time"].hf-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
}

input[type="date"].hf-input::-webkit-calendar-picker-indicator:hover,
input[type="time"].hf-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

input[name="hf_numero_persone"] {
    max-width: 120px;
}

/* Honeypot */
.hf-honeypot-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* Checkbox / Radio */
.hf-checkbox-group,
.hf-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hf-checkbox-label,
.hf-radio-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    font-weight: 400 !important;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.15s;
    margin-bottom: 0 !important;
}

.hf-checkbox-label:hover,
.hf-radio-label:hover {
    background: #f0f0f1;
}

.hf-checkbox-label input[type="checkbox"],
.hf-radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
}

/* Catalogo prodotti */
.hf-catalog-frontend {
    width: 100%;
    margin-bottom: 18px;
}

.hf-catalog-item {
    margin-bottom: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.hf-catalog-label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    cursor: pointer;
}

.hf-catalog-checkbox { width: 18px; height: 18px; margin: 0; }
.hf-catalog-name { font-weight: 600; color: #1d2327; flex: 1; }
.hf-catalog-desc { font-size: 13px; color: #646970; }
.hf-catalog-price { font-weight: 700; color: #00a32a; font-size: 15px; white-space: nowrap; }
.hf-catalog-qty-wrapper { margin-top: 8px; padding-left: 28px; display: flex; align-items: center; gap: 8px; }
.hf-catalog-qty-wrapper label { font-size: 13px; color: #646970; margin: 0; }
.hf-catalog-qty { width: 60px !important; padding: 4px 8px !important; }
.hf-catalog-total { margin-top: 15px; padding-top: 15px; border-top: 2px solid #e0e0e0; text-align: right; font-size: 18px; }
.hf-catalog-total strong { color: #1d2327; }
#hf-catalog-total-value { color: #00a32a; font-weight: 700; }

/* Slot orario note */
.hf-slot-note { margin-top: 6px; font-size: 12px; color: #646970; }

/* QR Code */
.hf-qr-note {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f0f6fc;
    border-radius: 4px;
    border-left: 3px solid #2271b1;
    width: 100%;
    margin-bottom: 18px;
    box-sizing: border-box;
}

.hf-qr-note .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #2271b1;
}

/* Turnstile / reCAPTCHA */
.hf-captcha-wrapper {
    width: 100%;
}

/* Submit */
.hf-submit-wrapper {
    width: 100%;
    margin-top: 10px;
    padding-top: 10px;
}

.hf-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 30px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    min-width: 150px;
}

.hf-submit-btn:hover { background: #135e96; }
.hf-submit-btn:disabled { background: #c3c4c7; cursor: not-allowed; }

.hf-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hf-spin 0.8s linear infinite;
}

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

/* Messaggi */
.hf-form-message {
    width: 100%;
    margin-top: 15px;
    padding: 15px 20px;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
}

.hf-form-message.hf-success { background: #edfaef; color: #00a32a; border: 1px solid #00a32a; }
.hf-form-message.hf-error { background: #fcf0f1; color: #d63638; border: 1px solid #d63638; }
.hf-error { color: #d63638; font-style: italic; }

/* ============================================================
   RESPONSIVE - MOBILE
   ============================================================ */
@media (max-width: 600px) {
    .hf-public-form {
        padding: 15px;
        gap: 0;
    }
    .hf-form-title { font-size: 1.3em; margin-bottom: 15px; }
    .hf-form-field,
    .hf-form-field.hf-col-50,
    .hf-form-field.hf-col-33,
    .hf-form-field.hf-col-100 {
        width: 100% !important;
        margin-left: 0 !important;
        padding-right: 0 !important;
    }
    .hf-public-form input,
    .hf-public-form select,
    .hf-public-form textarea {
        font-size: 16px !important;
        min-height: 44px;
    }
    .hf-catalog-item { padding: 10px; }
    .hf-catalog-label { flex-direction: column; align-items: flex-start; gap: 5px; }
    .hf-catalog-price { align-self: flex-end; }
    .hf-submit-btn { width: 100%; min-height: 48px; font-size: 16px; }
}

/* === FORM INVIATO: nascondi form, mostra messaggio === */
.hf-submitted .hf-public-form { display: none !important; }
.hf-submitted .hf-form-message { display: block !important; }

/* === MESSAGGIO RINGRAZIAMENTO FINALE === */
.hf-form-message.hf-success-final {
    padding: 20px 0;
    text-align: left;
    font-size: 16px;
    line-height: 1.6;
    color: #1d2327;
}
