/* ============================================
   CF7 + Select2 - Stile completo
   Scope: .ns-form-wrapper
   Brand color: #0170B9
   Button color: #0F68C9
   ============================================ */


/* ============================================
   RESET BASE
   ============================================ */

.ns-form-wrapper .wpcf7 * {
    box-sizing: border-box;
}

.ns-form-wrapper .wpcf7 br {
    display: none;
}


/* ============================================
   LABEL
   ============================================ */

.ns-form-wrapper .wpcf7 label,
.ns-form-wrapper .wpcf7 > label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 0;
    margin-top: 12px;
}

.ns-form-wrapper .wpcf7 label:first-child {
    margin-top: 0;
}


/* ============================================
   INPUT, TEL, EMAIL, TEXTAREA
   ============================================ */

.ns-form-wrapper .wpcf7 input[type="text"],
.ns-form-wrapper .wpcf7 input[type="email"],
.ns-form-wrapper .wpcf7 input[type="tel"],
.ns-form-wrapper .wpcf7 input[type="url"],
.ns-form-wrapper .wpcf7 input[type="number"],
.ns-form-wrapper .wpcf7 input[type="password"],
.ns-form-wrapper .wpcf7 textarea {
    display: block;
    width: 100%;
    height: 42px;
    padding: 6px 12px;
    font-size: 15px;
    font-family: Arial, sans-serif;
    color: #222;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.ns-form-wrapper .wpcf7 textarea {
    height: auto;
    resize: vertical;
    padding: 10px 12px;
}

/* Focus */
.ns-form-wrapper .wpcf7 input[type="text"]:focus,
.ns-form-wrapper .wpcf7 input[type="email"]:focus,
.ns-form-wrapper .wpcf7 input[type="tel"]:focus,
.ns-form-wrapper .wpcf7 input[type="url"]:focus,
.ns-form-wrapper .wpcf7 input[type="number"]:focus,
.ns-form-wrapper .wpcf7 input[type="password"]:focus,
.ns-form-wrapper .wpcf7 textarea:focus {
    border-color: #0170B9;
    box-shadow: 0 0 0 2px rgba(1, 112, 185, 0.15);
}

/* Placeholder */
.ns-form-wrapper .wpcf7 input::placeholder,
.ns-form-wrapper .wpcf7 textarea::placeholder {
    color: #999;
    font-size: 14px;
}

/* Stato not-valid */
.ns-form-wrapper .wpcf7 input.wpcf7-not-valid,
.ns-form-wrapper .wpcf7 textarea.wpcf7-not-valid {
    border-color: #dc3232;
    box-shadow: 0 0 0 2px rgba(220, 50, 50, 0.15);
}


/* ============================================
   SELECT NATIVO (fallback senza Select2)
   ============================================ */

.ns-form-wrapper .wpcf7 select {
    display: block;
    width: 100%;
    height: 42px;
    padding: 6px 12px;
    font-size: 15px;
    font-family: Arial, sans-serif;
    color: #222;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.ns-form-wrapper .wpcf7 select:focus {
    border-color: #0170B9;
    box-shadow: 0 0 0 2px rgba(1, 112, 185, 0.15);
}

.ns-form-wrapper .wpcf7 select.wpcf7-not-valid {
    border-color: #dc3232;
    box-shadow: 0 0 0 2px rgba(220, 50, 50, 0.15);
}


/* ============================================
   SELECT2 OVERRIDE
   ============================================ */

.ns-form-wrapper .select2-container {
    width: 100% !important;
}

.ns-form-wrapper .select2-container--default .select2-selection--single {
    height: 42px;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 15px;
    font-family: Arial, sans-serif;
    color: #222;
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ns-form-wrapper .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 28px;
    color: #222;
    padding-left: 0;
}

.ns-form-wrapper .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #999;
    font-size: 14px;
}

.ns-form-wrapper .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
    right: 8px;
}

/* Focus e apertura */
.ns-form-wrapper .select2-container--default.select2-container--focus .select2-selection--single,
.ns-form-wrapper .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #0170B9;
    outline: none;
    box-shadow: 0 0 0 2px rgba(1, 112, 185, 0.15);
}

/* Dropdown */
.ns-form-wrapper .select2-dropdown {
    border: 1px solid #0170B9;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Search box */
.ns-form-wrapper .select2-search--dropdown {
    padding: 8px;
}

.ns-form-wrapper .select2-search--dropdown .select2-search__field {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease;
}

.ns-form-wrapper .select2-search--dropdown .select2-search__field:focus {
    border-color: #0170B9;
    box-shadow: 0 0 0 2px rgba(1, 112, 185, 0.15);
}

/* Opzioni */
.ns-form-wrapper .select2-results__option {
    padding: 8px 12px;
    color: #222;
}

.ns-form-wrapper .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #0170B9;
    color: #fff;
}

.ns-form-wrapper .select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: #e6f2fb;
    color: #0170B9;
    font-weight: bold;
}

/* Stato not-valid su Select2 */
.ns-form-wrapper .wpcf7-not-valid ~ .select2-container .select2-selection--single {
    border-color: #dc3232;
    box-shadow: 0 0 0 2px rgba(220, 50, 50, 0.15);
}


/* ============================================
   ACCEPTANCE (PRIVACY CHECKBOX)
   ============================================ */

.ns-form-wrapper .wpcf7 .wpcf7-acceptance {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 20px;
}

.ns-form-wrapper .wpcf7 .wpcf7-acceptance input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin-top: 2px;
    accent-color: #0170B9;
    cursor: pointer;
}

.ns-form-wrapper .wpcf7 .wpcf7-acceptance .wpcf7-list-item {
    margin: 0;
}

.ns-form-wrapper .wpcf7 .wpcf7-acceptance small {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.ns-form-wrapper .wpcf7 .wpcf7-acceptance small a {
    color: #0170B9;
    text-decoration: underline;
}

.ns-form-wrapper .wpcf7 .wpcf7-acceptance small a:hover {
    text-decoration: none;
}


/* ============================================
   SUBMIT BUTTON
   ============================================ */

.ns-form-wrapper .wpcf7 input[type="submit"] {
    display: inline-block;
    margin: 16px 0;
    padding: 12px 32px;
    font-size: 15px;
    font-family: Arial, sans-serif;
    font-weight: 600;
    color: #fff;
    background-color: #0F68C9;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: none;
    appearance: none;
    -webkit-appearance: none;
}

.ns-form-wrapper .wpcf7 input[type="submit"]:hover,
.ns-form-wrapper .wpcf7 input[type="submit"]:focus,
.ns-form-wrapper .wpcf7 input[type="submit"]:active {
    background-color: #0F68C9;
    color: #fff;
    outline: none;
    box-shadow: none;
}




/* ============================================
   MESSAGGI DI VALIDAZIONE
   ============================================ */

.ns-form-wrapper .wpcf7 .wpcf7-not-valid-tip {
    display: block;
    font-size: 0.85rem;
    color: #dc3232;
    margin-top: 4px;
}

.ns-form-wrapper .wpcf7 .wpcf7-response-output {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    border: none;
}

/* Successo */
.ns-form-wrapper .wpcf7 .wpcf7-response-output.wpcf7-mail-sent-ok {
    background-color: #edfaed;
    color: #276127;
    border-left: 4px solid #3a9a3a;
}

/* Errore */
.ns-form-wrapper .wpcf7 .wpcf7-response-output.wpcf7-mail-sent-ng,
.ns-form-wrapper .wpcf7 .wpcf7-response-output.wpcf7-aborted,
.ns-form-wrapper .wpcf7 .wpcf7-response-output.wpcf7-spam-blocked,
.ns-form-wrapper .wpcf7 .wpcf7-response-output.wpcf7-validation-errors {
    background-color: #fff5f5;
    color: #9b1c1c;
    border-left: 4px solid #dc3232;
}