*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


/* ── Overlay ── */
.popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.popup-overlay.show {
    display: flex;
}

.popup-box {
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 24px;
    padding: 48px 40px 36px;
    width: 340px;
    text-align: center;
    box-shadow: 0 32px 80px rgba(0, 0, 0, .5);
    animation: popIn .08s cubic-bezier(.34, 1.56, .64, 1) forwards;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(.75) translateY(20px);
    }

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

/* ── Icon ring ── */
.icon-ring {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* SUCCESS */
.popup-success .icon-ring {
    background: radial-gradient(circle at 40% 40%, #1aff9c22, #0aff7811);
    box-shadow: 0 0 0 12px #0aff781a, 0 0 40px #0aff7840;
}

.popup-success .icon-ring svg circle.track {
    stroke: #0aff7830;
}

.popup-success .icon-ring svg circle.progress {
    stroke: #3eeb46;
  animation: ringFill .2s .05s ease forwards;
}

.popup-success .check {
    stroke: #0aff78;
    filter: drop-shadow(0 0 6px #0aff78);
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
  animation: drawCheck .2s .05s ease forwards;
}

/* ERROR */
.popup-error .icon-ring {
    background: radial-gradient(circle at 40% 40%, #ff4d4d22, #ff000011);
    box-shadow: 0 0 0 12px #ff00001a, 0 0 40px #ff000040;
}

.popup-error .icon-ring svg circle.track {
    stroke: #ff000030;
}

.popup-error .icon-ring svg circle.progress {
    stroke: #ff4d4d;
animation: ringFill .2s .05s ease forwards;
}

.popup-error .xmark {
    stroke: #ff4d4d;
    filter: drop-shadow(0 0 6px #ff4d4d);
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: drawCheck .4s .65s ease forwards;
}

/* WARNING */
.popup-warning .icon-ring {
    background: radial-gradient(circle at 40% 40%, #ffcc0022, #ff990011);
    box-shadow: 0 0 0 12px #ffcc001a, 0 0 40px #ffcc0040;
}

.popup-warning .icon-ring svg circle.track {
    stroke: #ffcc0030;
}

.popup-warning .icon-ring svg circle.progress {
    stroke: #ffcc00;
   animation: ringFill .1s .05s ease forwards;
}

.popup-warning .warn-icon {
    stroke: #ffcc00;
    filter: drop-shadow(0 0 6px #ffcc00);
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: drawCheck .1s .25s ease forwards;
}

@keyframes ringFill {
    from {
        stroke-dashoffset: 220;
    }

    to {
        stroke-dashoffset: 0;
    }
}

@keyframes drawCheck {
    to {
        stroke-dashoffset: 0;
    }
}

/* SVG progress ring */
.ring-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-svg circle {
    fill: none;
    stroke-width: 3;
    cx: 44;
    cy: 44;
    r: 35;
    stroke-dasharray: 220;
    stroke-dashoffset: 220;
    stroke-linecap: round;
}

.ring-svg circle.track {
    stroke-dashoffset: 0;
}

/* inner icon */
.inner-icon {
    position: relative;
    z-index: 1;
}

/* ── Text ── */
.popup-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 8px;
    opacity: 0;
   animation: fadeUp .15s .1s ease forwards;
}

.popup-message {
    font-size: .95rem;
    color: rgba(72, 71, 71, 0.5);
    line-height: 1.6;
    opacity: 0;
    animation: fadeUp .15s .15s ease forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

/* ── Buttons ── */
.popup-buttons {
    margin-top: 28px;
    display: flex;
    gap: 10px;
    justify-content: center;
    opacity: 0;
  animation: fadeUp .15s .2s ease forwards;
}

.btn-popup {
    padding: 10px 28px;
    border-radius: 50px;
    border: none;
    font-family: 'Sarabun', sans-serif;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}

.btn-popup:hover {
    transform: translateY(-2px);
}

.btn-popup:active {
    transform: translateY(0);
}

.btn-ok-success {
    background: linear-gradient(135deg, #0aff78, #00cc5a);
    color: #0a1a12;
    box-shadow: 0 4px 20px #0aff7850;
}

.btn-ok-error {
    background: linear-gradient(135deg, #ff4d4d, #cc0000);
    color: #fff;
    box-shadow: 0 4px 20px #ff000050;
}

.btn-ok-warning {
    background: linear-gradient(135deg, #ffcc00, #ff9900);
    color: #1a1200;
    box-shadow: 0 4px 20px #ffcc0050;
}

.btn-cancel {
    background: rgba(255, 255, 255, .06);
    color: rgba(0, 0, 0, 0.476);
    border: 1px solid rgba(255, 255, 255, .1);
}

.btn-cancel:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* ── Demo buttons ── */
.demo-btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-family: 'Sarabun', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}

.demo-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}

.demo-success {
    background: linear-gradient(135deg, #0aff78, #00cc5a);
    color: #0a1a12;
}

.demo-error {
    background: linear-gradient(135deg, #ff4d4d, #cc0000);
    color: #fff;
}

.demo-warning {
    background: linear-gradient(135deg, #ffcc00, #ff9900);
    color: #1a1200;
}

@keyframes dotFade {
    to {
        opacity: 1;
    }
}


.popup-decision .icon-ring {
    background: radial-gradient(circle at 40% 40%, #6d5cff22, #4f46e511);
    box-shadow: 0 0 0 12px #6d5cff1a, 0 0 40px #6d5cff40;
}

.popup-decision .icon-ring svg circle.track {
    stroke: #6d5cff30;
}

.popup-decision .icon-ring svg circle.progress {
    stroke: #6d5cff;
}

.popup-decision .inner-icon {
    stroke: #6d5cff;
    filter: drop-shadow(0 0 6px #6d5cff);
}

.btn-ok-decision {
    background: linear-gradient(135deg, #6d5cff, #4f46e5);
    color: white;
    box-shadow: 0 4px 20px #6d5cff50;
}
.popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(255,255,255,.6);
    font-size: 24px;
    cursor: pointer;
    transition: .2s;
}

.popup-close:hover {
    color: white;
    transform: scale(1.1);
}

