@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scrollPulse {
    0%,
    100% {
        opacity: 0.3;
        transform: scaleY(0.8);
    }

    50% {
        opacity: 1;
        transform: scaleY(1);
    }
}

@keyframes galleryNavHint {
    0%,
    100% {
        opacity: 0.58;
    }

    50% {
        opacity: 1;
    }
}

.form-group select:focus,
.form-group textarea:focus {
    animation: scaleIn var(--fade-duration) ease-out;
}

/* Button animations */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: var(--color-surface-soft);
    transition: left var(--fade-duration);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(-2px) scale(0.98);
}

/* Hover effects */
.nav-links a {
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-text-muted);
    transition: width var(--fade-duration);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Scroll animations */
.scroll-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--fade-duration), transform var(--fade-duration);
}

.scroll-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Footer animations */
.footer {
    animation: fadeInUp var(--fade-duration) ease-out;
}

.footer-content {
    animation: slideIn var(--fade-duration) ease-out;
}

/* Responsive animations */
@media (max-width: 768px) {
    .hero-content,
    .hero-image {
        animation: fadeInUp var(--fade-duration) ease-out;
    }

    .schedule-timeline::before {
        animation: none;
    }

    .schedule-item::before {
        animation: none;
        box-shadow: 0 0 0 0;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.5rem;
    }

    .countdown-value {
        animation: pulse 1.5s infinite;
    }

    .countdown-item {
        animation: none;
    }
}

/* Smooth transitions for all interactive elements */
* {
    transition-property: color, background-color, border-color, box-shadow;
    transition-timing-function: ease;
    transition-duration: var(--fade-duration);
}

a, button, input, select, textarea {
    transition-duration: var(--fade-duration);
}

/* Loading animation for content */
.loading {
    animation: pulse 1.5s infinite;
}

/* Success animation */
@keyframes checkmark {
    0% {
        width: 0;
        height: 0;
    }
    45% {
        width: 0;
        height: 0;
    }
    55% {
        width: 0.125rem;
        height: 0;
    }
    100% {
        width: 0.125rem;
        height: 0.25rem;
    }
}

.success-message {
    animation: fadeInUp var(--fade-duration) ease-out;
    color: var(--color-primary-soft);
}

/* Error animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.error-state {
    animation: shake var(--fade-duration) ease-in-out;
}

.error-message.show {
    animation: fadeInUp var(--fade-duration) ease-out;
}

/* Flash guard: cobre tudo antes do módulo de loading executar (módulos são sempre diferidos).
   Usa html::before para não conflitar com body::before da grade de pontos em style.css
   (que tem opacity: 0.35 — sem esse fix, o guard ficaria semitransparente). */
html.ls-pending::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: var(--ls-bg-color, #0e0d0b);
    opacity: 1;
    pointer-events: none;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow: hidden;
}

.loading-backdrop {
    position: absolute;
    inset: 0;
    background: #0e0d0b;
    opacity: 1;
}

.loading-phase {
    position: relative;
    z-index: 1;
}

.loading-phase[hidden] {
    display: none !important;
}

.loading-phase--brand {
    width: min(100vw, 540px);
    aspect-ratio: 9 / 16;
    animation: loadingFadeIn 0.6s ease-out;
}

.brand-loader-art {
    position: absolute;
    inset: 0;
}

.brand-loader-art svg {
    width: 100%;
    height: 100%;
    display: block;
    font-family: 'Cormorant Garamond', serif;
}

.brand-loader-ring {
    position: absolute;
    left: 50%;
    bottom: 28%;
    transform: translateX(-50%);
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
}

.brand-loader-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    animation: ringRotate 2.4s linear infinite;
}

.brand-loader-ring-track {
    fill: none;
    stroke: rgba(201, 165, 90, 0.18);
    stroke-width: 2;
}

.brand-loader-ring-arc {
    fill: none;
    stroke: #c9a55a;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 80 235;
}

.brand-loader-ring-letter {
    position: absolute;
    color: #f0ebe1;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 30px;
    line-height: 1;
}

.loading-phase--couple {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: loadingFadeIn 0.6s ease-out;
}

.loader-center {
    position: relative;
    width: 264px;
    height: 264px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-screen.loading-screen--phase-couple .loading-backdrop {
    background:
        radial-gradient(ellipse at top, color-mix(in srgb, var(--ls-primary-color, #c9a84c) 16%, transparent), transparent 60%),
        linear-gradient(180deg, var(--ls-bg-color, #1a1714) 0%, color-mix(in srgb, var(--ls-bg-color, #1a1714) 78%, #000 22%) 100%);
}

.loader-progress-ring {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 264px;
    height: 264px;
    pointer-events: none;
    animation: ringRotate 2.4s linear infinite;
}

.loader-progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.loader-progress-track {
    fill: none;
    stroke: color-mix(in srgb, var(--ls-primary-color, #c9a84c) 24%, transparent);
    stroke-width: 1;
}

.loader-progress-arc {
    fill: none;
    stroke: var(--ls-primary-color, #c9a84c);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 660;
    stroke-dashoffset: 495;
    filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ls-primary-color, #c9a84c) 55%, transparent));
    animation: arcPulse 2.4s ease-in-out infinite;
}

.bubble-wrap {
    position: relative;
    z-index: 1;
    width: 192px;
    height: 192px;
    animation: bubbleFloat 6s ease-in-out infinite;
}

.bubble-shadow {
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    width: 144px;
    height: 19px;
    background: radial-gradient(ellipse at center, color-mix(in srgb, var(--ls-primary-color, #c9a84c) 32%, transparent) 0%, transparent 72%);
    filter: blur(6px);
    animation: shadowPulse 6s ease-in-out infinite;
}

.bubble {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.25) 0%, color-mix(in srgb, var(--ls-primary-color, #c9a84c) 35%, transparent) 42%, rgba(255,255,255,0.03) 100%);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow:
        inset 0 0 60px rgba(255,255,255,0.08),
        0 0 60px color-mix(in srgb, var(--ls-primary-color, #c9a84c) 35%, transparent);
    overflow: hidden;
}

.bubble-iridescence {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg at 50% 50%, rgba(232,208,138,0.18) 0%, rgba(180,200,255,0.14) 25%, rgba(180,255,220,0.12) 50%, rgba(255,220,180,0.14) 72%, rgba(232,208,138,0.18) 100%);
    mix-blend-mode: screen;
    opacity: 0.7;
    animation: iridescentSpin 14s linear infinite;
}

.bubble-highlight {
    position: absolute;
    top: 12%;
    left: 18%;
    width: 38%;
    height: 28%;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.55) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(3px);
    transform: rotate(-25deg);
}

.bubble-highlight-small {
    position: absolute;
    bottom: 22%;
    right: 25%;
    width: 14%;
    height: 10%;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.4) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(2px);
}

.bubble-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 2;
    padding: 28px 20px 24px;
}

.bubble-monogram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.bubble-letter {
    font-family: var(--font-serif, 'Cormorant Garamond', serif);
    font-style: italic;
    font-size: 60px;
    font-weight: 400;
    color: color-mix(in srgb, var(--ls-text-color, #faf7f2) 75%, var(--ls-primary-color, #c9a84c) 25%);
    text-shadow: 0 0 18px color-mix(in srgb, var(--ls-primary-color, #c9a84c) 38%, transparent);
    line-height: 1;
}

.bubble-amp {
    font-family: var(--font-serif, 'Cormorant Garamond', serif);
    font-style: italic;
    font-size: 28px;
    font-weight: 300;
    color: color-mix(in srgb, var(--ls-text-color, #faf7f2) 65%, transparent);
    margin: 0 2px;
    transform: translateY(-2px);
}

.loader-date {
    font-family: var(--font-primary, 'Jost', sans-serif);
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--ls-text-color, #faf7f2) 75%, transparent);
}

.loader-date--inside-bubble {
    margin: 0;
    max-width: 100%;
    text-align: center;
    line-height: 1.3;
}

@keyframes ringRotate {
    to {
        transform: rotate(360deg);
    }
}

@keyframes arcPulse {
    0%, 100% {
        stroke-dashoffset: 495;
        opacity: 0.9;
    }
    50% {
        stroke-dashoffset: 380;
        opacity: 1;
    }
}

@keyframes bubbleFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-6px) rotate(-0.2deg);
    }
}

@keyframes shadowPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translateX(-50%) scale(0.85);
        opacity: 0.5;
    }
}

@keyframes iridescentSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes loadingFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 480px) {
    .loading-phase--brand {
        width: 100vw;
    }

    .brand-loader-ring {
        bottom: 26%;
    }

    .loader-progress-ring {
        width: 240px;
        height: 240px;
    }

    .loader-center {
        width: 240px;
        height: 240px;
    }

    .bubble-wrap {
        width: 168px;
        height: 168px;
    }

    .bubble-letter {
        font-size: 50px;
    }

    .bubble-amp {
        font-size: 24px;
    }

    .bubble-content {
        gap: 8px;
        padding: 24px 16px 20px;
    }

    .loader-date {
        font-size: 8px;
        letter-spacing: 0.08em;
    }
}

/* Loading phase couple: iniciais e data aparecem com fade apos 2s.
   animation-fill-mode: both aplica o from{} durante o delay (opacity:0). */
.loading-phase--couple .bubble-content,
.loading-phase--couple .loader-date {
    opacity: 0;
    animation: lsFadeIn 2s ease 2s both;
}

@keyframes lsFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.loading-screen.fade-out {
    animation: loadingFadeOut 0.6s ease-out forwards;
}

@keyframes loadingFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        visibility: hidden;
    }
}
