/**
 * Component: accessible-modal
 * Stili base del componente modal accessibile
 */

/* Container modal — nascosto di default */
.am-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
}

.am-modal.am-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* Overlay scuro */
.am-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

/* Pannello contenuto */
.am-panel {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 436px;
    width: calc(100% - 2rem);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

.am-modal.am-open .am-panel {
    transform: translateY(0);
}

/* Bottone chiudi */
.am-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #A8A8A8;
    background: transparent;
    cursor: pointer;
    color: #3D3D3D;
    padding: 0;
    transition: background-color 0.2s ease;
}

.am-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.am-close:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 2px;
}

/* -----------------------------------------------------------------------
   Responsive
----------------------------------------------------------------------- */
@media (max-width: 480px) {
    .am-panel {
        padding: 1.25rem;
        border-radius: 8px;
    }
}
