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

.editpers-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 ===== */
.editpers-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.editpers-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);
}

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

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

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

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

.profile-menu-trigger-editpers {
    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-editpers:hover {
    background-color: #f1f5ff;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
    color: #111827;
}

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

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

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

.profile-menu-dropdown-editpers {
    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-editpers.visible {
    display: block !important;
}

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

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

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

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

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

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

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

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

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

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

/* testo di aiuto */
.help-text-editpers {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: #e90514;
}

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

input[type="text"],
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,
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 principale submit */
.button.button-primary.editpers-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.editpers-submit:hover {
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(30, 136, 229, 0.55);
}

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

/* anche il bottone del popup usa lo stesso stile base */
.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);
}

/* ===== Comuni Dropdown ===== */
.toggle-dropdown-editpers {
    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-editpers::after {
    content: '▾';
    font-size: 13px;
    opacity: 0.9;
}

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

/* Contenitore checkbox comuni */
.checkbox-container-editpers {
    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);
}

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

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

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

/* Responsive generale */
@media (max-width: 600px) {
    input[type="text"],
    select,
    textarea,
    .button.button-primary,
    .toggle-dropdown-editpers {
        font-size: 16px;
        padding: 10px 12px;
    }

    .checkbox-label-editpers {
        font-size: 14px;
    }

    .form-group-editpers {
        margin-bottom: 14px;
    }

    .profile-menu-container-editpers {
        text-align: center;
    }

    .editpers-card {
        padding: 18px 16px 22px;
    }

    .editpers-title {
        font-size: 18px;
    }
}

/* ===== Fade-in / Fade-out popup (persona) ===== */
.popup-overlay {
  display: flex;                /* già centrato con flex */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s ease, visibility .25s ease;
}

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

/* ===== Fade-in / Fade-out popup (azienda) (riutilizzato) ===== */
.popup-overlay-editaz {
  display: flex;                /* già centrato con flex */
  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;
}

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

/* Anche per le opzioni della select */
select,
select option {
    cursor: pointer !important;
}

/* Per i bottoni */
button,
.toggle-dropdown-editpers {
    cursor: pointer !important;
}

/* Per tutte le label */
label {
    cursor: pointer !important;
}
