/*
 * Checkout Page Styles
 */

.wishly-checkout {
    min-height: calc(100vh - var(--w-header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--w-space-12) 0;
}

.wishly-checkout__card {
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
}

.wishly-checkout__header {
    text-align: center;
    margin-bottom: var(--w-space-8);
}

.wishly-checkout__icon {
    font-size: 3rem;
    margin-bottom: var(--w-space-4);
}

.wishly-checkout__title {
    font-size: var(--w-text-3xl);
    font-weight: 800;
    margin-bottom: var(--w-space-2);
}

.wishly-checkout__subtitle {
    color: var(--w-text-secondary);
    font-size: var(--w-text-base);
}

.wishly-checkout__form {
    display: flex;
    flex-direction: column;
    gap: var(--w-space-5);
}

.wishly-checkout__divider {
    height: 1px;
    background: var(--w-border-primary);
    margin: var(--w-space-2) 0;
}

.wishly-checkout__terms {
    font-size: var(--w-text-sm);
    color: var(--w-text-secondary);
    line-height: var(--w-leading-relaxed);
}

.wishly-checkout__terms a {
    color: var(--w-accent);
    text-decoration: underline;
}

.wishly-checkout__submit {
    margin-top: var(--w-space-4);
}

/* Product preview in checkout */
.wishly-checkout__product {
    display: flex;
    align-items: center;
    gap: var(--w-space-4);
    padding: var(--w-space-4);
    background: var(--w-bg-card);
    border: 1px solid var(--w-border-primary);
    border-radius: var(--w-radius-xl);
    margin-bottom: var(--w-space-6);
}

.wishly-checkout__product-image {
    width: 64px;
    height: 64px;
    border-radius: var(--w-radius-lg);
    background: var(--w-gradient-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.wishly-checkout__product-name {
    font-weight: 600;
    font-size: var(--w-text-base);
}

.wishly-checkout__product-category {
    font-size: var(--w-text-xs);
    color: var(--w-text-tertiary);
}

/* ── Mobile Responsive ──────────────────────────── */
@media (max-width: 768px) {
    .wishly-checkout {
        align-items: flex-start;
        padding: var(--w-space-6) var(--w-space-4);
    }

    .wishly-checkout__card {
        max-width: 100%;
    }

    .wishly-checkout__title {
        font-size: var(--w-text-2xl);
    }
}

@media (max-width: 480px) {
    .wishly-checkout {
        padding: var(--w-space-4) var(--w-space-3);
    }

    .wishly-checkout__icon {
        font-size: 2.25rem;
    }

    .wishly-checkout__title {
        font-size: var(--w-text-xl);
    }

    .wishly-checkout__product {
        gap: var(--w-space-3);
        padding: var(--w-space-3);
    }

    .wishly-checkout__product-image {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .wishly-checkout__form {
        gap: var(--w-space-4);
    }
}

/* ── Success State ───────────────────────────────── */
.wishly-checkout__success {
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Glowing animated border when success panel is active */
.wishly-checkout__success.wly-success-active {
    border-color: rgba(124, 58, 237, 0.6) !important;
    animation: wly-success-glow-border 2.5s ease-in-out infinite alternate;
}

@keyframes wly-success-glow-border {
    from {
        box-shadow:
            0 0 0 1px rgba(124, 58, 237, 0.4),
            0 0 30px rgba(124, 58, 237, 0.25),
            0 0 60px rgba(124, 58, 237, 0.1);
    }
    to {
        box-shadow:
            0 0 0 1px rgba(168, 85, 247, 0.7),
            0 0 50px rgba(124, 58, 237, 0.45),
            0 0 100px rgba(124, 58, 237, 0.2),
            0 0 160px rgba(124, 58, 237, 0.08);
    }
}

/* Background shimmer sweep across the card */
.wishly-checkout__success.wly-success-active::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(124, 58, 237, 0.06) 50%,
        rgba(168, 85, 247, 0.1) 55%,
        transparent 65%
    );
    background-size: 200% 100%;
    animation: wly-shimmer-sweep 3s ease-in-out infinite;
    pointer-events: none;
    border-radius: inherit;
    z-index: 0;
}

@keyframes wly-shimmer-sweep {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Keep content above the shimmer pseudo-element */
.wishly-checkout__success > * {
    position: relative;
    z-index: 1;
}

/* ── Success title shimmer text ───────────────────── */
.wishly-success-title.wly-title-shine {
    background: linear-gradient(
        90deg,
        #f5f5f7 20%,
        #a78bfa 40%,
        #f5f5f7 60%,
        #a78bfa 80%,
        #f5f5f7 100%
    );
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: wly-title-shimmer 3s linear infinite;
}

@keyframes wly-title-shimmer {
    0%   { background-position: 0% center; }
    100% { background-position: 300% center; }
}

/* ── Wish code glow pulse ─────────────────────────── */
.wishly-wish-code.wly-code-glow {
    animation: wly-code-pulse 1.8s ease-in-out infinite;
    display: inline-block;
}

@keyframes wly-code-pulse {
    0%, 100% {
        text-shadow: 0 0 8px rgba(124, 58, 237, 0.5);
        color: #a78bfa;
    }
    50% {
        text-shadow: 0 0 20px rgba(168, 85, 247, 0.9), 0 0 40px rgba(124, 58, 237, 0.4);
        color: #c4b5fd;
    }
}

/* ── Sparkle stars floating around the card ───────── */
.wly-sparkle {
    position: absolute;
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 2;
    animation: wly-sparkle-float 3s ease-in-out infinite;
    user-select: none;
}

@keyframes wly-sparkle-float {
    0%   { transform: translateY(0)   scale(1)    rotate(0deg);   opacity: 0.7; }
    33%  { transform: translateY(-10px) scale(1.2)  rotate(15deg);  opacity: 1; }
    66%  { transform: translateY(-4px)  scale(0.9)  rotate(-8deg);  opacity: 0.8; }
    100% { transform: translateY(0)   scale(1)    rotate(0deg);   opacity: 0.7; }
}

/* ── Floating XP / coins badge ─────────────────────── */
.wly-xp-float {
    position: fixed;
    font-size: 1rem;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 999px;
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
    animation: wly-xp-rise 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.wly-xp-float--xp {
    background: rgba(124, 58, 237, 0.9);
    color: #fff;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.6);
}

.wly-xp-float--coins {
    background: rgba(217, 119, 6, 0.9);
    color: #fff;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
}

@keyframes wly-xp-rise {
    0%   { opacity: 0; transform: translateY(0)    scale(0.6); }
    20%  { opacity: 1; transform: translateY(-20px) scale(1.15); }
    70%  { opacity: 1; transform: translateY(-70px) scale(1); }
    100% { opacity: 0; transform: translateY(-120px) scale(0.8); }
}

/* ── Staggered button entrance ───────────────────── */
.wly-btn-enter {
    animation: wly-btn-slide-up 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes wly-btn-slide-up {
    from { opacity: 0; transform: translateY(24px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── Wish code row entrance ───────────────────────── */
.wishly-wish-code-row {
    animation: wly-code-enter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

@keyframes wly-code-enter {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

/* ── Success text entrance ───────────────────────── */
.wishly-success-text {
    animation: wly-fade-slide-in 0.5s ease 0.15s both;
}

@keyframes wly-fade-slide-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── No payment badge ───────────────────────────── */
.wishly-checkout__free {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--w-space-2);
    padding: var(--w-space-3) var(--w-space-4);
    background: var(--w-success-light);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--w-radius-lg);
    font-size: var(--w-text-sm);
    font-weight: 600;
    color: var(--w-success);
}
