/* ===================================================================
   AREA RISERVATA · MODERN DESIGN
   Caricato per ultimo: sovrascrive le regole degli altri stylesheet.
   Variabili centralizzate, layout a card, micro-interazioni leggere.
   =================================================================== */

:root {
    --ar-brand: #2f7d4f;          /* verde principale tema */
    --ar-brand-dark: #245f3c;
    --ar-brand-soft: #e6f4eb;
    --ar-accent: #d4b73c;          /* giallo accent */
    --ar-text: #1f2933;
    --ar-text-muted: #6b7280;
    --ar-text-soft: #9ca3af;
    --ar-border: #e5e7eb;
    --ar-border-strong: #d1d5db;
    --ar-bg: #f7f8f9;
    --ar-surface: #ffffff;
    --ar-surface-alt: #fafbfc;
    --ar-danger: #d04545;
    --ar-success: #2f9a5b;
    --ar-radius-sm: 8px;
    --ar-radius: 12px;
    --ar-radius-lg: 16px;
    --ar-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --ar-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
    --ar-shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.10);
    --ar-ring: 0 0 0 4px rgba(47, 125, 79, 0.15);
    --ar-transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* -------------------------------------------------------------------
   CONTAINER FORM
   ------------------------------------------------------------------- */
.scheda-catalogo-form {
    max-width: 920px;
    margin: 0 auto;
    padding: 32px 16px 64px;
    color: var(--ar-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    background: transparent;
}

.scheda-catalogo-form .form-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
    color: var(--ar-text);
}

.scheda-catalogo-form .form-required-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    margin: 0 0 24px;
    background: #fff5e8;
    color: #b75d0a;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}
.scheda-catalogo-form .form-required-note strong {
    font-weight: 700;
}

/* -------------------------------------------------------------------
   SEZIONI / CARD
   ------------------------------------------------------------------- */
.scheda-catalogo-form .form-section {
    background: var(--ar-surface);
    border: 1px solid var(--ar-border);
    border-left: 1px solid var(--ar-border);
    border-radius: var(--ar-radius-lg);
    padding: 28px 28px 24px;
    margin-bottom: 20px;
    box-shadow: var(--ar-shadow-sm);
    transition: box-shadow var(--ar-transition);
}
.scheda-catalogo-form .form-section:hover {
    box-shadow: var(--ar-shadow);
}

.scheda-catalogo-form .section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--ar-text);
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ar-border);
    letter-spacing: -0.01em;
}
.scheda-catalogo-form .section-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 20px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--ar-brand) 0%, var(--ar-accent) 100%);
    box-shadow: none;
}
.scheda-catalogo-form .section-title small {
    font-size: 13px;
    font-weight: 500;
    color: var(--ar-text-muted);
}

/* -------------------------------------------------------------------
   FORM ROW / GROUP / LABEL
   ------------------------------------------------------------------- */
.scheda-catalogo-form .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}
.scheda-catalogo-form .form-row:last-child {
    margin-bottom: 0;
}

.scheda-catalogo-form .form-group {
    display: flex;
    flex-direction: column;
    flex: 1 1 100%;
    min-width: 0;
}
.scheda-catalogo-form .form-group.full-width { flex: 1 1 100%; }
.scheda-catalogo-form .form-group.half-width { flex: 1 1 calc(50% - 8px); }
.scheda-catalogo-form .form-group.third-width { flex: 1 1 calc(33.333% - 11px); }

.scheda-catalogo-form .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--ar-text);
    margin-bottom: 8px;
    line-height: 1.4;
}
.scheda-catalogo-form .form-group label small {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    font-weight: 400;
    color: var(--ar-text-muted);
    line-height: 1.4;
}

/* -------------------------------------------------------------------
   INPUT / SELECT / TEXTAREA
   ------------------------------------------------------------------- */
.scheda-catalogo-form input[type="text"],
.scheda-catalogo-form input[type="email"],
.scheda-catalogo-form input[type="url"],
.scheda-catalogo-form input[type="tel"],
.scheda-catalogo-form input[type="number"],
.scheda-catalogo-form input[type="date"],
.scheda-catalogo-form select,
.scheda-catalogo-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    font: inherit;
    font-size: 15px;
    color: var(--ar-text);
    background: var(--ar-surface);
    border: 1.5px solid var(--ar-border);
    border-radius: var(--ar-radius-sm);
    outline: none;
    transition: border-color var(--ar-transition), box-shadow var(--ar-transition), background-color var(--ar-transition);
    -webkit-appearance: none;
    appearance: none;
}

.scheda-catalogo-form input::placeholder,
.scheda-catalogo-form textarea::placeholder {
    color: var(--ar-text-soft);
}

.scheda-catalogo-form input:hover,
.scheda-catalogo-form select:hover,
.scheda-catalogo-form textarea:hover {
    border-color: var(--ar-border-strong);
}

.scheda-catalogo-form input:focus,
.scheda-catalogo-form select:focus,
.scheda-catalogo-form textarea:focus {
    border-color: var(--ar-brand);
    box-shadow: var(--ar-ring);
}

.scheda-catalogo-form input:disabled {
    background: var(--ar-bg);
    color: var(--ar-text-soft);
    cursor: not-allowed;
}

/* Custom chevron per select */
.scheda-catalogo-form select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
    cursor: pointer;
}

/* -------------------------------------------------------------------
   EDITOR CONTENTEDITABLE + TOOLBAR (form pubblico + form admin)
   ------------------------------------------------------------------- */
.scheda-catalogo-form .ar-editor-toolbar,
.scheda-edit-form .ar-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 6px;
    background: var(--ar-surface-alt);
    border: 1.5px solid var(--ar-border);
    border-bottom: none;
    border-radius: var(--ar-radius-sm) var(--ar-radius-sm) 0 0;
}
.scheda-catalogo-form .ar-editor-toolbar button,
.scheda-edit-form .ar-editor-toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 30px;
    padding: 0 10px;
    background: transparent;
    color: var(--ar-text);
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--ar-transition);
    line-height: 1;
}
.scheda-catalogo-form .ar-editor-toolbar button:hover,
.scheda-edit-form .ar-editor-toolbar button:hover {
    background: var(--ar-surface);
    border-color: var(--ar-border);
    color: var(--ar-brand);
}
.scheda-catalogo-form .ar-editor-toolbar button:active,
.scheda-edit-form .ar-editor-toolbar button:active {
    background: var(--ar-brand-soft);
    color: var(--ar-brand-dark);
}

.scheda-catalogo-form .ar-editor-area,
.scheda-edit-form .ar-editor-area {
    min-height: 120px;
    max-height: 420px;
    overflow-y: auto;
    padding: 12px 14px;
    background: var(--ar-surface);
    border: 1.5px solid var(--ar-border);
    border-top: none;
    border-radius: 0 0 var(--ar-radius-sm) var(--ar-radius-sm);
    font: inherit;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ar-text);
    outline: none;
    transition: border-color var(--ar-transition), box-shadow var(--ar-transition);
}
.scheda-catalogo-form .ar-editor-area:focus,
.scheda-edit-form .ar-editor-area:focus {
    border-color: var(--ar-brand);
    box-shadow: var(--ar-ring);
}
.scheda-catalogo-form .ar-editor-area:empty::before,
.scheda-edit-form .ar-editor-area:empty::before {
    content: attr(data-placeholder);
    color: var(--ar-text-soft);
    pointer-events: none;
}
.scheda-catalogo-form .ar-editor-area p,
.scheda-edit-form .ar-editor-area p { margin: 0 0 10px; }
.scheda-catalogo-form .ar-editor-area p:last-child,
.scheda-edit-form .ar-editor-area p:last-child { margin-bottom: 0; }
.scheda-catalogo-form .ar-editor-area ul,
.scheda-catalogo-form .ar-editor-area ol,
.scheda-edit-form .ar-editor-area ul,
.scheda-edit-form .ar-editor-area ol { margin: 0 0 10px 22px; padding: 0; }
.scheda-catalogo-form .ar-editor-area a,
.scheda-edit-form .ar-editor-area a { color: var(--ar-brand); text-decoration: underline; }
.scheda-catalogo-form .ar-editor-area strong,
.scheda-edit-form .ar-editor-area strong { font-weight: 700; }

/* -------------------------------------------------------------------
   CHAR COUNTER
   ------------------------------------------------------------------- */
.scheda-catalogo-form .char-counter {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--ar-text-soft);
    text-align: right;
}
.scheda-catalogo-form .char-counter .current { font-weight: 600; color: var(--ar-text-muted); }

/* -------------------------------------------------------------------
   FORM HELP TEXT
   ------------------------------------------------------------------- */
.scheda-catalogo-form .form-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--ar-text-muted);
    line-height: 1.5;
}

/* -------------------------------------------------------------------
   FILE UPLOAD (custom)
   ------------------------------------------------------------------- */
.scheda-catalogo-form input[type="file"] {
    display: block;
    width: 100%;
    padding: 18px;
    background: var(--ar-surface-alt);
    border: 1.5px dashed var(--ar-border-strong);
    border-radius: var(--ar-radius-sm);
    color: var(--ar-text-muted);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--ar-transition);
}
.scheda-catalogo-form input[type="file"]:hover {
    border-color: var(--ar-brand);
    background: var(--ar-brand-soft);
    color: var(--ar-brand-dark);
}
.scheda-catalogo-form input[type="file"]::-webkit-file-upload-button {
    margin-right: 14px;
    padding: 8px 16px;
    background: var(--ar-surface);
    border: 1px solid var(--ar-border-strong);
    border-radius: 6px;
    color: var(--ar-text);
    font: inherit;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--ar-transition);
}
.scheda-catalogo-form input[type="file"]::-webkit-file-upload-button:hover {
    background: var(--ar-brand);
    color: #fff;
    border-color: var(--ar-brand);
}

/* Anteprima immagine principale già caricata */
.scheda-catalogo-form .immagine-principale-preview img {
    max-width: 320px !important;
    border-radius: var(--ar-radius-sm) !important;
    box-shadow: var(--ar-shadow);
}

/* -------------------------------------------------------------------
   FOTO PREVIEW GRID
   ------------------------------------------------------------------- */
.scheda-catalogo-form .foto-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 14px;
}
.scheda-catalogo-form .foto-preview-item {
    position: relative;
    border-radius: var(--ar-radius-sm);
    overflow: hidden;
    background: var(--ar-bg);
    box-shadow: var(--ar-shadow-sm);
    transition: transform var(--ar-transition), box-shadow var(--ar-transition);
}
.scheda-catalogo-form .foto-preview-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--ar-shadow);
}
.scheda-catalogo-form .foto-preview-item img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    display: block;
}
.scheda-catalogo-form .foto-preview-item .foto-name {
    display: block;
    padding: 6px 8px;
    font-size: 11px;
    color: var(--ar-text-muted);
    background: var(--ar-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -------------------------------------------------------------------
   SOCIAL LINKS GRID
   ------------------------------------------------------------------- */
.scheda-catalogo-form .social-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}
.scheda-catalogo-form .social-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 4px 4px 12px;
    background: var(--ar-surface-alt);
    border: 1.5px solid var(--ar-border);
    border-radius: var(--ar-radius-sm);
    transition: all var(--ar-transition);
}
.scheda-catalogo-form .social-link-item:focus-within {
    border-color: var(--ar-brand);
    box-shadow: var(--ar-ring);
}
.scheda-catalogo-form .social-link-item .social-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ar-surface);
    border-radius: 6px;
    color: var(--ar-text-muted);
    font-size: 16px;
}
.scheda-catalogo-form .social-link-item input {
    border: 0 !important;
    background: transparent !important;
    padding: 8px 0 !important;
    box-shadow: none !important;
}
.scheda-catalogo-form .social-link-item input:focus {
    box-shadow: none !important;
}

/* -------------------------------------------------------------------
   ALTRE SEDI / FILE ALLEGATI (righe ripetute)
   ------------------------------------------------------------------- */
.scheda-catalogo-form #altre-sedi-container,
.scheda-catalogo-form #file-allegati-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}
.scheda-catalogo-form .altra-sede-item,
.scheda-catalogo-form .file-allegato-item {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 14px;
    background: var(--ar-surface-alt);
    border: 1px solid var(--ar-border);
    border-radius: var(--ar-radius-sm);
}
.scheda-catalogo-form .altra-sede-item input,
.scheda-catalogo-form .file-allegato-item input {
    flex: 1 1 140px;
    background: var(--ar-surface);
}
.scheda-catalogo-form .file-allegato-item textarea {
    flex: 1 1 100%;
    min-height: 60px;
}

.scheda-catalogo-form .btn-remove-sede,
.scheda-catalogo-form .btn-remove-file {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--ar-border);
    border-radius: 6px;
    color: var(--ar-danger);
    font-size: 18px;
    cursor: pointer;
    transition: all var(--ar-transition);
    line-height: 1;
}
.scheda-catalogo-form .btn-remove-sede:hover,
.scheda-catalogo-form .btn-remove-file:hover {
    background: var(--ar-danger);
    color: #fff;
    border-color: var(--ar-danger);
}

.scheda-catalogo-form .btn-add-sede,
.scheda-catalogo-form .btn-add-file {
    align-self: flex-start;
    padding: 10px 16px;
    background: var(--ar-brand-soft);
    color: var(--ar-brand-dark);
    border: 1px solid transparent;
    border-radius: var(--ar-radius-sm);
    font: inherit;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--ar-transition);
}
.scheda-catalogo-form .btn-add-sede:hover,
.scheda-catalogo-form .btn-add-file:hover {
    background: var(--ar-brand);
    color: #fff;
}

.scheda-catalogo-form .no-sedi,
.scheda-catalogo-form .no-files {
    margin: 0 0 8px;
    padding: 16px;
    text-align: center;
    color: var(--ar-text-soft);
    font-size: 13px;
    font-style: italic;
    background: var(--ar-surface-alt);
    border-radius: var(--ar-radius-sm);
    border: 1px dashed var(--ar-border);
}

/* -------------------------------------------------------------------
   FORM ACTIONS (SUBMIT BUTTON)
   ------------------------------------------------------------------- */
.scheda-catalogo-form .form-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    margin-top: 28px;
    padding-top: 24px;
}

.scheda-catalogo-form .btn-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 220px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--ar-brand) 0%, var(--ar-brand-dark) 100%);
    color: #fff;
    border: 0;
    border-radius: var(--ar-radius);
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(47, 125, 79, 0.25);
    transition: all var(--ar-transition);
}
.scheda-catalogo-form .btn-save:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(47, 125, 79, 0.35);
}
.scheda-catalogo-form .btn-save:active:not(:disabled) {
    transform: translateY(0);
}
.scheda-catalogo-form .btn-save:disabled {
    background: var(--ar-text-soft);
    box-shadow: none;
    cursor: wait;
    opacity: 0.7;
}

/* -------------------------------------------------------------------
   FORM MESSAGE (errori inline)
   ------------------------------------------------------------------- */
.scheda-catalogo-form .form-message {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--ar-radius-sm);
    font-size: 14px;
    font-weight: 500;
    display: none;
}
.scheda-catalogo-form .form-message.error {
    display: block;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.scheda-catalogo-form .form-message.success {
    display: block;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* -------------------------------------------------------------------
   POPUP MODAL (override per coerenza con design)
   ------------------------------------------------------------------- */
/* Posizionamento: senza queste proprieta' il popup resta nel flusso della
   pagina e compare in fondo, sotto il footer. */
.ar-modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    /* Sopra header/footer del tema e sopra gli overlay di Elementor */
    z-index: 999999;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background: rgba(15, 23, 42, 0.5);
    /* Compare in dissolvenza quando lo script aggiunge .visible */
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}
.ar-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}
.ar-modal-box {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #fff;
    text-align: center;
    transform: translateY(12px) scale(.98);
    transition: transform .25s ease;
    border-radius: var(--ar-radius-lg);
    padding: 40px 36px 30px;
    box-shadow: var(--ar-shadow-lg);
}
.ar-modal-overlay.visible .ar-modal-box {
    transform: translateY(0) scale(1);
}
.ar-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    background: linear-gradient(135deg, var(--ar-brand) 0%, var(--ar-brand-dark) 100%);
    box-shadow: 0 8px 24px rgba(47, 125, 79, 0.4);
}
.ar-modal-message {
    color: var(--ar-text);
    font-size: 15px;
    line-height: 1.6;
}
.ar-modal-close-btn {
    display: inline-block;
    margin-top: 24px;
    border: none;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--ar-brand) 0%, var(--ar-brand-dark) 100%);
    padding: 12px 32px;
    border-radius: var(--ar-radius);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(47, 125, 79, 0.3);
    transition: transform .15s ease, box-shadow .15s ease;
}
.ar-modal-close-btn:hover { transform: translateY(-1px); }

/* -------------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------------- */
@media (max-width: 720px) {
    .scheda-catalogo-form {
        padding: 20px 12px 48px;
    }
    .scheda-catalogo-form .form-title {
        font-size: 26px;
    }
    .scheda-catalogo-form .form-section {
        padding: 20px 18px;
        border-radius: var(--ar-radius);
    }
    .scheda-catalogo-form .form-group.half-width,
    .scheda-catalogo-form .form-group.third-width {
        flex: 1 1 100%;
    }
    .scheda-catalogo-form .btn-save {
        width: 100%;
        min-width: 0;
    }
}

/* ===================================================================
   ADMIN · Pannello modifica scheda (form-edit-scheda)
   =================================================================== */

.btn-sospendi {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 8px 14px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: var(--ar-radius-sm);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--ar-transition);
}
.btn-sospendi:hover {
    background: #fcd34d;
    color: #78350f;
}
.btn-sospendi:disabled {
    opacity: 0.6;
    cursor: wait;
}

.pubblicato-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--ar-brand-soft);
    color: var(--ar-brand-dark);
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
}

/* Gestione foto galleria admin */
.admin-foto-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.admin-foto-item {
    position: relative;
    border-radius: var(--ar-radius-sm);
    overflow: hidden;
    background: var(--ar-bg);
    box-shadow: var(--ar-shadow-sm);
    transition: all var(--ar-transition);
    aspect-ratio: 4 / 3;
}
.admin-foto-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--ar-shadow);
}
.admin-foto-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.btn-foto-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.75);
    color: #fff;
    border: 0;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.85);
    transition: all var(--ar-transition);
    backdrop-filter: blur(4px);
}
.admin-foto-item:hover .btn-foto-delete {
    opacity: 1;
    transform: scale(1);
}
.btn-foto-delete:hover {
    background: var(--ar-danger);
    color: #fff;
}

/* Anteprima immagine principale / foto staff con checkbox rimuovi */
.admin-media-current {
    margin-bottom: 14px;
    padding: 12px;
    background: var(--ar-surface-alt);
    border: 1px solid var(--ar-border);
    border-radius: var(--ar-radius-sm);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}
.admin-media-thumb-large {
    max-width: 320px;
    max-height: 220px;
    width: auto;
    height: auto;
    border-radius: var(--ar-radius-sm);
    box-shadow: var(--ar-shadow-sm);
}
.admin-delete-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #fef2f2;
    color: #991b1b;
    border-radius: var(--ar-radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #fecaca;
    transition: all var(--ar-transition);
}
.admin-delete-checkbox:hover {
    background: #fee2e2;
}
.admin-delete-checkbox input[type="checkbox"] {
    margin: 0;
    accent-color: var(--ar-danger);
}

.admin-no-media {
    margin: 0 0 12px;
    padding: 14px;
    text-align: center;
    color: var(--ar-text-soft);
    font-size: 13px;
    font-style: italic;
    background: var(--ar-surface-alt);
    border-radius: var(--ar-radius-sm);
    border: 1px dashed var(--ar-border);
}

.admin-video-embed {
    border-radius: var(--ar-radius-sm);
    overflow: hidden;
    box-shadow: var(--ar-shadow-sm);
}
.admin-video-embed iframe {
    display: block;
    border: 0;
    width: 100%;
}

/* ===================================================================
   ADMIN · FORM EDIT SCHEDA (look identico al form Iscrivimi)
   =================================================================== */

.scheda-edit-form {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 64px;
    color: var(--ar-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    background: transparent;
}

/* Header: titolo scheda (denominazione) + azioni stato (Pubblica/Sospendi) */
.scheda-edit-form .scheda-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 28px;
    margin-bottom: 20px;
    background: var(--ar-surface);
    border: 1px solid var(--ar-border);
    border-radius: var(--ar-radius-lg);
    box-shadow: var(--ar-shadow-sm);
}

.scheda-edit-form .scheda-header h2 {
    flex: 1 1 320px;
    margin: 0;
    min-width: 0;
}

.scheda-edit-form .input-denominazione {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    font-size: 22px;
    font-weight: 700;
    color: var(--ar-text);
    background: var(--ar-surface-alt);
    border: 1.5px solid var(--ar-border);
    border-radius: var(--ar-radius-sm);
    outline: none;
    letter-spacing: -0.01em;
    transition: border-color var(--ar-transition), box-shadow var(--ar-transition);
}
.scheda-edit-form .input-denominazione:focus {
    border-color: var(--ar-brand);
    box-shadow: var(--ar-ring);
    background: var(--ar-surface);
}

.scheda-edit-form .scheda-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.scheda-edit-form .stato-corrente {
    font-size: 13px;
    color: var(--ar-text-muted);
}
.scheda-edit-form .stato-corrente strong {
    color: var(--ar-text);
    font-weight: 700;
}
.scheda-edit-form .btn-pubblica {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--ar-brand) 0%, var(--ar-brand-dark) 100%);
    color: #fff;
    border: 0;
    border-radius: var(--ar-radius-sm);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(47, 125, 79, 0.25);
    transition: all var(--ar-transition);
}
.scheda-edit-form .btn-pubblica:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(47, 125, 79, 0.35);
}

/* Body: sezioni come card */
.scheda-edit-form .scheda-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.scheda-edit-form .dettagli-sezione {
    background: var(--ar-surface);
    border: 1px solid var(--ar-border);
    border-radius: var(--ar-radius-lg);
    padding: 28px 28px 24px;
    margin-bottom: 20px;
    box-shadow: var(--ar-shadow-sm);
    transition: box-shadow var(--ar-transition);
}
.scheda-edit-form .dettagli-sezione:hover {
    box-shadow: var(--ar-shadow);
}

.scheda-edit-form .dettagli-sezione h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--ar-text);
    margin: 0 0 24px;
    padding: 0 0 16px 0;
    border-left: 0 !important;
    border-bottom: 1px solid var(--ar-border);
    letter-spacing: -0.01em;
}
.scheda-edit-form .dettagli-sezione h3::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 20px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--ar-brand) 0%, var(--ar-accent) 100%);
    box-shadow: none;
    flex-shrink: 0;
}

/* Grid dei campi dentro ogni sezione */
.scheda-edit-form .dettagli-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.scheda-edit-form .dettagli-form-grid .form-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.scheda-edit-form .dettagli-form-grid .form-group.full-width {
    grid-column: 1 / -1;
}

.scheda-edit-form .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--ar-text);
    margin-bottom: 8px;
    line-height: 1.4;
}
.scheda-edit-form .form-group label small {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    font-weight: 400;
    color: var(--ar-text-muted);
    line-height: 1.4;
}

.scheda-edit-form input[type="text"],
.scheda-edit-form input[type="email"],
.scheda-edit-form input[type="url"],
.scheda-edit-form input[type="tel"],
.scheda-edit-form input[type="number"],
.scheda-edit-form select,
.scheda-edit-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    font: inherit;
    font-size: 15px;
    color: var(--ar-text);
    background: var(--ar-surface);
    border: 1.5px solid var(--ar-border);
    border-radius: var(--ar-radius-sm);
    outline: none;
    transition: border-color var(--ar-transition), box-shadow var(--ar-transition);
    -webkit-appearance: none;
    appearance: none;
}
.scheda-edit-form input::placeholder,
.scheda-edit-form textarea::placeholder { color: var(--ar-text-soft); }
.scheda-edit-form input:hover,
.scheda-edit-form select:hover,
.scheda-edit-form textarea:hover { border-color: var(--ar-border-strong); }
.scheda-edit-form input:focus,
.scheda-edit-form select:focus,
.scheda-edit-form textarea:focus {
    border-color: var(--ar-brand);
    box-shadow: var(--ar-ring);
}

.scheda-edit-form select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
    cursor: pointer;
}

/* File input (drag-drop style) */
.scheda-edit-form input[type="file"] {
    display: block;
    width: 100%;
    padding: 18px;
    background: var(--ar-surface-alt);
    border: 1.5px dashed var(--ar-border-strong);
    border-radius: var(--ar-radius-sm);
    color: var(--ar-text-muted);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--ar-transition);
}
.scheda-edit-form input[type="file"]:hover {
    border-color: var(--ar-brand);
    background: var(--ar-brand-soft);
    color: var(--ar-brand-dark);
}
.scheda-edit-form input[type="file"]::-webkit-file-upload-button {
    margin-right: 14px;
    padding: 8px 16px;
    background: var(--ar-surface);
    border: 1px solid var(--ar-border-strong);
    border-radius: 6px;
    color: var(--ar-text);
    font: inherit;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--ar-transition);
}
.scheda-edit-form input[type="file"]::-webkit-file-upload-button:hover {
    background: var(--ar-brand);
    color: #fff;
    border-color: var(--ar-brand);
}

.scheda-edit-form .form-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--ar-text-muted);
    line-height: 1.5;
}

/* Footer azioni (Aggiorna + Elimina + messaggio) */
.scheda-edit-form .scheda-footer {
    margin-top: 8px;
    padding: 24px 28px;
    background: var(--ar-surface);
    border: 1px solid var(--ar-border);
    border-radius: var(--ar-radius-lg);
    box-shadow: var(--ar-shadow-sm);
}

.scheda-edit-form .scheda-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ar-border);
    color: var(--ar-text-muted);
}
.scheda-edit-form .scheda-meta small {
    font-size: 12px;
}

.scheda-edit-form .scheda-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.scheda-edit-form .btn-aggiorna {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 180px;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--ar-brand) 0%, var(--ar-brand-dark) 100%);
    color: #fff;
    border: 0;
    border-radius: var(--ar-radius);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(47, 125, 79, 0.25);
    transition: all var(--ar-transition);
}
.scheda-edit-form .btn-aggiorna:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(47, 125, 79, 0.35);
}
.scheda-edit-form .btn-aggiorna:disabled {
    background: var(--ar-text-soft);
    box-shadow: none;
    cursor: wait;
    opacity: 0.7;
}

.scheda-edit-form .btn-elimina {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 22px;
    background: #fff;
    color: var(--ar-danger);
    border: 1.5px solid #fecaca;
    border-radius: var(--ar-radius);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--ar-transition);
}
.scheda-edit-form .btn-elimina:hover {
    background: var(--ar-danger);
    color: #fff;
    border-color: var(--ar-danger);
}

.scheda-edit-form .form-message {
    width: 100%;
    padding: 12px 16px;
    margin-top: 14px;
    border-radius: var(--ar-radius-sm);
    font-size: 14px;
    font-weight: 500;
    display: none;
}
.scheda-edit-form .form-message.error {
    display: block;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.scheda-edit-form .form-message.success {
    display: block;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Placeholder iniziale del pannello (prima di selezionare una scheda) */
.scheda-dettagli .placeholder-message {
    padding: 60px 28px;
    text-align: center;
    color: var(--ar-text-soft);
    font-size: 15px;
    font-style: italic;
    background: var(--ar-surface);
    border: 1px dashed var(--ar-border-strong);
    border-radius: var(--ar-radius-lg);
}

/* Responsive */
@media (max-width: 720px) {
    .scheda-edit-form {
        padding: 16px 12px 48px;
    }
    .scheda-edit-form .scheda-header,
    .scheda-edit-form .scheda-footer {
        padding: 20px 18px;
        border-radius: var(--ar-radius);
    }
    .scheda-edit-form .dettagli-sezione {
        padding: 20px 18px;
        border-radius: var(--ar-radius);
    }
    .scheda-edit-form .dettagli-form-grid {
        grid-template-columns: 1fr;
    }
    .scheda-edit-form .btn-aggiorna,
    .scheda-edit-form .btn-elimina {
        flex: 1 1 100%;
    }
}

/* ===================================================================
   ELENCO ASSOCIATI · card con thumbnail compatta
   =================================================================== */
.associato-card .associato-thumb {
    display: block;
    width: 100%;
    height: 170px;
    object-fit: cover;
    object-position: center;
    margin: 0;
    border-radius: 0;
    flex-shrink: 0;
}

.associato-card .associato-citta {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--ar-text-muted);
}
.associato-card .associato-citta strong {
    color: var(--ar-text);
}

.associato-card .associato-descrizione {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--ar-text-muted);
}

/* ===================================================================
   ELENCO ASSOCIATI · filtri + paginazione
   =================================================================== */
.associati-filtri {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 28px;
    padding: 20px 22px;
    background: var(--ar-surface);
    border: 1px solid var(--ar-border);
    border-radius: var(--ar-radius-lg);
    box-shadow: var(--ar-shadow-sm);
}

.associati-filtri .filtro-gruppo {
    display: flex;
    flex-direction: column;
    flex: 1 1 200px;
    min-width: 0;
}
.associati-filtri .filtro-gruppo label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ar-text);
    margin-bottom: 6px;
}

/* Il selettore e' volutamente piu' specifico (container + elemento): il tema
   Astra dichiara "select { line-height: 1 }" e un padding proprio, e con una
   line-height pari a 1 le lettere discendenti (g, p, q) restano tagliate dal
   bordo inferiore del campo. */
.elenco-associati-container .associati-filtri select.filtro-select,
.associati-filtri .filtro-select {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 38px 13px 14px;
    line-height: 1.5;
    min-height: 50px;
    height: auto;
    font: inherit;
    font-size: 15px;
    color: var(--ar-text);
    background-color: var(--ar-surface);
    border: 1.5px solid var(--ar-border);
    border-radius: var(--ar-radius-sm);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: border-color var(--ar-transition), box-shadow var(--ar-transition);
}
.associati-filtri .filtro-select:hover { border-color: var(--ar-border-strong); }
.associati-filtri .filtro-select:focus {
    border-color: var(--ar-brand);
    box-shadow: var(--ar-ring);
}

.associati-filtri .filtro-reset {
    /* Stessa altezza dei select, cosi' la riga resta allineata */
    min-height: 50px;
    flex: 0 0 auto;
    padding: 10px 18px;
    background: var(--ar-surface-alt);
    color: var(--ar-text-muted);
    border: 1.5px solid var(--ar-border);
    border-radius: var(--ar-radius-sm);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--ar-transition);
}
.associati-filtri .filtro-reset:hover {
    background: var(--ar-brand-soft);
    color: var(--ar-brand-dark);
    border-color: var(--ar-brand-soft);
}

.associati-nessun-risultato {
    margin: 20px 0;
    padding: 40px 24px;
    text-align: center;
    color: var(--ar-text-soft);
    font-size: 15px;
    font-style: italic;
    background: var(--ar-surface);
    border: 1px dashed var(--ar-border-strong);
    border-radius: var(--ar-radius-lg);
}

.associati-load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.btn-carica-altre {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 34px;
    background: linear-gradient(135deg, var(--ar-brand) 0%, var(--ar-brand-dark) 100%);
    color: #fff;
    border: 0;
    border-radius: var(--ar-radius);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(47, 125, 79, 0.25);
    transition: all var(--ar-transition);
}
.btn-carica-altre:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(47, 125, 79, 0.35);
}

.associato-card .associato-provincia {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--ar-text-muted);
}
.associato-card .associato-provincia strong { color: var(--ar-text); }

@media (max-width: 600px) {
    .associati-filtri .filtro-reset {
        flex: 1 1 100%;
    }
}

/* ===================================================================
   ELENCO ASSOCIATI · card coerenti col design moderno (iscrivimi)
   =================================================================== */
.elenco-associati-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 16px 64px;
    color: var(--ar-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
}

.elenco-associati-container .associati-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
    margin-top: 0;
}

.elenco-associati-container .associato-card {
    background: var(--ar-surface);
    border: 1px solid var(--ar-border);
    border-top: 1px solid var(--ar-border);
    border-radius: var(--ar-radius-lg);
    box-shadow: var(--ar-shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--ar-transition), box-shadow var(--ar-transition);
}
.elenco-associati-container .associato-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ar-shadow-lg);
    border-top-color: var(--ar-border);
}

.elenco-associati-container .associato-content {
    padding: 22px 22px 8px;
    flex: 1;
}

.elenco-associati-container .associato-nome {
    font-size: 19px;
    font-weight: 700;
    color: var(--ar-text);
    letter-spacing: -0.01em;
    margin: 0 0 14px;
    line-height: 1.3;
}

.elenco-associati-container .associato-info {
    font-size: 14px;
    color: var(--ar-text-muted);
}

.elenco-associati-container .associato-regione {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--ar-text-muted);
}
.elenco-associati-container .associato-regione strong {
    color: var(--ar-text);
    font-weight: 700;
}

.elenco-associati-container .associato-descrizione {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--ar-border);
    font-size: 14px;
    line-height: 1.6;
    color: var(--ar-text-muted);
}

.elenco-associati-container .associato-actions {
    padding: 8px 22px 22px;
}

.elenco-associati-container .btn-apri-azienda {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--ar-brand) 0%, var(--ar-brand-dark) 100%);
    color: #fff;
    text-decoration: none;
    border: 0;
    border-radius: var(--ar-radius);
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(47, 125, 79, 0.22);
    transition: all var(--ar-transition);
}
.elenco-associati-container .btn-apri-azienda:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(47, 125, 79, 0.32);
    color: #fff;
}

/* ===================================================================
   DETTAGLIO AZIENDA · scheda pubblica coerente col design moderno
   =================================================================== */
.dettaglio-azienda-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 16px 64px;
    color: var(--ar-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
}

/* Header della scheda: fondo pieno #172e2e, titolo e chip in bianco */
.dettaglio-azienda-container .azienda-header {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: #172e2e;
    color: #fff;
    padding: 44px 40px;
    border-radius: var(--ar-radius-lg);
    margin-bottom: 24px;
    border-top: 0;
    box-shadow: 0 16px 40px rgba(23, 46, 46, 0.32);
}
/* Cerchio decorativo sfumato in alto a destra */
.dettaglio-azienda-container .azienda-header::after {
    content: "";
    position: absolute;
    top: -90px;
    right: -70px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    z-index: -1;
}
/* Filetto accento giallo in alto */
.dettaglio-azienda-container .azienda-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--ar-accent) 0%, rgba(212, 183, 60, 0) 70%);
}

.dettaglio-azienda-container .azienda-titolo {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin: 0 0 18px;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.dettaglio-azienda-container .azienda-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
}
/* Ogni info come "chip" vetroso */
.dettaglio-azienda-container .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    color: #fff;
    font-weight: 500;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background-color var(--ar-transition);
}
.dettaglio-azienda-container .meta-item:hover {
    background: rgba(255, 255, 255, 0.24);
}
.dettaglio-azienda-container .meta-item a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}
.dettaglio-azienda-container .meta-item a:hover {
    text-decoration: underline;
}

/* Immagine principale sotto la fascia verde */
.dettaglio-azienda-container .azienda-immagine-principale {
    margin: 0 0 24px;
    text-align: center;
}
.dettaglio-azienda-container .azienda-immagine-principale img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 460px;
    object-fit: cover;
    border-radius: var(--ar-radius-lg);
    box-shadow: var(--ar-shadow);
}

/* Box informativi (detail-box) come card moderne */
.dettaglio-azienda-container .azienda-details-vertical {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}
.dettaglio-azienda-container .detail-box {
    background: var(--ar-surface);
    padding: 24px 26px;
    border: 1px solid var(--ar-border);
    border-left: 1px solid var(--ar-border);
    border-radius: var(--ar-radius-lg);
    box-shadow: var(--ar-shadow-sm);
    transition: box-shadow var(--ar-transition);
}
.dettaglio-azienda-container .detail-box:hover {
    transform: none;
    border-left-color: var(--ar-border);
    box-shadow: var(--ar-shadow);
}
.dettaglio-azienda-container .detail-box h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--ar-text);
    margin: 0 0 14px;
    letter-spacing: -0.01em;
}
.dettaglio-azienda-container .detail-box h3::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 20px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--ar-brand) 0%, var(--ar-accent) 100%);
    flex-shrink: 0;
}
.dettaglio-azienda-container .detail-box p,
.dettaglio-azienda-container .detail-box-text p {
    margin: 0;
    color: var(--ar-text-muted);
    font-size: 15px;
    line-height: 1.7;
}
/* wpautop() genera piu' <p> quando il testo ha righe vuote: si distanziano
   fra loro senza reintrodurre margine sopra il primo e sotto l'ultimo. */
.dettaglio-azienda-container .detail-box-text p + p {
    margin-top: 12px;
}

/* Sezioni (azienda-section) come card moderne */
.dettaglio-azienda-container .azienda-section {
    background: var(--ar-surface);
    padding: 26px 28px;
    border: 1px solid var(--ar-border);
    border-radius: var(--ar-radius-lg);
    margin-bottom: 16px;
    box-shadow: var(--ar-shadow-sm);
}
.dettaglio-azienda-container .azienda-section h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--ar-text);
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--ar-border);
    letter-spacing: -0.01em;
}
.dettaglio-azienda-container .azienda-section h2::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 22px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--ar-brand) 0%, var(--ar-accent) 100%);
    flex-shrink: 0;
}
.dettaglio-azienda-container .azienda-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--ar-text);
    margin: 0 0 12px;
}
.dettaglio-azienda-container .azienda-section p {
    color: var(--ar-text-muted);
    font-size: 15px;
    line-height: 1.7;
}

/* Galleria foto */
.dettaglio-azienda-container .foto-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 16px;
}
.dettaglio-azienda-container .foto-item {
    border-radius: var(--ar-radius-sm);
    overflow: hidden;
    box-shadow: var(--ar-shadow-sm);
    transition: transform var(--ar-transition), box-shadow var(--ar-transition);
}
.dettaglio-azienda-container .foto-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--ar-shadow);
}
.dettaglio-azienda-container .foto-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* Video embed */
.dettaglio-azienda-container .video-embed-container {
    border-radius: var(--ar-radius-sm);
    box-shadow: var(--ar-shadow-sm);
}

/* Social links pubblici */
.dettaglio-azienda-container .social-links-pubblico {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.dettaglio-azienda-container .social-link-pubblico {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--ar-surface-alt);
    border: 1.5px solid var(--ar-border);
    border-radius: 999px;
    color: var(--ar-text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--ar-transition);
}
.dettaglio-azienda-container .social-link-pubblico i { font-size: 16px; }
.dettaglio-azienda-container .social-link-pubblico:hover {
    background: var(--ar-brand);
    border-color: var(--ar-brand);
    color: #fff;
    transform: translateY(-1px);
}

/* File allegati */
.dettaglio-azienda-container .file-allegati-pubblico {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.dettaglio-azienda-container .file-allegato-pubblico {
    padding: 18px 20px;
    background: var(--ar-surface-alt);
    border: 1px solid var(--ar-border);
    border-radius: var(--ar-radius-sm);
}
.dettaglio-azienda-container .file-allegato-pubblico h4 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ar-text);
}
.dettaglio-azienda-container .file-allegato-pubblico p {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--ar-text-muted);
}

/* Bottoni link esterni / download / torna indietro */
.dettaglio-azienda-container .btn-download,
.dettaglio-azienda-container .btn-link-esterno {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--ar-brand-soft);
    color: var(--ar-brand-dark);
    text-decoration: none;
    border-radius: var(--ar-radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: all var(--ar-transition);
}
.dettaglio-azienda-container .btn-download:hover,
.dettaglio-azienda-container .btn-link-esterno:hover {
    background: var(--ar-brand);
    color: #fff;
}

.dettaglio-azienda-container .azienda-actions {
    text-align: center;
    margin-top: 32px;
}
.dettaglio-azienda-container .btn-torna-elenco {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 13px 30px;
    background: linear-gradient(135deg, var(--ar-brand) 0%, var(--ar-brand-dark) 100%);
    color: #fff;
    text-decoration: none;
    border: 0;
    border-radius: var(--ar-radius);
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(47, 125, 79, 0.25);
    transition: all var(--ar-transition);
}
.dettaglio-azienda-container .btn-torna-elenco:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(47, 125, 79, 0.35);
    color: #fff;
}

@media (max-width: 720px) {
    .dettaglio-azienda-container .azienda-header { padding: 26px 20px; }
    .dettaglio-azienda-container .azienda-titolo { font-size: 25px; }
    .dettaglio-azienda-container .detail-box,
    .dettaglio-azienda-container .azienda-section { padding: 20px 18px; }
}

/* ===================================================================
   HOME · Ultime schede inserite (griglia responsive, altezza
   proporzionale alla larghezza tramite aspect-ratio)
   =================================================================== */
.ultime-schede-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
}

.ultime-schede-titolo {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--ar-text);
    letter-spacing: -0.01em;
    margin: 0 0 24px;
}

/* Griglia: 4 colonne desktop → 2 → 1, con spazio tra le schede */
.ultime-schede-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* Card: aspect-ratio fa sì che l'altezza sia proporzionale alla larghezza */
.ultima-scheda-card {
    display: flex;
    flex-direction: column;
    aspect-ratio: 3 / 4;
    background: var(--ar-surface);
    border: 1px solid var(--ar-border);
    border-radius: var(--ar-radius-lg);
    box-shadow: var(--ar-shadow-sm);
    overflow: hidden;
    text-decoration: none;
    color: var(--ar-text);
    transition: transform var(--ar-transition), box-shadow var(--ar-transition);
}
.ultima-scheda-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ar-shadow-lg);
}

/* Immagine: occupa la parte alta, cresce in proporzione */
.ultima-scheda-img {
    flex: 1 1 auto;
    min-height: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--ar-brand-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}
.ultima-scheda-img-placeholder {
    font-size: 40px;
    opacity: 0.5;
}

/* Corpo testo */
.ultima-scheda-body {
    flex: 0 0 auto;
    padding: 14px 16px 6px;
}
.ultima-scheda-nome {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    color: var(--ar-text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ultima-scheda-luogo {
    margin: 0;
    font-size: 13px;
    color: var(--ar-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ultima-scheda-cta {
    display: block;
    padding: 8px 16px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ar-brand);
    transition: color var(--ar-transition);
}
.ultima-scheda-card:hover .ultima-scheda-cta {
    color: var(--ar-brand-dark);
}

/* Responsive */
@media (max-width: 900px) {
    .ultime-schede-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
}
@media (max-width: 520px) {
    .ultime-schede-grid { grid-template-columns: 1fr; gap: 16px; }
    .ultima-scheda-card { aspect-ratio: 4 / 3; }
}

/* ===================================================================
   MODALE GESTIONE UTENTI · pulsante Annulla (no grigio, no rotazione)
   =================================================================== */
.modal-body .btn-annulla,
.modal-actions .btn-annulla {
    background: var(--ar-surface);
    color: var(--ar-text-muted);
    border: 1.5px solid var(--ar-border);
    border-radius: var(--ar-radius-sm);
    transform: none !important;
    transition: background-color var(--ar-transition), border-color var(--ar-transition), color var(--ar-transition);
}
.modal-body .btn-annulla:hover,
.modal-actions .btn-annulla:hover {
    background: var(--ar-surface-alt);
    border-color: var(--ar-border-strong);
    color: var(--ar-text);
    transform: none !important;
}

/* ===================================================================
   LIGHTBOX GALLERIA FOTO (scheda azienda)
   =================================================================== */
.dettaglio-azienda-container .foto-item img {
    cursor: zoom-in;
}

.ar-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 14, 12, 0.92);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    padding: 40px 76px;
    box-sizing: border-box;
}
.ar-lightbox.visible {
    opacity: 1;
    visibility: visible;
}

.ar-lb-stage {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ar-lb-img {
    max-width: 100%;
    max-height: calc(100vh - 80px);
    width: auto;
    height: auto;
    border-radius: var(--ar-radius-sm);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    object-fit: contain;
    animation: arLbIn 0.25s ease;
}
@keyframes arLbIn {
    from { transform: scale(0.96); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* Pulsanti (chiudi, frecce) */
.ar-lb-close,
.ar-lb-prev,
.ar-lb-next {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color var(--ar-transition), transform var(--ar-transition);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.ar-lb-close:hover,
.ar-lb-prev:hover,
.ar-lb-next:hover {
    background: rgba(255, 255, 255, 0.28);
}

.ar-lb-close {
    top: 22px;
    right: 26px;
    width: 46px;
    height: 46px;
    font-size: 28px;
    line-height: 1;
}

.ar-lb-prev,
.ar-lb-next {
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    font-size: 22px;
}
.ar-lb-prev { left: 18px; }
.ar-lb-next { right: 18px; }
.ar-lb-prev:hover { transform: translateY(-50%) scale(1.08); }
.ar-lb-next:hover { transform: translateY(-50%) scale(1.08); }

.ar-lb-counter {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: 999px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

@media (max-width: 600px) {
    .ar-lightbox { padding: 20px 12px; }
    .ar-lb-prev, .ar-lb-next { width: 44px; height: 44px; font-size: 18px; }
    .ar-lb-prev { left: 8px; }
    .ar-lb-next { right: 8px; }
    .ar-lb-close { top: 12px; right: 12px; width: 40px; height: 40px; font-size: 24px; }
}

/* ===================================================================
   HOME · Pulsante "Tutte le schede" sotto le ultime schede inserite
   =================================================================== */
.ultime-schede-azioni {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}
.btn-tutte-schede {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 34px;
    background: linear-gradient(135deg, var(--ar-brand) 0%, var(--ar-brand-dark) 100%);
    color: #fff;
    text-decoration: none;
    border: 0;
    border-radius: var(--ar-radius);
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(47, 125, 79, 0.25);
    transition: all var(--ar-transition);
}
.btn-tutte-schede:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(47, 125, 79, 0.35);
    color: #fff;
}

/* ===================================================================
   Campo di ricerca nel menu secondario
   =================================================================== */
.ar-menu-search-item {
    display: flex;
    align-items: center;
}
.ar-search-form {
    display: flex;
    align-items: center;
    background: var(--ar-surface);
    border: 1.5px solid var(--ar-border);
    border-radius: 999px;
    overflow: hidden;
    height: 38px;
    transition: border-color var(--ar-transition), box-shadow var(--ar-transition);
}
.ar-search-form:focus-within {
    border-color: var(--ar-brand);
    box-shadow: var(--ar-ring);
}
.ar-search-input {
    border: 0;
    outline: 0;
    background: transparent;
    padding: 0 8px 0 16px;
    font: inherit;
    font-size: 14px;
    color: var(--ar-text);
    width: 160px;
    max-width: 42vw;
}
.ar-search-input::placeholder {
    color: var(--ar-text-soft);
}
.ar-search-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    background: var(--ar-brand);
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    transition: background-color var(--ar-transition);
}
.ar-search-btn:hover {
    background: var(--ar-brand-dark);
}

/* -------------------------------------------------------------------
   SELECT DEL FORM PUBBLICO (/iscrivimi/)
   Il tema Astra applica "background" (shorthand) ai select: lo shorthand
   azzera background-repeat, che torna al default "repeat", e la freccetta
   SVG viene ripetuta per tutta la larghezza del campo.
   Qui si riapplica la chevron in forma esplicita, non abbreviata.
   ------------------------------------------------------------------- */
#form-iscrizione-pubblica select,
.form-iscrizione-pubblica select,
.area-riservata-form select,
.form-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Come per i filtri: Astra impone line-height:1 sui select e le lettere
       discendenti verrebbero tagliate dal bordo inferiore. */
    line-height: 1.5;
    min-height: 50px;
    height: auto;
    padding-top: 13px;
    padding-bottom: 13px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
    background-attachment: scroll;
    background-origin: padding-box;
    background-clip: border-box;
    padding-right: 38px;
    cursor: pointer;
}

/* Stesso trattamento allo stato :focus, che in style-refined.css
   ridefiniva l'immagine perdendo di nuovo il no-repeat. */
#form-iscrizione-pubblica select:focus,
.form-iscrizione-pubblica select:focus,
.area-riservata-form select:focus,
.form-group select:focus {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 6.5L6 1.5L11 6.5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
}

/* -------------------------------------------------------------------
   STAFF: un unico box che raccoglie foto e descrizione.
   La foto sta sopra, il testo sotto, separati da una linea sottile.
   ------------------------------------------------------------------- */
.dettaglio-azienda-container .detail-box-staff .staff-foto-wrapper {
    margin: 0;
    line-height: 0; /* elimina lo spazio sotto l'immagine inline */
}
.dettaglio-azienda-container .detail-box-staff .staff-foto {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: var(--ar-radius);
    /* La foto dello staff puo' avere proporzioni molto diverse: si limita
       l'altezza per non far esplodere il box su immagini verticali. */
    max-height: 520px;
    object-fit: cover;
}

/* Separazione fra foto e testo dentro lo stesso box. Il margine e il
   bordo compaiono solo quando la foto c'e' davvero: con il solo testo
   il box resta pulito come tutti gli altri. */
.dettaglio-azienda-container .detail-box-staff .staff-foto-wrapper + .staff-testo {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--ar-border);
}

@media (max-width: 720px) {
    .dettaglio-azienda-container .detail-box-staff .staff-foto {
        max-height: 360px;
    }
}

/* -------------------------------------------------------------------
   Altezza dei campi del form pubblico.
   Astra dichiara line-height:1 su input e select: il testo resta
   schiacciato e le lettere discendenti vengono tagliate. Qui si dà
   respiro verticale, mantenendo input e select della stessa altezza
   perche' restino allineati quando stanno sulla stessa riga.
   ------------------------------------------------------------------- */
#form-iscrizione-pubblica .form-group input[type="text"],
#form-iscrizione-pubblica .form-group input[type="email"],
#form-iscrizione-pubblica .form-group input[type="url"],
#form-iscrizione-pubblica .form-group input[type="tel"],
#form-iscrizione-pubblica .form-group input[type="number"],
#form-iscrizione-pubblica .form-group input[type="date"],
#form-iscrizione-pubblica .form-group select,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select {
    line-height: 1.5;
    min-height: 50px;
    height: auto;
    padding-top: 13px;
    padding-bottom: 13px;
}

/* -------------------------------------------------------------------
   Date di pubblicazione e aggiornamento, in chiusura di scheda
   ------------------------------------------------------------------- */
.dettaglio-azienda-container .azienda-date-scheda {
    margin: 28px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--ar-border);
    text-align: right;
}
.dettaglio-azienda-container .azienda-date-scheda p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--ar-text-soft, var(--ar-text-muted));
    font-style: italic;
}

@media (max-width: 720px) {
    .dettaglio-azienda-container .azienda-date-scheda {
        text-align: left;
    }
}
