.max-w-7xl {
    max-width: 1700px !important;
}

.swal2-container {
    z-index: 99999 !important;
    backdrop-filter: blur(4px) !important;
}

.swal2-backdrop-show {
    z-index: 99998 !important;
    background: rgba(100, 194, 200, 0.3) !important;
}

.dark .swal2-backdrop-show {
    background: rgba(100, 194, 200, 0.4) !important;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: rgb(100 194 200 / 0.3);
    backdrop-filter: blur(4px) !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #1f2937;
    border-radius: 50%;
    animation: public-layout-spin 1s linear infinite;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading-text {
    color: #1f2937;
    font-size: 1.5rem;
    font-weight: 600;
}

.demo-completion-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgb(240 253 250 / 0.6);
    backdrop-filter: blur(15px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.demo-completion-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.demo-completion-overlay__panel {
    position: relative;
    width: min(32rem, 100%);
    padding: 4rem;
    overflow: hidden;
    border-radius: 1.5rem;
    background: rgb(255 255 255 / 0.8);
    box-shadow: 0 24px 60px -24px rgb(15 23 42 / 0.4);
    color: #0f172a;
    text-align: center;
    transform: translateY(0.75rem) scale(0.98);
    transition: transform 0.25s ease;
}

.demo-completion-overlay.is-open .demo-completion-overlay__panel {
    transform: translateY(0) scale(1);
}

.demo-completion-overlay__panel > * {
    position: relative;
}

.demo-completion-overlay__primary-action:focus-visible,
.demo-completion-overlay__secondary-action:focus-visible {
    outline: 3px solid rgb(100 194 200 / 0.35);
    outline-offset: 3px;
}

.demo-completion-overlay__icon {
    display: inline-flex;
    width: 3.75rem;
    height: 3.75rem;
    align-items: center;
    justify-content: center;
    border-radius: 1.125rem;
    background: rgb(100 194 200 / 0.16);
    color: rgb(49 128 133);
    font-size: 1.5rem;
}

.demo-completion-overlay__eyebrow {
    margin: 1.25rem 0 0;
    color: rgb(49 128 133);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.demo-completion-overlay__title {
    margin: 0.5rem 0 0;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.demo-completion-overlay__text {
    margin: 0.875rem auto 0;
    max-width: 26rem;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
}

.demo-completion-overlay__actions {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

.demo-completion-overlay__primary-action,
.demo-completion-overlay__secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    min-height: 3rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    font-weight: 750;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.demo-completion-overlay__primary-action {
    background: rgb(100 194 200);
    color: #ffffff;
}

.demo-completion-overlay__primary-action:hover {
    background: rgb(83 177 183);
    transform: translateY(-1px);
}

.demo-completion-overlay__secondary-action {
    border: 1px solid rgb(100 194 200 / 0.5);
    background: #ffffff;
    color: rgb(49 128 133);
}

.demo-completion-overlay__secondary-action:hover {
    background: rgb(240 253 250);
    border-color: rgb(100 194 200 / 0.8);
}

body.demo-completion-open {
    overflow: hidden;
}

@keyframes public-layout-spin {
    to {
        transform: rotate(360deg);
    }
}

.dark .loading-overlay {
    background: rgba(17, 24, 39, 0.8);
}

.dark .loading-content {
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.dark .loading-spinner {
    border: 4px solid #374151;
    border-top: 4px solid #60a5fa;
}

.dark .loading-text {
    color: #f9fafb;
}

html,
body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.current-configuration-widget {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.current-configuration-widget.hidden {
    display: none;
}

.current-configuration-panel {
    width: min(22rem, calc(100vw - 2rem));
    max-height: calc(100vh - 8.5rem);
    overflow-y: auto;
    padding: 1.125rem;
    border: 1px solid rgb(100 194 200 / 0.45);
    border-radius: 1rem;
    background: rgb(255 255 255 / 0.98);
    box-shadow: 0 18px 42px -20px rgb(15 23 42 / 0.45);
    color: #1f2937;
    animation: company-contact-panel-enter 0.2s ease-out;
}

.current-configuration-panel__heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.current-configuration-panel__icon {
    display: inline-flex;
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgb(100 194 200);
    color: #ffffff;
}

.current-configuration-panel__eyebrow {
    margin: 0 0 0.125rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.current-configuration-panel__title {
    margin: 0;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 700;
}

.current-configuration-section {
    padding: 0.75rem 0;
    border-top: 1px solid #e2e8f0;
}

.current-configuration-section--machine {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding-top: 0;
    border-top: 0;
}

.current-configuration-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.current-configuration-section__label {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.current-configuration-section__machine {
    color: #1e293b;
    font-size: 0.9rem;
    line-height: 1.3;
}

.current-configuration-section__type,
.current-configuration-section__empty,
.current-configuration-section__more {
    margin: 0;
    color: #64748b;
    font-size: 0.78rem;
}

.current-configuration-section__count {
    display: inline-flex;
    min-width: 1.35rem;
    height: 1.35rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgb(100 194 200 / 0.16);
    color: rgb(49 128 133);
    font-size: 0.72rem;
    font-weight: 800;
}

.current-configuration-section__items {
    display: grid;
    gap: 0.4rem;
    margin: 0.55rem 0 0;
    padding: 0;
    list-style: none;
}

.current-configuration-section__items li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    color: #334155;
    font-size: 0.8rem;
    line-height: 1.25;
}

.current-configuration-section__items small {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 0.72rem;
}

.current-configuration-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    min-width: 3rem;
    min-height: 3rem;
    padding: 0.625rem 0.95rem;
    border: 0;
    border-radius: 9999px;
    background: rgb(100 194 200);
    box-shadow: 0 0 0 2px rgb(255 255 255 / 0.85), 0 10px 22px -12px rgb(100 194 200 / 0.85);
    color: #ffffff;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.current-configuration-toggle:hover {
    transform: translateY(-2px);
    background: rgb(83 177 183);
    box-shadow: 0 0 0 2px rgb(255 255 255 / 0.9), 0 14px 26px -12px rgb(100 194 200 / 0.95);
}

.current-configuration-toggle:focus-visible {
    outline: 3px solid rgb(100 194 200 / 0.35);
    outline-offset: 3px;
}

/* Widget contatti nel configuratore pubblico */
.company-contact-widget {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.company-contact-panel {
    position: relative;
    width: min(22rem, calc(100vw - 2rem));
    padding: 1.25rem;
    border: 1px solid rgb(100 194 200 / 0.45);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 42px -20px rgba(15, 23, 42, 0.45);
    color: #1f2937;
    isolation: isolate;
    overflow: hidden;
    animation: company-contact-panel-enter 0.2s ease-out;
}

.company-contact-panel::before {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url('../images/Milestone%20logo.png');
    background-position: center;
    background-repeat: no-repeat;
    background-size: 15rem auto;
    content: '';
    opacity: 0.1;
    pointer-events: none;
}

.company-contact-panel > * {
    position: relative;
    z-index: 1;
}

.company-contact-panel__heading {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    text-align: left;
}

.company-contact-panel__icon {
    display: inline-flex;
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgb(100 194 200);
    color: #ffffff;
}

.company-contact-panel__eyebrow {
    margin: 0 0 0.125rem;
    color: #000000;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.company-contact-panel__title {
    margin: 0;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 700;
}

.company-contact-panel__details {
    margin: 0 0 1rem;
    color: #475569;
    font-size: 0.875rem;
    font-style: normal;
    line-height: 1.55;
    text-align: left;
}

.company-contact-panel__details strong {
    color: #1e293b;
}

.company-contact-panel__link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.625rem;
    width: fit-content;
    margin-top: 0.625rem;
    color: rgb(70 160 166);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

.company-contact-panel__link:hover,
.company-contact-panel__link:focus-visible {
    color: rgb(49 128 133);
    text-decoration: underline;
}

.company-contact-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    min-height: 3rem;
    padding: 0.625rem 0.95rem;
    border: 0;
    border-radius: 9999px;
    background: rgb(100 194 200);
    box-shadow: 0 0 0 2px rgb(255 255 255 / 0.85), 0 10px 22px -12px rgb(100 194 200 / 0.85);
    color: #ffffff;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.company-contact-toggle:hover {
    transform: translateY(-2px);
    background: rgb(83 177 183);
    box-shadow: 0 0 0 2px rgb(255 255 255 / 0.9), 0 14px 26px -12px rgb(100 194 200 / 0.95);
}

.company-contact-toggle:focus-visible {
    outline: 3px solid rgb(100 194 200 / 0.35);
    outline-offset: 3px;
}

@keyframes company-contact-panel-enter {
    from {
        opacity: 0;
        transform: translateY(0.5rem) scale(0.98);
    }

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

@media (max-width: 640px) {
    .demo-completion-overlay {
        padding: 1rem;
    }

    .demo-completion-overlay__panel {
        padding: 2rem 1.25rem 1.25rem;
        border-radius: 1.25rem;
    }

    .demo-completion-overlay__title {
        font-size: 1.5rem;
    }

    .current-configuration-widget {
        top: auto;
        right: auto;
        bottom: 1rem;
        left: 1rem;
    }

    .current-configuration-toggle {
        width: auto;
        min-width: 0;
        justify-content: center;
        padding: 0.625rem 0.95rem;
    }

    .current-configuration-panel {
        max-height: min(32rem, calc(100vh - 6rem));
    }

    .company-contact-widget {
        right: 1rem;
        bottom: 1rem;
    }

    .company-contact-toggle__label {
        display: none;
    }

    .company-contact-toggle {
        width: 3rem;
        justify-content: center;
        padding: 0;
    }
}
