/* =============================================================
   CF7 → Gravity Forms theme replica
   Form: ID 1, 2, 3, 4, 5, 6, 7 — Roma Sound Service
   ============================================================= */

/* Wrapper principale */
.wpcf7 .cf7-rss-form {
    box-sizing: border-box;
    width: 100%;
}

/* ---- Field wrap (equivalente .gfield) ---- */
.wpcf7 .cf7-rss-form .cf7-field-wrap {
    box-sizing: border-box;
    margin-bottom: 16px;
    width: 100%;
}

/* Lo span che CF7 inietta attorno a ogni campo */
.wpcf7 .cf7-rss-form .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

/* ---- Label (equivalente .gfield_label) ---- */
.wpcf7 .cf7-rss-form .cf7-label {
    display: inline-block;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    padding: 0;
}

/* Asterisco required (equivalente .gfield_required) */
.wpcf7 .cf7-rss-form .cf7-required {
    color: #c02b0a;
    font-size: 13px;
    font-style: italic;
    font-weight: 400;
    padding-inline-start: 0.125em;
}

/* ---- Inputs, select, textarea ---- */
/* Replica #cta-gravity__form input, #cta-gravity__form textarea */
.wpcf7 .cf7-rss-form input[type="text"],
.wpcf7 .cf7-rss-form input[type="email"],
.wpcf7 .cf7-rss-form input[type="tel"],
.wpcf7 .cf7-rss-form input[type="date"],
.wpcf7 .cf7-rss-form input[type="url"],
.wpcf7 .cf7-rss-form input[type="number"],
.wpcf7 .cf7-rss-form select,
.wpcf7 .cf7-rss-form textarea {
    background-color: #F0EFF4;
    border: 0;
    border-radius: 8px;
    box-shadow: 0 4px 4px 0 rgb(0 0 0 / 10%);
    box-sizing: border-box;
    color: inherit;
    font-family: 'Montserrat', inherit;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 0;
    margin-top: 0;
    max-width: 100%;
    padding: 12px;
    transition: box-shadow 0.2s ease;
    width: 100%;
}

.wpcf7 .cf7-rss-form input[type="text"]:focus,
.wpcf7 .cf7-rss-form input[type="email"]:focus,
.wpcf7 .cf7-rss-form input[type="tel"]:focus,
.wpcf7 .cf7-rss-form input[type="date"]:focus,
.wpcf7 .cf7-rss-form input[type="url"]:focus,
.wpcf7 .cf7-rss-form input[type="number"]:focus,
.wpcf7 .cf7-rss-form select:focus,
.wpcf7 .cf7-rss-form textarea:focus {
    box-shadow: 0 4px 4px 0 rgb(0 0 0 / 10%), 0 0 0 2px rgba(72, 49, 176, 0.3);
    outline: none;
}

/* ---- Placeholder ---- */
.wpcf7 .cf7-rss-form input::placeholder,
.wpcf7 .cf7-rss-form textarea::placeholder {
    color: #9e9ea7;
    opacity: 1;
}

/* Textarea: altezza "medium" di GF = 192px */
.wpcf7 .cf7-rss-form textarea.wpcf7-textarea {
    height: 192px;
    resize: vertical;
    width: 100%;
}

/* Select: rimuove freccia nativa e aggiunge padding destra per custom arrow */
.wpcf7 .cf7-rss-form select.wpcf7-select {
    appearance: none;
    -webkit-appearance: none;
    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' stroke='%23555' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* ---- Validation: campo non valido ---- */
.wpcf7 .cf7-rss-form .wpcf7-not-valid {
    box-shadow: 0 4px 4px 0 rgb(0 0 0 / 10%), 0 0 0 2px #c02b0a !important;
}

/* Messaggio di errore inline (equivalente .gfield_validation_message) */
.wpcf7 .cf7-rss-form .wpcf7-not-valid-tip {
    background: #fff9f9;
    border: 1px solid #c02b0a;
    color: #c02b0a;
    display: block;
    font-size: 14px;
    margin-top: 8px;
    padding: 12px 24px;
}

/* ---- Response output globale (equivalente .gform_validation_errors) ---- */
.wpcf7 .wpcf7-response-output {
    border-radius: 5px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.11);
    font-size: 13px;
    margin: 8px 0 16px;
    padding: 16px;
}

/* Errore di invio */
.wpcf7 .wpcf7-response-output:not(.wpcf7-mail-sent-ok) {
    background: #fff9f9;
    border: 1.5px solid #c02b0a;
    color: #c02b0a;
}

/* Conferma invio riuscito */
.wpcf7 .wpcf7-response-output.wpcf7-mail-sent-ok {
    background: #f6fff6;
    border: 1.5px solid #3a7a00;
    color: #1a3a00;
}

/* ---- Consent / Acceptance (equivalente campo Consenso Privacy) ---- */
.wpcf7 .cf7-rss-form .cf7-consent-wrap {
    margin-top: 4px;
}

.wpcf7 .cf7-rss-form .cf7-consent-wrap .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

.wpcf7 .cf7-rss-form .wpcf7-acceptance .wpcf7-list-item {
    margin: 0;
}

.wpcf7 .cf7-rss-form .wpcf7-acceptance label {
    align-items: flex-start;
    cursor: pointer;
    display: flex;
    font-size: 14px;
    font-weight: 400;
    gap: 10px;
    line-height: 1.5;
    margin: 0;
}

.wpcf7 .cf7-rss-form .wpcf7-acceptance input[type="checkbox"] {
    flex-shrink: 0;
    margin: 3px 0 0;
    width: auto;
}

/* ---- Submit button ---- */
/* Replica il tasto primario del tema (usa var(--primary) se disponibile, altrimenti fallback scuro).
   Adatta il colore al brand: var(--primary) è il violetto #4831B0 del tema Oxygen. */
.wpcf7 .cf7-rss-form .wpcf7-submit {
    background-color: var(--primary, #1a1a2e) !important;
    border: none !important;
    border-radius: 3px !important;
    color: var(--white, #ffffff) !important;
    cursor: pointer;
    display: inline-block;
    font-family: inherit !important;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-top: 8px;
    padding: 14px 28px !important;
    text-transform: uppercase;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.wpcf7 .cf7-rss-form .wpcf7-submit:hover {
    opacity: 0.85;
}

.wpcf7 .cf7-rss-form .wpcf7-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---- Spinner di invio ---- */
.wpcf7 .cf7-rss-form .wpcf7-spinner {
    margin: 0 0 0 8px;
    vertical-align: middle;
}

/* ---- Override: campi bianchi quando il form è nel footer ---- */
footer#footer .wpcf7 .cf7-rss-form input[type="text"],
footer#footer .wpcf7 .cf7-rss-form input[type="email"],
footer#footer .wpcf7 .cf7-rss-form input[type="tel"],
footer#footer .wpcf7 .cf7-rss-form input[type="date"],
footer#footer .wpcf7 .cf7-rss-form input[type="url"],
footer#footer .wpcf7 .cf7-rss-form input[type="number"],
footer#footer .wpcf7 .cf7-rss-form select,
footer#footer .wpcf7 .cf7-rss-form textarea {
    background-color: #ffffff;
}

/* ---- Responsive (equivalente breakpoint GF a 640px) ---- */
@media (max-width: 640px) {
    .wpcf7 .cf7-rss-form input[type="text"],
    .wpcf7 .cf7-rss-form input[type="email"],
    .wpcf7 .cf7-rss-form input[type="tel"],
    .wpcf7 .cf7-rss-form input[type="date"],
    .wpcf7 .cf7-rss-form input[type="url"],
    .wpcf7 .cf7-rss-form input[type="number"],
    .wpcf7 .cf7-rss-form select,
    .wpcf7 .cf7-rss-form textarea {
        min-height: 44px;
    }

    .wpcf7 .cf7-rss-form textarea.wpcf7-textarea {
        min-height: 44px;
    }

    .wpcf7 .cf7-rss-form .wpcf7-submit {
        width: 100%;
        text-align: center;
    }
}
