/* ==========================================================================
   Popup Alert Component — Mamaliho
   Dùng chung cho các thông báo dạng modal (cảnh báo, xác nhận, lỗi form...)
   Yêu cầu: các biến màu bên dưới nên trỏ về token thật trong mamaliho-root.css
   ========================================================================== */

.popup-alert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    z-index: 1000;
}

.popup-alert-card {
    width: 100%;
    max-width: 380px;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    animation: popup-alert-in 0.22s ease-out;
}

@keyframes popup-alert-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Header ── */
.popup-alert-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border, #eeeeee);
}

.popup-alert-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.popup-alert-brand-icon {
    font-size: 20px;
    color: var(--coral-hex, #e8603a);
}

.popup-alert-brand-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    display: block;
}

.popup-alert-brand-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--navy-900, #0d2d5e);
    letter-spacing: 0.2px;
}

.popup-alert-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--navy-100, #eef2f7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.popup-alert-close:hover {
    background: var(--coral-dim, rgba(232,96,58,0.12));
}

.popup-alert-close i {
    font-size: 15px;
    color: var(--navy-300, #4a5f78);
    transition: color 0.15s ease;
}

.popup-alert-close:hover i {
    color: var(--coral-hex, #e8603a);
}

/* ── Body ── */
.popup-alert-body {
    padding: 36px 28px 28px;
    text-align: center;
}

.popup-alert-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

/* Biến thể trạng thái — đổi màu icon theo ngữ cảnh */
.popup-alert-icon--warning {
    background: #faece7;
}
.popup-alert-icon--warning i {
    color: var(--coral-hex, #d85a30);
}

.popup-alert-icon--success {
    background: #e1f5ee;
}
.popup-alert-icon--success i {
    color: var(--teal-dark, #1da47d);
}

.popup-alert-icon--error {
    background: var(--lvl-ratcao-text, #fcebeb);
}
.popup-alert-icon--error i {
    color: var(--lvl-ratcao-bg, #a32d2d);
}

.popup-alert-icon i {
    font-size: 26px;
}

.popup-alert-message {
    font-size: var(--text-base, 15px);
    font-weight: 500;
    color: var(--navy-700, #1a4a7a);
    line-height: 1.65;
    margin: 0 0 24px;
}

/* ── Primary CTA button — coral ── */
.popup-alert-btn {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: var(--radius-full, 9999px);
    background: var(--coral-hex, #e8603a);
    color: #ffffff;
    font-size: var(--text-sm, 13px);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition:
        background  0.15s ease,
        transform   0.2s cubic-bezier(.22,.68,0,1.2),
        box-shadow  0.15s ease;
    box-shadow: 0 4px 14px rgba(232, 96, 58, 0.32);
}

.popup-alert-btn:hover {
    background: var(--coral-soft-hex, #e8705f);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(232, 96, 58, 0.40);
}

.popup-alert-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(232, 96, 58, 0.28);
}


/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */

/* iPad xoay ngang — 992px → 1024px */
@media (max-width: 1024px) and (orientation: landscape) {
    .popup-alert-overlay {
        padding: 1.5rem 1rem;
        align-items: center;
    }
    .popup-alert-card {
        max-width: 420px;
    }
    .popup-alert-body {
        padding: 24px 24px 20px;
    }
    .popup-alert-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 14px;
    }
    .popup-alert-icon i {
        font-size: 22px;
    }
    .popup-alert-message {
        margin-bottom: 18px;
    }
}

/* iPad xoay dọc — 768px → 991px */
@media (max-width: 991px) and (min-width: 577px) {
    .popup-alert-overlay {
        padding: 2rem 1.5rem;
    }
    .popup-alert-card {
        max-width: 400px;
        border-radius: 18px;
    }
    .popup-alert-header {
        padding: 16px 18px;
    }
    .popup-alert-brand-logo {
        height: 32px;
    }
    .popup-alert-body {
        padding: 28px 24px 22px;
    }
}

/* Mobile lớn — 577px → 767px */
@media (max-width: 767px) and (min-width: 577px) {
    .popup-alert-card {
        max-width: 380px;
        border-radius: 16px;
    }
}

/* Mobile — ≤ 576px */
@media (max-width: 576px) {
    .popup-alert-overlay {
        padding: 1rem;
        align-items: flex-end;      /* slide-up từ dưới trên mobile */
    }
    .popup-alert-card {
        max-width: 100%;
        border-radius: 20px 20px 0 0; /* bottom-sheet style */
    }
    .popup-alert-header {
        padding: 14px 16px;
    }
    .popup-alert-brand-logo {
        height: 28px;
    }
    .popup-alert-body {
        padding: 24px 20px 18px;
    }
    .popup-alert-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 14px;
    }
    .popup-alert-icon i {
        font-size: 22px;
    }
    .popup-alert-message {
        font-size: 14px;
        margin-bottom: 20px;
    }
    .popup-alert-footer {
        padding: 0 20px 24px;
    }
    .popup-alert-btn {
        height: 48px;
        font-size: 13px;
    }
}

/* Mobile nhỏ — ≤ 375px */
@media (max-width: 375px) {
    .popup-alert-body {
        padding: 20px 16px 16px;
    }
    .popup-alert-footer {
        padding: 0 16px 20px;
    }
    .popup-alert-message {
        font-size: 13px;
    }
}
