/* static/css/funnel/loading_animations.css */

/* ── Shared overlay ──────────────────────────────────────── */
.pf-loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 24px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.35s ease;
    overflow: hidden;
}
.pf-loader-overlay.visible { opacity: 1; }

/* ════════════════════════════════════════════════════════════
   SCREEN 1 — Analyzing results (dark, music-themed)
   ════════════════════════════════════════════════════════════ */
.pf-analyzing-overlay {
    background: linear-gradient(155deg, #0c0818 0%, #160e2a 45%, #0a1520 100%);
}

/* Floating notes */
.pf-notes-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.pf-note {
    position: absolute;
    opacity: 0;
    animation: pfNoteRise linear infinite;
    user-select: none;
    pointer-events: none;
    will-change: transform, opacity;
}
@keyframes pfNoteRise {
    0%   { transform: translateY(0)      rotate(-8deg);  opacity: 0;   }
    8%   { opacity: 0.55; }
    88%  { opacity: 0.2;  }
    100% { transform: translateY(-110vh) rotate(22deg); opacity: 0;   }
}

/* Waveform equaliser bars at bottom */
.pf-eq-wrap {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 32px;
    margin-bottom: 28px;
}
.pf-eq-bar {
    width: 4px;
    border-radius: 2px;
    background: linear-gradient(0deg, #6c5ce7 0%, #a29bfe 100%);
    animation: pfEq ease-in-out infinite alternate;
    transform-origin: bottom;
}
@keyframes pfEq {
    from { height: 4px;  opacity: 0.4; }
    to   { height: 28px; opacity: 1;   }
}

/* Content container */
.pf-analyzing-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pf-analyzing-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #f0ecf8;
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}
.pf-analyzing-subtitle {
    font-size: 0.82rem;
    color: #7a6fa0;
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.5;
}

/* Step list */
.pf-step-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}
.pf-step {
    opacity: 0.28;
    transition: opacity 0.3s;
}
.pf-step.active { opacity: 1; }
.pf-step.done   { opacity: 0.65; }

.pf-step-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}
.pf-step-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #cdc6e8;
}
.pf-step-pct {
    font-size: 0.72rem;
    color: #6b6490;
    min-width: 30px;
    text-align: right;
    transition: color 0.2s;
}
.pf-step-pct.done { color: #a29bfe; font-size: 0.9rem; }
.pf-step-sub {
    font-size: 0.68rem;
    color: #524e6a;
    margin-bottom: 5px;
    line-height: 1.4;
}
.pf-step-track {
    height: 3px;
    background: rgba(255,255,255,0.07);
    border-radius: 2px;
    overflow: hidden;
}
.pf-step-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #5a4dd1 0%, #a29bfe 100%);
    border-radius: 2px;
    transition: width 0.04s linear;
}

/* Trust line */
.pf-analyze-trust {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pf-analyze-trust-stars { color: #00b67a; font-size: 0.85rem; letter-spacing: 2px; }
.pf-analyze-trust-text  { font-size: 0.72rem; color: #6b6490; }


/* ── Desktop centering for both screens ─────────────────────── */
@media (min-width: 640px) {
    .pf-analyzing-inner {
        max-width: 480px;
    }
    .pf-analyzing-title  { font-size: 1.5rem; }
    .pf-analyzing-subtitle { font-size: 0.9rem; }
    .pf-step-label       { font-size: 0.88rem; }
    .pf-step-sub         { font-size: 0.75rem; }

    .pf-prepay-inner {
        max-width: 460px;
    }
    .pf-ring-wrap        { width: 140px; height: 140px; }
    .pf-ring-pct         { font-size: 1.55rem; }
    .pf-prepay-title     { font-size: 1.15rem; }
    .pf-review-card      { max-width: 420px; padding: 18px 20px; }
    .pf-review-title     { font-size: 0.9rem; }
    .pf-review-body      { font-size: 0.82rem; }
    .pf-popup-card       { max-width: 380px; }
}

/* ════════════════════════════════════════════════════════════
   SCREEN 2 — Pre-payment loader (dark, matches brand)
   ════════════════════════════════════════════════════════════ */
.pf-prepay-overlay {
    background: linear-gradient(155deg, #0c0818 0%, #160e2a 45%, #0a1520 100%);
    justify-content: center;
    overflow: hidden;
}

/* Floating notes for pre-payment too */
.pf-prepay-overlay .pf-notes-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Centered content wrapper */
.pf-prepay-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Ring */
.pf-ring-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 18px;
    flex-shrink: 0;
}
.pf-ring-wrap svg { transform: rotate(-90deg); display: block; }
.pf-ring-track {
    fill: none;
    stroke: rgba(255,255,255,0.10);
    stroke-width: 9;
}
.pf-ring-fill {
    fill: none;
    stroke: #a29bfe;
    stroke-width: 9;
    stroke-linecap: round;
    /* r=51 → C≈320.4 */
    stroke-dasharray: 320.4;
    stroke-dashoffset: 320.4;
    transition: stroke-dashoffset 0.28s ease;
}
.pf-ring-pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 800;
    color: #a29bfe;
    letter-spacing: -0.03em;
}

/* Titles */
.pf-prepay-title {
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: #f0ecf8;
    margin-bottom: 4px;
}
.pf-prepay-sub {
    text-align: center;
    font-size: 0.8rem;
    color: #7a6fa0;
    margin-bottom: 18px;
    min-height: 1.1em;
    transition: opacity 0.3s;
}
.pf-prepay-divider {
    width: 100%;
    max-width: 380px;
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 0 auto 14px;
    flex-shrink: 0;
}
.pf-prepay-trust-label {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #a29bfe;
    margin-bottom: 12px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Review card */
.pf-review-card {
    width: 100%;
    max-width: 340px;
    background: rgba(108,92,231,0.12);
    border: 1px solid rgba(162,155,254,0.18);
    border-radius: 14px;
    padding: 14px 16px;
    margin: 0 auto;
    transition: opacity 0.35s ease;
    flex-shrink: 0;
}
.pf-review-stars {
    color: #00b67a;
    font-size: 0.88rem;
    letter-spacing: 2px;
    margin-bottom: 5px;
}
.pf-review-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #f0ecf8;
    margin-bottom: 5px;
    line-height: 1.3;
}
.pf-review-body {
    font-size: 0.76rem;
    color: #9b8fc4;
    line-height: 1.55;
    margin-bottom: 8px;
}
.pf-review-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: #6b6490;
}

/* ── Pop-up question overlay ─────────────────────────────── */
.pf-popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(16, 10, 34, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.pf-popup-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}
.pf-popup-card {
    background: #1e1640;
    border: 1px solid rgba(162,155,254,0.2);
    border-radius: 20px;
    padding: 24px 20px 20px;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
    transform: translateY(16px) scale(0.95);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pf-popup-backdrop.visible .pf-popup-card {
    transform: translateY(0) scale(1);
}
.pf-popup-progress {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 16px;
}
.pf-popup-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    transition: background 0.2s;
}
.pf-popup-dot.active { background: #a29bfe; }
.pf-popup-q {
    font-size: 1rem;
    font-weight: 700;
    color: #f0ecf8;
    text-align: center;
    line-height: 1.4;
    margin-bottom: 18px;
}
.pf-popup-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pf-popup-btn {
    background: rgba(108,92,231,0.15);
    border: 2px solid rgba(162,155,254,0.2);
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #d4cfe8;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.14s, background 0.14s, transform 0.1s;
    outline: none;
    width: 100%;
}
.pf-popup-btn:hover,
.pf-popup-btn:focus {
    border-color: #a29bfe;
    background: rgba(108,92,231,0.30);
    color: #f0ecf8;
    transform: translateY(-1px);
}
.pf-popup-btn:active { transform: translateY(0); }