/* ===== Custom Animations ===== */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes float-delayed {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float-delayed 8s ease-in-out 1s infinite;
}

/* ===== Scroll-triggered Animations ===== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Selection Color ===== */
::selection {
    background: #bfdbfe;
    color: #1e3a8a;
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f8fafc;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== Metrics Section Animations ===== */
.metric-card {
    opacity: 0;
    transform: translateY(40px) scale(0.97);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.metric-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.metrics-header {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.metrics-header.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Progress bar animation */
.metric-bar {
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* CTA shimmer effect */
.metrics-cta-shimmer {
    background: linear-gradient(
        110deg,
        transparent 20%,
        rgba(255, 255, 255, 0.06) 40%,
        rgba(255, 255, 255, 0.12) 50%,
        rgba(255, 255, 255, 0.06) 60%,
        transparent 80%
    );
    background-size: 200% 100%;
    animation: metrics-shimmer 3s ease-in-out infinite;
}

@keyframes metrics-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== Smooth Scrolling ===== */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

/* ===== Focus Styles ===== */
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ===== Form Input Autofill Style ===== */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px white inset;
    -webkit-text-fill-color: #374151;
    transition: background-color 5000s ease-in-out 0s;
}

/* ===== Responsive Typography ===== */
@media (max-width: 640px) {
    .font-serif {
        letter-spacing: -0.025em;
    }
}

/* ===== Card Hover Glow ===== */
.group:hover .group-hover\:scale-110 {
    transform: scale(1.1);
}

/* ===== Gradient Text (for optional use) ===== */
.gradient-text {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Animated Border ===== */
.animated-border {
    position: relative;
}

.animated-border::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    transition: width 0.3s ease;
}

.animated-border:hover::after {
    width: 100%;
}

/* ===== Loading State ===== */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.loading-shimmer {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ===== Glass morphism helper ===== */
.glass {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.75);
}

/* ===== Legal Notice Section Animations ===== */

/* Icon pulse */
.legal-icon-pulse {
    animation: legalIconPulse 3s ease-in-out infinite;
}
@keyframes legalIconPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 15px 25px -5px rgba(245, 158, 11, 0.45); }
}

/* Ping ring on icon */
.legal-ping {
    animation: legalPing 2.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes legalPing {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Shimmer across the card */
.legal-shimmer {
    background: linear-gradient(
        110deg,
        transparent 20%,
        rgba(255, 255, 255, 0.4) 40%,
        rgba(255, 255, 255, 0.4) 60%,
        transparent 80%
    );
    background-size: 200% 100%;
    animation: legalShimmer 4s ease-in-out infinite;
}
@keyframes legalShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Corner line animations */
.legal-line-animate {
    animation: legalLineH 3s ease-in-out infinite alternate;
}
@keyframes legalLineH {
    0% { width: 2rem; opacity: 0.3; }
    100% { width: 3.5rem; opacity: 0.8; }
}
.legal-line-animate-v {
    animation: legalLineV 3s ease-in-out infinite alternate;
}
@keyframes legalLineV {
    0% { height: 2rem; opacity: 0.3; }
    100% { height: 3.5rem; opacity: 0.8; }
}

/* Floating orbs */
.legal-orb-1 {
    animation: legalOrb1 6s ease-in-out infinite;
}
@keyframes legalOrb1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-15px, 10px) scale(1.1); }
    66% { transform: translate(10px, -15px) scale(0.95); }
}
.legal-orb-2 {
    animation: legalOrb2 8s ease-in-out infinite;
}
@keyframes legalOrb2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -10px) scale(1.15); }
}
.legal-orb-3 {
    animation: legalOrb3 5s ease-in-out infinite;
}
@keyframes legalOrb3 {
    0%, 100% { transform: translate(0, 0); opacity: 0.3; }
    50% { transform: translate(-10px, 15px); opacity: 0.6; }
}

/* Divider glow */
.legal-divider-glow {
    animation: legalDividerGlow 2s ease-in-out infinite;
}
@keyframes legalDividerGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* Content stagger reveal (visible via Intersection Observer) */
.legal-content-stagger {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    transition-delay: calc(var(--stagger, 0) * 0.15s);
}
.legal-content-stagger.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Heading reveal */
.legal-text-reveal {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.legal-text-reveal.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Badge pop */
.legal-badge-pop {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.4s ease 0.3s, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s;
}
.legal-badge-pop.visible {
    opacity: 1;
    transform: scale(1);
}

/* Ref typewriter */
.legal-ref-type {
    opacity: 0;
    transition: opacity 0.4s ease 0.5s;
}
.legal-ref-type.visible {
    opacity: 1;
}

/* Urgency bar */
.legal-urgency-bar {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease 0.5s, transform 0.5s ease 0.5s;
}
.legal-urgency-bar.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Trust indicators pop */
.legal-trust-pop {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: calc(var(--pop-delay, 0s) + 0.6s);
}
.legal-trust-pop.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Clock spin */
.legal-clock-spin {
    animation: legalClockSpin 8s linear infinite;
}
@keyframes legalClockSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Card entrance */
.legal-notice-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.legal-notice-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== intl-tel-input overrides ===== */
.iti {
    width: 100%;
}
.iti__tel-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.15s;
}
.iti__tel-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.iti__country-container {
    border-radius: 0.75rem 0 0 0.75rem;
}
.iti__dropdown-content {
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}
