/* ══════════════════════════════════════
   FRONTEND POPUP — centered, animated
   Matches the site's dark + orange theme
══════════════════════════════════════ */

.pop-backdrop {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(5, 5, 5, 0.75);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}
.pop-backdrop.open { opacity: 1; visibility: visible; }

.pop {
    --pop-accent: #4ade80;
    width: 100%;
    max-width: 440px;
    background: linear-gradient(150deg, #141414, #1b1b1b);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 20px;
    padding: 2.25rem 1.9rem 1.75rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
    transform: scale(0.9) translateY(16px);
    opacity: 0;
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.34s ease;
}
.pop-backdrop.open .pop { transform: scale(1) translateY(0); opacity: 1; }

/* Accent wash behind the icon */
.pop::before {
    content: '';
    position: absolute;
    top: -100px; left: 50%;
    transform: translateX(-50%);
    width: 260px; height: 260px;
    background: radial-gradient(circle, var(--pop-accent) 0%, transparent 70%);
    opacity: 0.14;
    pointer-events: none;
}
.pop::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--pop-accent), transparent);
    opacity: 0.5;
}

/* Error variant */
.pop-backdrop.is-error .pop { --pop-accent: #f87171; }

.pop-ico {
    width: 66px; height: 66px;
    margin: 0 auto 1.2rem;
    display: grid; place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--pop-accent) 13%, transparent);
    border: 1px solid color-mix(in srgb, var(--pop-accent) 38%, transparent);
    color: var(--pop-accent);
    position: relative;
    animation: popIcoIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}
@keyframes popIcoIn {
    from { transform: scale(0.35); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* Pulsing halo */
.pop-ico::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    border: 1px solid var(--pop-accent);
    animation: popRing 1.9s ease-out infinite;
}
@keyframes popRing {
    0%   { transform: scale(1);    opacity: 0.5; }
    100% { transform: scale(1.55); opacity: 0; }
}

/* Swap the glyph by variant */
.pop-tick { width: 32px; height: 32px; }
.pop-tick path {
    fill: none;
    stroke: currentColor;
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: popTick 0.55s ease 0.34s forwards;
}
@keyframes popTick { to { stroke-dashoffset: 0; } }

.pop-bang {
    display: none;
    font-family: 'Sora', sans-serif;
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1;
}
.pop-backdrop.is-error .pop-tick { display: none; }
.pop-backdrop.is-error .pop-bang { display: block; }

.pop-title {
    font-family: 'Sora', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
}
.pop-text {
    font-size: 0.88rem;
    color: #888;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* Validation error list */
.pop-list {
    list-style: none;
    text-align: left;
    margin: 0 0 1.5rem;
    padding: 0.9rem 1rem;
    background: rgba(248, 113, 113, 0.06);
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.pop-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.81rem;
    color: #bbb;
    line-height: 1.55;
}
.pop-list li::before {
    content: '•';
    color: #f87171;
    font-weight: 700;
    flex-shrink: 0;
}

.pop-btn {
    width: 100%;
    background: var(--pop-accent);
    color: #0a0a0a;
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 13px 24px;
    border: none;
    border-radius: 11px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: filter 0.2s, transform 0.15s;
}
.pop-btn:hover { filter: brightness(1.1); }
.pop-btn:active { transform: translateY(1px); }

.pop-close {
    position: absolute;
    top: 14px; right: 16px;
    background: none;
    border: none;
    color: #666;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}
.pop-close:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

/* Auto-dismiss progress bar (success only) */
.pop-timer {
    position: absolute;
    bottom: 0; left: 0;
    height: 2px;
    width: 100%;
    background: var(--pop-accent);
    transform-origin: left;
    z-index: 1;
}
.pop-timer.run { animation: popTimer 4s linear forwards; }
@keyframes popTimer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (max-width: 480px) {
    .pop { padding: 1.9rem 1.35rem 1.5rem; }
    .pop-title { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
    .pop-backdrop, .pop { transition: none; }
    .pop-ico, .pop-ico::after, .pop-timer.run { animation: none; }
    .pop-tick path { animation: none; stroke-dashoffset: 0; }
}
