/*
 * Floating discovery pill — a compact bottom-right CTA with subtle layered
 * animations. Motion: (1) a soft halo that breathes so the pill stays alive
 * in peripheral vision, (2) a slow shimmer sweeping through the surface every
 * few seconds to catch the eye, (3) a 4-dot QR-inspired icon cycling through
 * opacity, (4) an arrow that nudges forward periodically. None of these are
 * so loud that the pill turns into a circus; each only fires a short window.
 */

.qrrq-fp-wrap {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;

    opacity: 0;
    transform: translateX(calc(100% + 40px));
    transition:
        opacity 0.4s ease,
        transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}
.qrrq-fp-wrap.is-visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

@media (max-width: 900px) { .qrrq-fp-wrap { display: none !important; } }
@media print              { .qrrq-fp-wrap { display: none !important; } }

/* ─── The pill ─── */
.qrrq-fp {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 18px 13px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0F2C27 0%, #2B6F67 55%, #3A8A81 100%);
    color: #fff !important;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.005em;
    text-decoration: none !important;
    overflow: hidden;
    isolation: isolate;

    /* Layered shadow: tight + outer halo breathes below */
    box-shadow:
        0 6px 14px rgba(15, 44, 39, 0.32),
        0 0 0 0 rgba(94, 230, 208, 0.4);
    animation: qrrq-fp-halo 2.8s ease-in-out infinite;

    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
}
.qrrq-fp:hover {
    transform: translateY(-2px);
    box-shadow:
        0 14px 30px rgba(15, 44, 39, 0.4),
        0 0 0 8px rgba(94, 230, 208, 0.18);
}
.qrrq-fp:focus-visible {
    outline: 2px solid #5EE6D0;
    outline-offset: 3px;
}

/* Breathing halo — goes out and back periodically */
@keyframes qrrq-fp-halo {
    0%, 100% {
        box-shadow:
            0 6px 14px rgba(15, 44, 39, 0.32),
            0 0 0 0 rgba(94, 230, 208, 0.4);
    }
    50% {
        box-shadow:
            0 6px 14px rgba(15, 44, 39, 0.32),
            0 0 0 14px rgba(94, 230, 208, 0);
    }
}

/* ─── Shimmer sweep inside the pill ─── */
.qrrq-fp-shimmer {
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(100deg,
        transparent 0%,
        rgba(255, 255, 255, 0.0) 30%,
        rgba(255, 255, 255, 0.28) 50%,
        rgba(255, 255, 255, 0.0) 70%,
        transparent 100%);
    transform: skewX(-18deg);
    animation: qrrq-fp-shimmer 3.6s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}
@keyframes qrrq-fp-shimmer {
    0%, 30%, 100% { left: -60%; }
    55%           { left: 120%; }
}

/* ─── 4-dot QR icon (left of text) ─── */
.qrrq-fp-icon {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.qrrq-fp-dot {
    background: #5EE6D0;
    border-radius: 2px;
    animation: qrrq-fp-dot-pulse 2s ease-in-out infinite;
}
.qrrq-fp-dot:nth-child(1) { animation-delay: 0s;   }
.qrrq-fp-dot:nth-child(2) { animation-delay: 0.25s;}
.qrrq-fp-dot:nth-child(3) { animation-delay: 0.75s;}
.qrrq-fp-dot:nth-child(4) { animation-delay: 0.5s; }
@keyframes qrrq-fp-dot-pulse {
    0%, 100% { opacity: 0.35; transform: scale(0.85); }
    50%      { opacity: 1;    transform: scale(1);    }
}

/* ─── Text ─── */
.qrrq-fp-text {
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

/* ─── Arrow nudge ─── */
.qrrq-fp-arrow {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    color: #fff;
    animation: qrrq-fp-arrow-nudge 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes qrrq-fp-arrow-nudge {
    0%, 70%, 100% { transform: translateX(0); }
    85%           { transform: translateX(4px); }
}
.qrrq-fp:hover .qrrq-fp-arrow {
    animation: none;
    transform: translateX(3px);
    transition: transform 0.2s ease;
}

/* ─── Close button (sits above the pill, top-right corner) ─── */
.qrrq-fp-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    color: #64748B;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
}
.qrrq-fp-wrap:hover .qrrq-fp-close,
.qrrq-fp-close:focus-visible {
    opacity: 1;
    transform: scale(1);
}
.qrrq-fp-close:hover {
    color: #0F172A;
    background: #F3F4F6;
}

/* ─── Reduced motion: stop all animations, keep the pill visible ─── */
@media (prefers-reduced-motion: reduce) {
    .qrrq-fp,
    .qrrq-fp-shimmer,
    .qrrq-fp-dot,
    .qrrq-fp-arrow {
        animation: none !important;
    }
}
