/* ==========================================================
   CUSTOM FORM - PREMIUM
   Classe form: custom-form
   ========================================================== */

/* ==========================================================
   VARIABILI FORM
   ========================================================== */

.custom-form {
    --form-border: #d8d4cb;
    --form-border-focus: #d97b66;
    --form-text: #2f2f2f;
    --form-muted: #6f6b62;
    --form-bg: #ffffff;
    --form-error: #c24a2c;
}


/* ==========================================================
   STRUTTURA GENERALE
   ========================================================== */

.custom-form .gform_wrapper {
    margin-top: 10px;
}

.custom-form .gform_fields {
    row-gap: 18px;
}


/* ==========================================================
   LABEL E TESTI
   ========================================================== */

.custom-form .gfield_label {
    font-weight: 600;
    font-size: 14px;
    color: var(--form-text);
    margin-bottom: 7px;
}

.custom-form .gfield_description {
    font-size: 13px;
    color: var(--form-muted);
}


/* ==========================================================
   CAMPI FORM
   ========================================================== */

.custom-form input[type="text"],
.custom-form input[type="email"],
.custom-form input[type="tel"],
.custom-form input[type="number"],
.custom-form input[type="password"],
.custom-form input[type="url"],
.custom-form input[type="date"],
.custom-form select,
.custom-form textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--form-border);
    border-radius: 10px;
    background-color: var(--form-bg);
    color: var(--form-text);
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* maiuscolo visivo sui campi testuali */
.custom-form input[type="text"],
.custom-form textarea {
    text-transform: uppercase;
}

.custom-form textarea {
    min-height: 140px;
    resize: vertical;
}

.custom-form input::placeholder,
.custom-form textarea::placeholder {
    color: #9a958b;
}

.custom-form input:focus,
.custom-form select:focus,
.custom-form textarea:focus {
    border-color: var(--form-border-focus);
    outline: none;
    box-shadow: 0 0 0 3px rgba(217, 123, 102, 0.12);
}


/* ==========================================================
   SELECT CUSTOM
   ========================================================== */

.custom-form select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #8a867d 50%),
        linear-gradient(135deg, #8a867d 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 3px),
        calc(100% - 12px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 38px;
}


/* ==========================================================
   CHECKBOX E RADIO
   ========================================================== */

.custom-form input[type="checkbox"],
.custom-form input[type="radio"] {
    accent-color: #d97b66;
}


/* ==========================================================
   VALIDAZIONE ED ERRORI
   ========================================================== */

.custom-form .validation_message,
.custom-form .gfield_validation_message {
    font-size: 13px;
    margin-top: 6px;
    color: var(--form-error);
    font-weight: 500;
}

.custom-form .gfield_error input,
.custom-form .gfield_error select,
.custom-form .gfield_error textarea {
    border-color: var(--form-border-focus) !important;
    box-shadow: 0 0 0 3px rgba(217, 123, 102, 0.1);
}

/* errore live da JS */
.custom-form input.field-live-error {
    border-color: #d97b66 !important;
    box-shadow: 0 0 0 3px rgba(217, 123, 102, 0.12);
}


/* ==========================================================
   CAMPI SPECIALI
   ========================================================== */

/* codice fiscale */
.custom-form .cf-field input {
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* nasconde contatore caratteri */
.custom-form .charleft {
    display: none !important;
}


/* ==========================================================
   BOTTONI FORM
   ========================================================== */

.custom-form .gform_button,
.custom-form button[type="submit"],
.custom-form input[type="submit"] {
    background: #d97b66;
    color: #ffffff;
    border: none;
    min-height: 48px;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(217, 123, 102, 0.18);
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.custom-form .gform_button:hover,
.custom-form button[type="submit"]:hover,
.custom-form input[type="submit"]:hover {
    background: #c46d58;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(196, 109, 88, 0.2);
}


/* ==========================================================
   FOOTER FORM E AREA PAGAMENTO
   ========================================================== */

/* footer generale */
.custom-form .gform_footer,
.custom-form .gform_page_footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e6e3db;
}

/* area pagamento separata dalla navigazione */
.custom-form .ginput_container_payment {
    margin-top: 24px;
    padding-top: 12px;
    border-top: 1px solid #f0ede7;
}

/* testo del blocco pagamento */
.custom-form .gform_page_footer p,
.custom-form .gform_footer p {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* bottone precedente leggermente separato */
.custom-form .gform_previous_button,
.custom-form input.gform_previous_button.button {
    margin-bottom: 10px;
}

/* contenitore paypal compatto e centrato */
.custom-form .paypal-button-container {
    max-width: 320px !important;
    min-width: 280px !important;
    margin: 0 auto !important;
}

/* bottoni / iframe PayPal e MyBank */
.custom-form .gform_page_footer iframe,
.custom-form .gform_footer iframe,
.custom-form .gform_page_footer button,
.custom-form .gform_footer button {
    display: block;
    margin: 0 auto 10px;
}

/* riduce leggermente la dimensione visiva */
.custom-form .paypal-button-container iframe,
.custom-form .paypal-button-container button {
    transform: scale(0.95);
    transform-origin: top center;
}

/* elimina spazio finale */
.custom-form .gform_page_footer iframe:last-child,
.custom-form .gform_footer iframe:last-child,
.custom-form .gform_page_footer button:last-child,
.custom-form .gform_footer button:last-child {
    margin-bottom: 0;
}


/* ==========================================================
   RESPONSIVE MOBILE
   ========================================================== */

@media (max-width: 600px) {
    .custom-form .gfield_label {
        font-size: 13px;
    }

    .custom-form input[type="text"],
    .custom-form input[type="email"],
    .custom-form input[type="tel"],
    .custom-form input[type="number"],
    .custom-form input[type="password"],
    .custom-form input[type="url"],
    .custom-form input[type="date"],
    .custom-form select,
    .custom-form textarea {
        min-height: 46px;
        padding: 11px 12px;
        border-radius: 8px;
        font-size: 14px;
    }

    .custom-form .gform_button,
    .custom-form button[type="submit"],
    .custom-form input[type="submit"] {
        width: 100%;
    }
}