/* ===========================
   FranchHelp Modal
=========================== */

.fh-modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s ease, visibility .15s ease;
    z-index: 9999;
}

.fh-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.fh-modal {
    width: 100%;
    max-width: 430px;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(0, 0, 0, .20);
    animation: fhModalIn .18s ease;
}

@keyframes fhModalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===========================
   Header
=========================== */

.fh-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 24px 0;
}

.fh-modal-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fh-modal-icon svg {
    width: 28px;
    height: 28px;
}

/* ===========================
   Titolo
=========================== */

.fh-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    color: #1f2937;
}

/* ===========================
   Corpo
=========================== */

.fh-modal-body {
    padding: 18px 24px;
}

.fh-modal-message {
    margin: 0;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ===========================
   Footer
=========================== */

.fh-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #ececec;
}

.fh-modal-footer .fh-btn {
    min-width: 110px;
}

/* ===========================
   Colori
=========================== */

.fh-modal-info {
    border-top: 5px solid #3b82f6;
}

.fh-modal-info .fh-modal-icon {
    color: #3b82f6;
}

.fh-modal-success {
    border-top: 5px solid #22c55e;
}

.fh-modal-success .fh-modal-icon {
    color: #22c55e;
}

.fh-modal-warning {
    border-top: 5px solid #f59e0b;
}

.fh-modal-warning .fh-modal-icon {
    color: #f59e0b;
}

.fh-modal-error {
    border-top: 5px solid #ef4444;
}

.fh-modal-error .fh-modal-icon {
    color: #ef4444;
}

/* ===========================
   Focus
=========================== */

.fh-modal button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* ===========================
   Body
=========================== */

body.fh-modal-open {
    overflow: hidden;
}

/* ===========================
   Responsive
=========================== */

@media (max-width: 480px) {

    .fh-modal-overlay {
        padding: 16px;
    }

    .fh-modal {
        max-width: 100%;
    }

    .fh-modal-header,
    .fh-modal-body,
    .fh-modal-footer {
        padding-left: 18px;
        padding-right: 18px;
    }

    .fh-modal-footer {
        flex-direction: column-reverse;
    }

    .fh-modal-footer .fh-btn {
        width: 100%;
    }
}