/* ============================================
   ReservasiWisata — branded toast & dialog
   Shared look for public + private apps
   ============================================ */

@keyframes rw-toast-in {
    from { opacity: 0; transform: translateY(-18px) scale(.94); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes rw-toast-out {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(-10px) scale(.96); }
}
@keyframes rw-dialog-in {
    from { opacity: 0; transform: translateY(16px) scale(.94); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes rw-dialog-out {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(10px) scale(.96); }
}
@keyframes rw-toast-ring {
    0%   { box-shadow: 0 0 0 0 rgba(0, 100, 210, .35); }
    70%  { box-shadow: 0 0 0 8px rgba(0, 100, 210, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 100, 210, 0); }
}

/* ---- Toast container: tepat di bawah header, full-width, center ---- */
.rw-toast-container.swal2-container,
body.swal2-toast-shown .rw-toast-container.swal2-container,
body.swal2-toast-shown .rw-toast-container.swal2-container.swal2-top {
    position: fixed !important;
    inset: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    transform: none !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    grid-template-areas: none !important;
    padding: var(--rw-toast-top, 88px) 16px 16px !important;
    box-sizing: border-box !important;
    z-index: 1080 !important;
    background: transparent !important;
    pointer-events: none !important;
    overflow: visible !important;
}
.rw-toast-container.swal2-container > .rw-toast,
.rw-toast-container.swal2-container > .swal2-popup {
    pointer-events: auto !important;
    grid-column: auto !important;
    place-self: auto !important;
    margin: 0 auto !important;
    width: min(400px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
}

/* ---- Toast ---- */
.rw-toast.swal2-popup.swal2-toast {
    --rw-toast-accent: #0064D2;
    background: #ffffff !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow:
        0 12px 36px rgba(0, 100, 210, .18),
        0 2px 10px rgba(15, 23, 42, .08) !important;
    border: 1px solid rgba(0, 100, 210, .18) !important;
    border-radius: 16px !important;
    padding: 0 !important;
    min-width: 0 !important;
    width: min(400px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    position: relative !important;
    box-sizing: border-box !important;
}
.rw-toast.swal2-popup.swal2-toast::before {
    display: none !important;
}
.rw-toast.swal2-popup.swal2-toast::after {
    display: none !important;
}
.rw-toast-success { --rw-toast-accent: #198754; }
.rw-toast-error,
.rw-toast-danger { --rw-toast-accent: #dc3545; }
.rw-toast-warning { --rw-toast-accent: #d97706; }
.rw-toast-info,
.rw-toast-question { --rw-toast-accent: #0064D2; }

.rw-toast .swal2-html-container.rw-toast-html {
    margin: 0 !important;
    padding: 14px 16px 13px 16px !important;
    text-align: left !important;
    overflow: visible !important;
    position: relative;
    z-index: 1;
}
.rw-toast-inner {
    display: flex;
    align-items: center;
    gap: 14px;
}
.rw-toast-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.15rem;
    background: #e8f0fe;
    color: var(--rw-toast-accent);
    border: 2px solid rgba(0, 100, 210, .2);
    animation: rw-toast-ring 1.4s ease-out 1;
}
.rw-toast-success .rw-toast-icon {
    background: #e8f7ef;
    border-color: rgba(25, 135, 84, .25);
}
.rw-toast-error .rw-toast-icon,
.rw-toast-danger .rw-toast-icon {
    background: #fdecec;
    border-color: rgba(220, 53, 69, .25);
}
.rw-toast-warning .rw-toast-icon {
    background: #fff7e6;
    border-color: rgba(217, 119, 6, .28);
}
.rw-toast-info .rw-toast-icon,
.rw-toast-question .rw-toast-icon {
    background: #e8f0fe;
    border-color: rgba(0, 100, 210, .22);
}
.rw-toast-copy {
    min-width: 0;
    flex: 1;
}
.rw-toast-label {
    display: inline-flex;
    align-items: center;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--rw-toast-accent);
    line-height: 1.2;
    background: #e8f0fe;
    padding: 3px 9px;
    border-radius: 999px;
}
.rw-toast-success .rw-toast-label { background: #e8f7ef; }
.rw-toast-error .rw-toast-label,
.rw-toast-danger .rw-toast-label { background: #fdecec; }
.rw-toast-warning .rw-toast-label { background: #fff7e6; }
.rw-toast-msg {
    display: block;
    font-size: .9rem;
    font-weight: 500;
    color: #1a1a2e;
    line-height: 1.4;
    word-break: break-word;
    margin-top: 5px;
}
.rw-toast .swal2-timer-progress-bar.rw-toast-bar {
    background: linear-gradient(90deg, #0064D2, #00bcd4) !important;
    height: 3px !important;
    opacity: 1;
}
.rw-toast-success .swal2-timer-progress-bar.rw-toast-bar {
    background: linear-gradient(90deg, #198754, #00bcd4) !important;
}
.rw-toast-error .swal2-timer-progress-bar.rw-toast-bar,
.rw-toast-danger .swal2-timer-progress-bar.rw-toast-bar {
    background: linear-gradient(90deg, #dc3545, #f59e0b) !important;
}
.rw-toast-warning .swal2-timer-progress-bar.rw-toast-bar {
    background: linear-gradient(90deg, #d97706, #fbbf24) !important;
}
.rw-toast .swal2-timer-progress-bar-container {
    position: relative !important;
    height: 3px !important;
    background: #e8f0fe !important;
    overflow: hidden;
    border-radius: 0 0 16px 16px;
    z-index: 1;
}
.rw-toast-in { animation: rw-toast-in .36s cubic-bezier(.22, 1, .36, 1) both; }
.rw-toast-out { animation: rw-toast-out .22s ease both; }

.rw-toast.swal2-toast .swal2-icon,
.rw-toast.swal2-toast .swal2-title,
.rw-toast.swal2-toast .swal2-success,
.rw-toast.swal2-toast .swal2-error {
    display: none !important;
}

/* ---- Dialog / confirm ---- */
.rw-dialog-container.swal2-container {
    position: fixed !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 200000 !important;
    padding: 16px !important;
    background: rgba(15, 23, 42, .45) !important;
    /* hindari backdrop-filter di container — bisa blokir klik di beberapa browser */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    pointer-events: auto !important;
    overflow: auto !important;
}

.rw-dialog.swal2-popup {
    width: min(400px, calc(100vw - 32px)) !important;
    padding: 0 0 22px !important;
    border-radius: 20px !important;
    border: 1px solid rgba(15, 23, 42, .06) !important;
    box-shadow: 0 24px 64px rgba(15, 23, 42, .22) !important;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    overflow: hidden !important;
    background: #fff !important;
    position: relative !important;
    z-index: 1 !important;
    pointer-events: auto !important;
}
.rw-dialog.swal2-show {
    animation: rw-dialog-in .32s cubic-bezier(.22, 1, .36, 1) both !important;
}
.rw-dialog.swal2-hide {
    animation: rw-dialog-out .2s ease-in both !important;
}
.rw-dialog.swal2-popup::before {
    content: '';
    display: block;
    height: 5px;
    width: 100%;
    background: linear-gradient(90deg, #0064D2 0%, #00bcd4 100%);
    pointer-events: none !important;
}
.rw-dialog-danger.swal2-popup::before,
.rw-dialog-warning.swal2-popup::before {
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 100%);
}
.rw-dialog-success.swal2-popup::before {
    background: linear-gradient(90deg, #10b981 0%, #00bcd4 100%);
}

.rw-dialog .swal2-icon.rw-dialog-icon {
    width: 64px !important;
    height: 64px !important;
    margin: 22px auto 8px !important;
    border: none !important;
    border-radius: 18px !important;
    background: #e8f0fe !important;
    color: #0064D2 !important;
    font-size: 1.65rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
}
.rw-dialog .swal2-icon.rw-dialog-icon .swal2-icon-content {
    font-size: inherit !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.rw-dialog-success .swal2-icon.rw-dialog-icon {
    background: #ecfdf5 !important;
    color: #059669 !important;
}
.rw-dialog-error .swal2-icon.rw-dialog-icon,
.rw-dialog-danger .swal2-icon.rw-dialog-icon {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}
.rw-dialog-warning .swal2-icon.rw-dialog-icon {
    background: #fffbeb !important;
    color: #d97706 !important;
}
.rw-dialog-info .swal2-icon.rw-dialog-icon,
.rw-dialog-question .swal2-icon.rw-dialog-icon {
    background: #e8f0fe !important;
    color: #0064D2 !important;
}

.rw-dialog .swal2-icon::before,
.rw-dialog .swal2-icon::after,
.rw-dialog .swal2-success-ring,
.rw-dialog .swal2-success-line-tip,
.rw-dialog .swal2-success-line-long,
.rw-dialog .swal2-success-circular-line-left,
.rw-dialog .swal2-success-circular-line-right,
.rw-dialog .swal2-success-fix-fix,
.rw-dialog .swal2-x-mark,
.rw-dialog .swal2-x-mark-line-left,
.rw-dialog .swal2-x-mark-line-right {
    display: none !important;
}

.rw-dialog .swal2-title.rw-dialog-title {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    padding: 4px 24px 0 !important;
    margin: 0 !important;
    line-height: 1.35 !important;
}
.rw-dialog .swal2-html-container.rw-dialog-html {
    margin: 8px 0 0 !important;
    padding: 0 24px !important;
    font-size: .88rem !important;
    color: #64748b !important;
    line-height: 1.5 !important;
    position: relative !important;
    z-index: 1 !important;
    pointer-events: auto !important;
    overflow: visible !important;
}
.rw-dialog-text {
    margin: 0;
    color: #64748b;
    font-size: .88rem;
    line-height: 1.5;
    pointer-events: none;
}
.rw-dialog-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    font-size: .68rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: .02em;
    pointer-events: none;
}
.rw-dialog-brand i {
    color: #0064D2;
    font-size: .85rem;
}

.rw-dialog-actions-custom {
    display: flex !important;
    gap: 10px !important;
    margin: 20px 0 0 !important;
    width: 100% !important;
    position: relative !important;
    z-index: 30 !important;
    pointer-events: auto !important;
}

.rw-dialog .swal2-actions {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: stretch;
    gap: 10px !important;
    margin: 20px 0 0 !important;
    width: 100% !important;
    position: relative !important;
    z-index: 30 !important;
    pointer-events: auto !important;
}

.rw-dialog-btn,
.rw-dialog-actions-custom .rw-dialog-btn {
    flex: 1 1 0;
    border: none !important;
    border-radius: 12px !important;
    padding: 11px 16px !important;
    font-family: inherit !important;
    font-size: .86rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
    position: relative !important;
    z-index: 31 !important;
    pointer-events: auto !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    user-select: none !important;
}
.rw-dialog-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(0, 100, 210, .2) !important;
}
.rw-dialog-btn-cancel {
    background: #f1f5f9 !important;
    color: #334155 !important;
    box-shadow: none !important;
}
.rw-dialog-btn-cancel:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}
.rw-dialog-btn-confirm {
    background: linear-gradient(135deg, #0064D2 0%, #0052ad 100%) !important;
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(0, 100, 210, .28) !important;
}
.rw-dialog-btn-confirm:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}
.rw-dialog-danger .rw-dialog-btn-confirm,
.rw-dialog-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    box-shadow: 0 6px 16px rgba(239, 68, 68, .28) !important;
}

body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) {
    overflow: hidden !important;
}

@media (max-width: 480px) {
    .rw-toast.swal2-popup.swal2-toast,
    .rw-toast-container.swal2-container > .rw-toast,
    .rw-toast-container.swal2-container > .swal2-popup {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        border-radius: 14px !important;
    }
    .rw-toast-container.swal2-container,
    body.swal2-toast-shown .rw-toast-container.swal2-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .rw-toast-icon {
        width: 38px;
        height: 38px;
        font-size: 1.05rem;
    }
    .rw-toast-msg { font-size: .86rem; }
    .rw-dialog-actions-custom {
        flex-direction: column-reverse;
    }
    .rw-dialog-btn { width: 100%; }
}

/* ============================================================
   CUSTOM CONFIRM DIALOG — tanpa SweetAlert2, 100% native DOM
   ============================================================ */
.rw-cdlg-overlay {
    position: fixed;
    inset: 0;
    z-index: 300000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0);
    transition: background .22s ease;
}
.rw-cdlg-overlay.rw-cdlg-open {
    background: rgba(15, 23, 42, .45);
}
.rw-cdlg-overlay.rw-cdlg-closing {
    background: rgba(15, 23, 42, 0);
}

.rw-cdlg-card {
    width: min(400px, calc(100vw - 32px));
    background: #fff;
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, .06);
    box-shadow: 0 24px 64px rgba(15, 23, 42, .22);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;
    text-align: center;
    padding-bottom: 22px;
    opacity: 0;
    transform: scale(.92) translateY(10px);
    transition: opacity .25s ease, transform .25s cubic-bezier(.22, 1, .36, 1);
}
.rw-cdlg-open .rw-cdlg-card {
    opacity: 1;
    transform: scale(1) translateY(0);
}
.rw-cdlg-closing .rw-cdlg-card {
    opacity: 0;
    transform: scale(.94) translateY(6px);
    transition: opacity .18s ease, transform .18s ease;
}

.rw-cdlg-bar {
    height: 5px;
    width: 100%;
    background: linear-gradient(90deg, #0064D2 0%, #00bcd4 100%);
}
.rw-cdlg-danger .rw-cdlg-bar,
.rw-cdlg-warning .rw-cdlg-bar {
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 100%);
}
.rw-cdlg-success .rw-cdlg-bar {
    background: linear-gradient(90deg, #10b981 0%, #00bcd4 100%);
}

.rw-cdlg-icon {
    width: 64px;
    height: 64px;
    margin: 22px auto 8px;
    border-radius: 18px;
    background: #e8f0fe;
    color: #0064D2;
    font-size: 1.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rw-cdlg-danger .rw-cdlg-icon {
    background: #fef2f2;
    color: #ef4444;
}
.rw-cdlg-warning .rw-cdlg-icon {
    background: #fffbeb;
    color: #f59e0b;
}
.rw-cdlg-success .rw-cdlg-icon {
    background: #ecfdf5;
    color: #10b981;
}

.rw-cdlg-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    padding: 4px 24px 0;
    margin: 0;
    line-height: 1.35;
}
.rw-cdlg-text {
    margin: 8px 24px 0;
    font-size: .88rem;
    color: #64748b;
    line-height: 1.5;
}
.rw-cdlg-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    font-size: .68rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: .02em;
}
.rw-cdlg-brand i { color: #0064D2; font-size: .85rem; }

.rw-cdlg-actions {
    display: flex;
    gap: 10px;
    margin: 20px 24px 0;
}

.rw-cdlg-btn {
    flex: 1 1 0;
    border: none;
    border-radius: 12px;
    padding: 11px 16px;
    font-family: inherit;
    font-size: .86rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.rw-cdlg-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 100, 210, .2);
}
.rw-cdlg-btn:active {
    transform: scale(.96);
}
.rw-cdlg-btn-cancel {
    background: #f1f5f9;
    color: #334155;
}
.rw-cdlg-btn-cancel:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.rw-cdlg-btn-confirm {
    background: linear-gradient(135deg, #0064D2 0%, #0052ad 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 100, 210, .28);
}
.rw-cdlg-btn-confirm:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}
.rw-cdlg-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 6px 16px rgba(239, 68, 68, .28);
}

@media (max-width: 480px) {
    .rw-cdlg-actions {
        flex-direction: column-reverse;
    }
    .rw-cdlg-btn { width: 100%; }
}
