/* ===== Wrapper principale ===== */
.editaz-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin: 10px 0 40px;
    padding: 0 10px;
    box-sizing: border-box;
}

.editaz-card {
    width: 100%;
    max-width: 760px;
    background: #ffffff;
    border-radius: 18px;
    padding: 22px 20px 24px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.5);
    border: 1px solid #e5e7eb;
    box-sizing: border-box;
}

/* ===== Header card ===== */
.editaz-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.editaz-header-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(21, 101, 192, 0.45);
}

.editaz-header-text {
    flex: 1;
}

.editaz-title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.editaz-subtitle {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

/* ===== Profilo (in alto a destra) ===== */
.profile-menu-container-editaz {
    margin-bottom: 20px;
    text-align: right;
}

.profile-menu-trigger-editaz {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 600;
    color: #1f2933;
    padding: 7px 13px;
    border-radius: 999px;
    background-color: #ffffff;
    border: 1px solid #d6e0f5;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.06);
    transition: background-color 0.25s ease, box-shadow 0.25s ease, transform 0.1s ease, color 0.2s ease;
    position: relative;
}

.profile-menu-trigger-editaz:hover {
    background-color: #f1f5ff;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
    color: #111827;
}

.editaz-profile-icon {
    font-size: 18px;
}

.editaz-profile-label {
    font-size: 14px;
}

.editaz-profile-arrow {
    font-size: 11px;
    opacity: 0.8;
}

.profile-menu-dropdown-editaz {
    display: none;
    position: absolute;
    top: 36px;
    right: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    min-width: 190px;
    z-index: 100;
}

.profile-menu-dropdown-editaz.visible {
    display: block !important;
}

.profile-menu-dropdown-editaz li {
    padding: 8px 16px;
}

.profile-menu-dropdown-editaz li:hover {
    background-color: #f3f4ff;
}

.profile-menu-dropdown-editaz a {
    text-decoration: none;
    color: #1f2933;
    display: block;
    font-size: 14px;
}

.profile-menu-dropdown-editaz a:hover {
    color: #111827;
}

/* readonly */
input[readonly], select[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
    border-color: #ddd;
}

/* ===== Form layout ===== */
.editaz-form {
    margin-top: 6px;
}

.editaz-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 640px) {
    .editaz-row {
        grid-template-columns: 1fr;
    }
}

.form-group-editaz {
    margin-bottom: 18px;
}

.form-group-editaz label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #111827;
}

/* Icona vicino alle label */
.editaz-label-icon {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #e3f2fd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.help-text-editaz {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: #e90514;
}

.help-subtext-editaz {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
    }

input[type="text"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    box-sizing: border-box;
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #1e88e5;
    box-shadow: 0 0 0 1px rgba(30,136,229,0.28);
    background-color: #f9fafb;
}

textarea {
    height: 110px;
    resize: vertical;
}

/* Bottone submit principale */
.button.button-primary.editaz-submit {
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    color: #ffffff;
    border: none;
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 999px;
    cursor: pointer;
    width: 100%;
    transition: background 0.25s ease, transform 0.08s ease, box-shadow 0.25s ease;
    box-sizing: border-box;
    box-shadow: 0 10px 24px rgba(30, 136, 229, 0.40);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.button.button-primary.editaz-submit:hover {
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(30, 136, 229, 0.55);
}

.editaz-submit-icon {
    font-size: 18px;
}

/* Bottone base (usato anche nel popup) */
.button.button-primary {
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    font-size: 15px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(30, 136, 229, 0.35);
    transition: background 0.25s ease, transform 0.08s ease, box-shadow 0.25s ease;
}

.button.button-primary:hover {
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    box-shadow: 0 12px 26px rgba(30, 136, 229, 0.50);
    transform: translateY(-1px);
}

/* Popup overlay con fade */
.popup-overlay-editaz {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s ease, visibility .25s ease;
}

.popup-overlay-editaz.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.popup-content-editaz {
    background: #ffffff;
    padding: 20px 22px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.30);
    max-width: 420px;
    width: 90%;
}

.popup-content-editaz p {
    margin-bottom: 8px;
    font-size: 15px;
    color: #111827;
}

.char-counter {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-top: 4px;
}

.error-message {
    color: red;
    font-size: 0.8em;
}

#logo-img-preview {
    max-width: 200px;
    max-height: 200px;
    margin: 10px 0;
}

#altro-settore-wrapper {
    margin-top: 10px;
    display: none;
}

/* Evita blocco puntatore SOLO sul campo "Altro" quando visibile */
#altro-settore-wrapper #altro_settore {
    pointer-events: auto !important;
    cursor: text !important;
}

select:required:invalid { color: #666; }
option[value=""][disabled] { display: none; }
option { color: #000; }

/* ===== Comuni multipli (azienda) ===== */
.toggle-dropdown-editaz {
    background-color: #e3f2fd;
    border: 1px solid #90caf9;
    padding: 11px 12px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    margin-top: 6px;
    margin-bottom: 10px;
    font-weight: 600;
    border-radius: 999px;
    color: #1565c0;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
}

.toggle-dropdown-editaz::after {
    content: '▾';
    font-size: 13px;
    opacity: 0.9;
}

.toggle-dropdown-editaz:hover {
    background-color: #bbdefb;
    color: #1e88e5;
}

.checkbox-container-editaz {
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    max-height: 260px;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 12px;
    box-sizing: border-box;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    display: none;
}

.checkbox-container-editaz.is-open {
    display: block !important;
}

.checkbox-label-editaz {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 14px;
    color: #111827;
}

.checkbox-label-editaz input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.divider-editaz {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 8px 0 10px;
}

/* Cursor sempre mano su checkbox, label, opzioni, container */
.checkbox-container-editaz,
.checkbox-container-editaz * {
    cursor: pointer !important;
}

select,
select option {
    cursor: pointer !important;
}

button,
.toggle-dropdown-editaz {
    cursor: pointer !important;
}

label {
    cursor: pointer !important;
}

@media (max-width: 600px) {
    .toggle-dropdown-editaz {
        font-size: 16px;
        padding: 10px 12px;
    }
    .checkbox-label-editaz {
        font-size: 14px;
    }
    .editaz-card {
        padding: 18px 16px 22px;
    }
    .editaz-title {
        font-size: 18px;
    }
}

/* Bottone popup più largo (solo per il pulsante Chiudi) */
#close-popup-editaz {
    padding-left: 32px;
    padding-right: 32px;
    min-width: 220px;
    display: inline-block;
    text-align: center;
}
/* === LOGO SOPRA AL BOTTONE, CENTRATO === */
.logo-preview-editaz {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 6px 0 12px;
}

.logo-preview-editaz img#logo-img-preview {
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
    display: block;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}


/* === BOTTONE "CARICA NUOVO LOGO" === */
.cambia-logo-btn-editaz {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    border-radius: 999px;
    padding: 10px 18px;
    background: #1e88e5;
    border: 1px solid #d1d5db;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.45s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.1s ease;
}

/* === HOVER BOTTONE === */
.cambia-logo-btn-editaz:hover {
    background: #1565c0;
    border-color: #1e88e5;
    color: #d6e0f5;
    box-shadow: 0 10px 24px rgba(211, 24, 16, 0.25);
}

/* === CLICK (ACTIVE) === */
.cambia-logo-btn-editaz:active {
    transform: scale(0.97);
}
