/* Contact form success celebration */

.fp-celebrate
{
    position: fixed;
    inset: 0;
    /* Between MDB backdrop (~1050) and modal (~1055) so notes play behind the dialog */
    z-index: 1052;
    pointer-events: none;
    overflow: hidden;
}

.fp-celebrate-note
{
    position: absolute;
    bottom: -2rem;
    left: var(--x, 50%);
    font-weight: 700;
    line-height: 1;
    opacity: 0;
    text-shadow: 0 2px 8px rgba(0, 60, 94, 0.2);
    animation: fpCelebrateRise var(--duration, 3s) var(--delay, 0s) ease-out forwards;
    will-change: transform, opacity;
}

.fp-celebrate-burst
{
    position: absolute;
    left: var(--origin-x, 50%);
    top: var(--origin-y, 50%);
    font-weight: 700;
    line-height: 1;
    opacity: 0;
    text-shadow: 0 2px 10px rgba(0, 60, 94, 0.25);
    animation: fpCelebrateBurst var(--duration, 2.4s) var(--delay, 0s) cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
    will-change: transform, opacity;
}

@keyframes fpCelebrateRise
{
    0%
    {
        opacity: 0;
        transform: translate3d(0, 0, 0) rotate(0deg) scale(0.6);
    }
    12%
    {
        opacity: 0.95;
    }
    100%
    {
        opacity: 0;
        transform: translate3d(var(--drift, 0px), -110vh, 0) rotate(var(--spin, 40deg)) scale(1);
    }
}

@keyframes fpCelebrateBurst
{
    0%
    {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.2) rotate(0deg);
    }
    15%
    {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.15) rotate(calc(var(--spin, 40deg) * 0.2));
    }
    100%
    {
        opacity: 0;
        transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, -120px))) rotate(var(--spin, 40deg)) scale(0.75);
    }
}

/* Success modal flourish */
.fp-modal-flourish
{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.fp-modal-flourish-icon
{
    position: relative;
    width: 4.25rem;
    height: 4.25rem;
    border-radius: 50%;
    background: linear-gradient(145deg, #003C5E 0%, #269EDE 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    box-shadow: 0 8px 24px rgba(0, 60, 94, 0.28);
    animation: fpModalPulse 1.6s ease-in-out infinite;
}

.fp-modal-flourish-notes
{
    display: flex;
    gap: 0.55rem;
    font-size: 1.35rem;
    line-height: 1;
    color: #269EDE;
}

.fp-modal-flourish-notes span
{
    display: inline-block;
    animation: fpModalNoteBob 0.9s ease-in-out infinite;
}

.fp-modal-flourish-notes span:nth-child(2) { animation-delay: 0.12s; color: #00ccff; }
.fp-modal-flourish-notes span:nth-child(3) { animation-delay: 0.24s; color: #003C5E; }
.fp-modal-flourish-notes span:nth-child(4) { animation-delay: 0.36s; color: #269EDE; }
.fp-modal-flourish-notes span:nth-child(5) { animation-delay: 0.48s; color: #00ccff; }

@keyframes fpModalPulse
{
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

@keyframes fpModalNoteBob
{
    0%, 100% { transform: translateY(0); opacity: 0.85; }
    50% { transform: translateY(-6px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce)
{
    .fp-celebrate-note,
    .fp-celebrate-burst,
    .fp-modal-flourish-icon,
    .fp-modal-flourish-notes span
    {
        animation: none !important;
    }

    .fp-celebrate
    {
        display: none;
    }
}
