/* SweetAlert2 — Home Maintenances brand theme */
:root {
    --hm-swal-width: clamp(17.5rem, 92vw, 28rem);
    --hm-swal-side-pad: 0.75rem;
}

.hm-swal-popup {
    width: var(--hm-swal-width) !important;
    max-width: calc(100vw - (var(--hm-swal-side-pad) * 2)) !important;
    box-sizing: border-box !important;
    /* border-radius: 18px !important; */
    padding: 0 0 1.25rem !important;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif !important;
    box-shadow: 0 24px 64px rgba(5, 24, 41, 0.28) !important;
}

.hm-swal-popup::before {
    content: '';
    display: block;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, #fdc900, #e6b000);
    margin: 1px 1px 0;
}

.hm-swal-title {
    color: #051829 !important;
    font-weight: 700 !important;
    font-size: clamp(1rem, 2.8vw, 1.2rem) !important;
    padding: 0 1rem !important;
    word-break: break-word;
}

.hm-swal-text {
    color: #475569 !important;
    font-size: clamp(0.84rem, 2.4vw, 0.92rem) !important;
    line-height: 1.55 !important;
    padding: 0 1rem !important;
    word-break: break-word;
}

.hm-swal-btn {
    border-radius: 10px !important;
    font-weight: 700 !important;
    font-size: clamp(0.82rem, 2.2vw, 0.88rem) !important;
    padding: 0.65rem 1.4rem !important;
    min-width: 5.5rem;
}

.hm-swal-btn--confirm {
    color: #051829 !important;
}

.hm-swal-btn--waiting,
.hm-swal-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.hm-swal-btn--cancel {
    background: #f1f5f9 !important;
    color: #475569 !important;
}

.hm-swal-toast {
    width: auto !important;
    max-width: min(92vw, 22rem) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(5, 24, 41, 0.15) !important;
}

div:where(.swal2-container) {
    z-index: 100000 !important;
    padding: var(--hm-swal-side-pad) !important;
}

/* Phone — full usable width, stacked buttons on confirm dialogs */
@media (max-width: 575.98px) {
    :root {
        --hm-swal-width: calc(100vw - 1.5rem);
        --hm-swal-side-pad: 0.625rem;
    }

    .hm-swal-popup .swal2-icon {
        transform: scale(0.85);
        margin: 1rem auto 0.5rem !important;
    }

    .hm-swal-popup .swal2-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        width: calc(100% - 2rem);
        margin: 0.75rem 1rem 0 !important;
        gap: 0.5rem;
    }

    .hm-swal-popup .swal2-actions .swal2-styled {
        width: 100%;
        margin: 0 !important;
    }
}

/* Tablet */
@media (min-width: 576px) and (max-width: 991.98px) {
    :root {
        --hm-swal-width: min(90vw, 26rem);
    }
}

/* Desktop — slightly wider cap for long messages */
@media (min-width: 992px) {
    :root {
        --hm-swal-width: clamp(22rem, 38vw, 32rem);
    }
}
