/* ═══════════════════════════════════════════════
   MODALE LOGIN/REGISTRAZIONE
   ═══════════════════════════════════════════════ */
.malghe-auth-modal { position: fixed; inset: 0; z-index: 9900; display: none; }
.malghe-auth-modal.is-open { display: block; }
.malghe-auth-modal__backdrop { position: absolute; inset: 0; background: rgba(20,18,15,.55); }

.malghe-auth-modal__sheet {
    position: relative; margin: 6vh auto; max-width: 420px;
    background: var(--malghe-cream,#F5F0E8); border-radius: 16px;
    padding: 28px 26px max(28px, env(safe-area-inset-bottom));
    max-height: 88vh; overflow-y: auto;
}
@media (max-width: 600px) {
    .malghe-auth-modal__sheet {
        margin: auto 0 0; max-width: 100%; border-radius: 20px 20px 0 0;
        max-height: 92vh;
    }
    .malghe-auth-modal__handle {
        display: block; width: 40px; height: 4px; border-radius: 999px;
        background: var(--malghe-border,#D9D2C7); margin: 0 auto 16px;
    }
}
.malghe-auth-modal__handle { display: none; }

.malghe-auth-modal__close {
    position: absolute; top: 16px; right: 16px; cursor: pointer;
    width: 32px; height: 32px; border-radius: 50%; background: #fff;
    display: flex; align-items: center; justify-content: center; color: var(--malghe-text,#1A1A1A);
}

.malghe-auth-modal__titolo {
    font-size: 1.3rem; font-weight: 900; color: var(--malghe-green,#005F56);
    text-align: center; margin-bottom: 6px; padding-right: 30px;
}
.malghe-auth-modal__sottotitolo {
    font-size: .86rem; color: var(--malghe-muted,#6B6356); text-align: center;
    margin-bottom: 20px; line-height: 1.5;
}

.malghe-auth-modal__tabs { display: flex; gap: 22px; justify-content: center; margin-bottom: 20px; }
.malghe-auth-modal__tab {
    font-size: .92rem; font-weight: 700; color: var(--malghe-muted,#6B6356);
    padding-bottom: 8px; border-bottom: 2px solid transparent; cursor: pointer;
}
.malghe-auth-modal__tab.is-active { color: var(--malghe-green,#005F56); border-bottom-color: var(--malghe-green,#005F56); }

.malghe-auth-modal__separatore {
    display: flex; align-items: center; gap: 12px; margin: 18px 0;
    font-size: .78rem; color: var(--malghe-muted,#6B6356);
}
.malghe-auth-modal__separatore::before,
.malghe-auth-modal__separatore::after { content: ''; flex: 1; height: 1px; background: var(--malghe-border,#D9D2C7); }

.malghe-auth-modal__msg {
    background: #fdecea; color: #c0392b; border-radius: 10px;
    padding: 10px 14px; font-size: .84rem; margin-bottom: 14px;
}
.malghe-auth-modal__msg.is-ok { background: var(--malghe-green-pale,#E8F4F2); color: var(--malghe-green,#005F56); }

.malghe-auth-modal__pane { display: flex; flex-direction: column; gap: 14px; }
.malghe-auth-modal__field { display: flex; flex-direction: column; gap: 6px; }
.malghe-auth-modal__field label { font-size: .8rem; font-weight: 700; color: var(--malghe-text,#1A1A1A); }
.malghe-auth-modal__field input {
    background: #F7FBFA; border: 1.5px solid transparent; border-radius: 12px;
    padding: .75rem 1rem; font: inherit; font-size: .92rem; outline: none;
    transition: border-color .15s;
}
.malghe-auth-modal__field input:focus { border-color: var(--malghe-green,#005F56); }

.malghe-auth-modal__submit {
    display: flex; align-items: center; justify-content: center;
    background: var(--malghe-green,#005F56); color: #fff;
    border-radius: 999px; padding: .85rem; margin-top: 6px;
    font-size: .92rem; font-weight: 700; cursor: pointer; text-align: center;
}
.malghe-auth-modal__submit[aria-disabled="true"] { opacity: .6; pointer-events: none; }

/* ═══════════════════════════════════════════════
   PULSANTE ACCOUNT — per header/Elementor, via
   shortcode [malghe_account_button]
   ═══════════════════════════════════════════════ */
.malghe-account-btn {
    position: relative; display: inline-flex; align-items: center; gap: 8px;
    cursor: pointer; font-size: .88rem; font-weight: 700;
}
.malghe-account-btn--guest {
    background: var(--malghe-green,#005F56); color: #fff;
    border-radius: 999px; padding: 9px 18px;
}
.malghe-account-btn--user { color: var(--malghe-text,#1A1A1A); padding: 4px; }
.malghe-account-btn__avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.malghe-account-btn__caret { font-size: .7rem; color: var(--malghe-muted,#6B6356); transition: transform .15s; }
.malghe-account-btn--user.is-open .malghe-account-btn__caret { transform: rotate(180deg); }

.malghe-account-dropdown {
    display: none; position: absolute; top: calc(100% + 10px); right: 0; z-index: 500;
    background: #fff; border-radius: 14px; box-shadow: 0 8px 28px rgba(0,0,0,.16);
    min-width: 190px; padding: 8px; flex-direction: column; gap: 2px;
}
.malghe-account-btn--user.is-open .malghe-account-dropdown { display: flex; }
.malghe-account-dropdown__item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px; font-size: .86rem; font-weight: 600;
    color: var(--malghe-text,#1A1A1A); text-decoration: none; cursor: pointer;
}
.malghe-account-dropdown__item:hover { background: var(--malghe-cream,#F5F0E8); }
.malghe-account-dropdown__item i { width: 16px; color: var(--malghe-muted,#6B6356); }
.malghe-account-dropdown__item--danger { color: #c0392b; }
.malghe-account-dropdown__item--danger i { color: #c0392b; }

/* ═══════════════════════════════════════════════
   "ESCI" in fondo alla dashboard profilo
   ═══════════════════════════════════════════════ */
.profilo-logout-row { text-align: center; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--malghe-border-lt,#EAE5DC); }
.profilo-logout-link {
    display: inline-flex; align-items: center; gap: 8px;
    color: #c0392b; font-size: .86rem; font-weight: 700; cursor: pointer;
}

/* ═══════════════════════════════════════════════
   MENU ACCOUNT "A VOCI DISTESE" — per il menu mobile
   di Elementor: [malghe_account_menu]
   ═══════════════════════════════════════════════ */
.malghe-account-menu { display: flex; flex-direction: column; gap: 2px; }
.malghe-account-menu__accedi {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--malghe-green,#005F56); color: #fff;
    border-radius: 999px; padding: 12px 18px; font-size: .95rem; font-weight: 700; cursor: pointer;
}
.malghe-account-menu__item,
.malghe-account-menu__item:link,
.malghe-account-menu__item:visited {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 4px; font-size: 1rem; font-weight: 600;
    color: #fff !important; text-decoration: none; cursor: pointer;
}
.malghe-account-menu__item i { width: 18px; color: #fff !important; }
.malghe-account-menu__item--danger,
.malghe-account-menu__item--danger:link,
.malghe-account-menu__item--danger:visited,
.malghe-account-menu__item--danger i { color: #ff8a80 !important; } /* rosso chiaro, leggibile su verde scuro */
