/* =============================================
   ECF - Elementor Contact Form Widget
   Base styles + 5 preset themes
============================================= */

/* --- BASE LAYOUT --- */
.ecf-form-wrapper {
    width: 100%;
    box-sizing: border-box;
    padding: 40px;
}

.ecf-title {
    font-size: 1.6em;
    font-weight: 600;
    margin-bottom: 32px;
    line-height: 1.3;
    color: #1a1a1a;
}

.ecf-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.ecf-col {
    flex: 1;
    min-width: 200px;
}

.ecf-full {
    width: 100%;
}

.ecf-field-group {
    margin-bottom: 20px;
}

.ecf-label {
    display: block;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.ecf-required {
    color: #e8733a;
    margin-left: 2px;
}

/* --- INPUT BASE --- */
.ecf-field {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 18px;
    font-size: 15px;
    font-family: inherit;
    background-color: #f0f0f0;
    border: 0px solid transparent;
    border-radius: 12px;
    color: #333;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.ecf-field::placeholder {
    color: #aaa;
}

.ecf-field:focus {
    background-color: #e8e8e8;
}

.ecf-textarea {
    min-height: 160px;
    resize: vertical;
}

/* --- PRIVACY --- */
.ecf-privacy-group {
    margin-top: 8px;
    margin-bottom: 24px;
}

.ecf-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

.ecf-checkbox-label input[type="checkbox"] {
    display: none;
}

.ecf-checkmark {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid #ccc;
    border-radius: 4px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    transition: all 0.2s;
}

.ecf-checkbox-label input:checked + .ecf-checkmark {
    background-color: #e8733a;
    border-color: #e8733a;
}

.ecf-checkbox-label input:checked + .ecf-checkmark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
    display: block;
}

.ecf-privacy-text a {
    color: #e8733a;
    text-decoration: underline;
}

/* --- BOTTONE --- */
.ecf-submit-wrapper {
    margin-top: 4px;
}

.ecf-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #e8733a;
    color: #fff;
    border: none;
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    text-decoration: none;
}

.ecf-submit-btn:hover {
    background-color: #d4622b;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(232, 115, 58, 0.35);
}

.ecf-submit-btn:active {
    transform: translateY(0);
}

.ecf-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* --- MESSAGGI --- */
.ecf-success-message {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 15px;
}

.ecf-error-messages {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 14px;
}

.ecf-error-messages ul {
    margin: 0;
    padding-left: 18px;
}

.ecf-field.ecf-field-error {
    border: 2px solid #e53935 !important;
    background-color: #fff5f5 !important;
}

/* =============================================
   PRESET: MODERN (default)
============================================= */
.ecf-preset-modern .ecf-field {
    background-color: #f0f0f0;
    border: none;
    border-radius: 12px;
}
.ecf-preset-modern .ecf-field:focus {
    background-color: #e8e8e8;
    box-shadow: 0 0 0 3px rgba(232, 115, 58, 0.2);
}

/* =============================================
   PRESET: MINIMAL
============================================= */
.ecf-preset-minimal .ecf-field {
    background-color: #ffffff;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 16px;
}
.ecf-preset-minimal .ecf-field:focus {
    border-color: #e8733a;
    box-shadow: none;
    background: #fff;
}
.ecf-preset-minimal .ecf-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
    font-weight: 600;
}
.ecf-preset-minimal .ecf-submit-btn {
    border-radius: 6px;
}

/* =============================================
   PRESET: BOLD
============================================= */
.ecf-preset-bold .ecf-form-wrapper,
.ecf-preset-bold.ecf-form-wrapper {
    background: #fff;
    border: 2px solid #1a1a1a;
    border-radius: 0;
    box-shadow: 6px 6px 0 #1a1a1a;
}
.ecf-preset-bold .ecf-field {
    background-color: #fff;
    border: 2px solid #1a1a1a;
    border-radius: 0;
    font-weight: 500;
}
.ecf-preset-bold .ecf-field:focus {
    box-shadow: 4px 4px 0 #e8733a;
    border-color: #e8733a;
    background: #fff;
}
.ecf-preset-bold .ecf-label {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.04em;
}
.ecf-preset-bold .ecf-submit-btn {
    border-radius: 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 4px 4px 0 #1a1a1a;
    transition: box-shadow 0.1s, transform 0.1s;
}
.ecf-preset-bold .ecf-submit-btn:hover {
    box-shadow: 2px 2px 0 #1a1a1a;
    transform: translate(2px, 2px);
}
.ecf-preset-bold .ecf-checkmark {
    border-radius: 0;
    border: 2px solid #1a1a1a;
}
.ecf-preset-bold .ecf-title {
    font-size: 2em;
    font-weight: 900;
    text-transform: uppercase;
}

/* =============================================
   PRESET: GLASS
============================================= */
.ecf-preset-glass.ecf-form-wrapper,
.ecf-preset-glass .ecf-form-wrapper {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.ecf-preset-glass .ecf-field {
    background-color: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    color: #1a1a1a;
    backdrop-filter: blur(4px);
}
.ecf-preset-glass .ecf-field:focus {
    background-color: rgba(255, 255, 255, 0.4);
    border-color: #e8733a;
    box-shadow: 0 0 0 3px rgba(232, 115, 58, 0.2);
}
.ecf-preset-glass .ecf-label {
    color: #1a1a1a;
    font-weight: 600;
}
.ecf-preset-glass .ecf-title {
    color: #1a1a1a;
}
.ecf-preset-glass .ecf-submit-btn {
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 16px rgba(232, 115, 58, 0.4);
}
.ecf-preset-glass .ecf-checkmark {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.6);
}

/* =============================================
   PRESET: DARK
============================================= */
.ecf-preset-dark.ecf-form-wrapper,
.ecf-preset-dark .ecf-form-wrapper {
    background: #1a1a2e;
    border-radius: 16px;
}
.ecf-preset-dark .ecf-title {
    color: #ffffff;
}
.ecf-preset-dark .ecf-label {
    color: #b0b0c0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ecf-preset-dark .ecf-field {
    background-color: #16213e;
    border: 1px solid #0f3460;
    border-radius: 10px;
    color: #e0e0e0;
}
.ecf-preset-dark .ecf-field::placeholder {
    color: #555577;
}
.ecf-preset-dark .ecf-field:focus {
    background-color: #0f3460;
    border-color: #e8733a;
    box-shadow: 0 0 0 3px rgba(232, 115, 58, 0.2);
}
.ecf-preset-dark .ecf-privacy-text {
    color: #b0b0c0;
}
.ecf-preset-dark .ecf-checkmark {
    background: #16213e;
    border-color: #0f3460;
}
.ecf-preset-dark .ecf-success-message {
    background: #1b3a2b;
    color: #69f0ae;
    border-color: #2e7d52;
}
.ecf-preset-dark .ecf-error-messages {
    background: #3a1b1b;
    color: #ff8a80;
    border-color: #7d2e2e;
}

/* Campo readonly (offerta pre-compilata) */
.ecf-field-readonly {
    cursor: default;
    opacity: 0.75;
    background-color: #e8e8e8 !important;
}

.ecf-preset-dark .ecf-field-readonly {
    background-color: #0a1a30 !important;
}

/* --- RESPONSIVE --- */
@media (max-width: 767px) {
    .ecf-form-wrapper {
        padding: 24px 20px;
    }

    .ecf-row {
        flex-direction: column;
        gap: 0;
    }

    .ecf-col {
        min-width: 100%;
    }

    .ecf-title {
        font-size: 1.3em;
    }

    .ecf-submit-btn {
        width: 100%;
        justify-content: center;
    }
}
