/* ==================== NAVIGATION ==================== */

/* Fix sub-pixel rendering gaps between adjacent blocks */
main > * + * {
    position: relative;
}
main > * + *::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 4px;
    background: inherit;
    pointer-events: none;
}

/* Desktop link hover underline */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 16px;
    height: 2px;
    background: linear-gradient(90deg, #FFB800, #FFD54F);
    border-radius: 1px;
    transition: transform 0.25s ease;
}
.nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* Desktop dropdown */
#dropdown-menu {
    translate: -50% 0.75rem;
}
#dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    translate: -50% 0;
}

#dropdown-btn[aria-expanded="true"] #dropdown-chevron {
    transform: rotate(180deg);
}

/* Dropdown items */
.dropdown-item {
    color: #374151;
}
.dropdown-item:hover {
    background: #EFF4F8;
}
.dropdown-item:hover span:first-child {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* Desktop CTA button */
.nav-cta-btn {
    background: linear-gradient(135deg, #FF6B00 0%, #FF8C00 100%);
    box-shadow: 0 2px 12px rgba(255, 107, 0, 0.3);
}
.nav-cta-btn:hover {
    box-shadow: 0 4px 20px rgba(255, 107, 0, 0.45);
}

/* ---- Hamburger animated icon ---- */
.hamburger-lines {
    width: 20px;
    height: 14px;
    position: relative;
}
.hamburger-lines span {
    display: block;
    position: absolute;
    width: 100%;
    height: 2px;
    background: #64748B;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.hamburger-lines span:nth-child(1) { top: 0; }
.hamburger-lines span:nth-child(2) { top: 6px; width: 70%; }
.hamburger-lines span:nth-child(3) { top: 12px; }

/* Hamburger → X */
.hamburger-open span:nth-child(1) {
    top: 6px;
    transform: rotate(45deg);
    background: #1E293B;
}
.hamburger-open span:nth-child(2) {
    opacity: 0;
    transform: translateX(8px);
}
.hamburger-open span:nth-child(3) {
    top: 6px;
    transform: rotate(-45deg);
    background: #1E293B;
}

#mobile-menu-btn:hover .hamburger-lines span {
    background: #1E293B;
}

/* ---- Mobile menu panel ---- */
.mobile-menu-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.3s ease;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.96) 0%,
        rgba(248, 250, 252, 0.99) 100%);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.mobile-menu-panel.open {
    max-height: 600px;
    opacity: 1;
}

/* Mobile nav items stagger animation */
.mobile-nav-item {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
}
.mobile-menu-panel.open .mobile-nav-item {
    opacity: 1;
    transform: translateY(0);
    transition-delay: calc(0.08s + var(--delay, 0) * 0.06s);
}

.mobile-nav-item:hover,
.mobile-nav-item:active {
    background: rgba(0, 0, 0, 0.04);
}
.mobile-nav-item:active {
    transform: scale(0.98);
}

/* Mobile sub-menu toggle */
#mobile-dropdown-btn[aria-expanded="true"] #mobile-dropdown-chevron {
    transform: rotate(180deg);
}

.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.25s ease;
}
.mobile-submenu.open {
    max-height: 200px;
    opacity: 1;
}

/* Mobile CTA */
.mobile-cta-btn {
    background: linear-gradient(135deg, #FF6B00 0%, #FF8C00 50%, #FF6B00 100%);
    background-size: 200% auto;
    box-shadow: 0 4px 24px rgba(255, 107, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}
.mobile-cta-btn:active {
    transform: scale(0.97);
    box-shadow: 0 2px 12px rgba(255, 107, 0, 0.25);
}

/* ==================== CTA BUTTON ==================== */

.cta-primary {
    background: linear-gradient(135deg, #FF6B00 0%, #FF8C00 100%);
    box-shadow: 0 4px 24px rgba(255, 107, 0, 0.35), 0 0 0 0 rgba(255, 107, 0, 0.4);
    animation: cta-pulse 2.5s ease-in-out infinite;
}
.cta-primary:hover {
    background: linear-gradient(135deg, #E85D00 0%, #FF7700 100%);
    box-shadow: 0 8px 32px rgba(255, 107, 0, 0.45);
    animation: none;
}

@keyframes cta-pulse {
    0%, 100% { box-shadow: 0 4px 24px rgba(255, 107, 0, 0.35), 0 0 0 0 rgba(255, 107, 0, 0.3); }
    50% { box-shadow: 0 4px 24px rgba(255, 107, 0, 0.35), 0 0 0 10px rgba(255, 107, 0, 0); }
}

/* ==================== ANIMATIONS ==================== */

@keyframes bounce-slow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.animate-bounce-slow {
    animation: bounce-slow 3s ease-in-out infinite;
}

@keyframes float-delayed {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.animate-float-delayed {
    animation: float-delayed 4s ease-in-out 1s infinite;
}

/* ==================== COUNTERS ==================== */

@keyframes counter-fade-in {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.counter-item.visible {
    animation: counter-fade-in 0.5s ease-out forwards;
}

/* ==================== FAQ ACCORDION ==================== */

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}
.faq-item.active .faq-content {
    max-height: 1500px;
}

/* ==================== FUNNEL ==================== */

.earning-option.selected {
    border-color: #00D26A !important;
    background: linear-gradient(135deg, rgba(0,210,106,0.05), rgba(0,210,106,0.1)) !important;
    position: relative;
}
.earning-option.selected::after {
    content: '';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: #00D26A;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
    background-size: 11px;
    background-position: center;
    background-repeat: no-repeat;
}
.earning-option {
    position: relative;
}

/* Country dropdown */
#country-panel {
    animation: country-panel-in 0.15s ease-out;
}
@keyframes country-panel-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
#country-list {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
#country-list .country-item:focus-visible {
    outline: 2px solid #00D26A;
    outline-offset: -2px;
    border-radius: 4px;
}

/* Full screen funnel on mobile */
@media (max-width: 639px) {
    .funnel-container {
        border-radius: 0 !important;
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
    }
    .funnel-steps-wrapper {
        flex: 1;
    }
    .funnel-step {
        min-height: calc(100vh - 4px);
        min-height: calc(100dvh - 4px);
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    #funnel-overlay > .relative {
        padding: 0;
        min-height: 100vh;
        min-height: 100dvh;
    }
    #funnel-overlay .funnel-container {
        max-width: 100%;
    }
}

/* ==================== CONFIRMATION ==================== */

.confirm-item.show {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

/* ==================== STICKY CTA ==================== */

#sticky-cta.visible {
    transform: translateY(0);
}

@media (max-width: 1023px) {
    body.sticky-cta-active footer {
        padding-bottom: 72px;
    }
}

/* ==================== TESTIMONIAL CAROUSEL ==================== */

.testimonial-carousel {
    -webkit-overflow-scrolling: touch;
}
.testimonial-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #D1D5DB;
    transition: background-color 0.3s, width 0.3s;
    cursor: pointer;
}
.testimonial-dot.active {
    background-color: #1E293B;
    width: 24px;
    border-radius: 4px;
}

/* ==================== LIVE TOAST ==================== */

#live-toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ==================== REDUCED MOTION ==================== */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==================== ARTICLE CONTENT ==================== */

.article-content h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #22364F;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    padding-top: 2rem;
    border-top: 1px solid #E5E7EB;
    scroll-margin-top: 5rem;
}
.article-content h2:first-child,
.article-content .toc + h2 {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.article-content p {
    color: #4B5563;
    font-size: 0.9375rem;
    line-height: 1.8;
    margin-bottom: 1.25rem;
}
.article-content p:last-child {
    margin-bottom: 0;
}
.article-content strong {
    color: #22364F;
    font-weight: 600;
}
.article-content h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #22364F;
    margin-top: 1.75rem;
    margin-bottom: 0.625rem;
    line-height: 1.3;
}
.article-content ul,
.article-content ol {
    color: #4B5563;
    font-size: 0.9375rem;
    line-height: 1.8;
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}
.article-content ul li { list-style-type: disc; }
.article-content ol li { list-style-type: decimal; }
.article-content li { margin-bottom: 0.375rem; }
.article-content a {
    color: #5278A5;
    text-decoration: underline;
}
.article-content a:hover {
    color: #22364F;
}

/* Article blockquote */
.article-blockquote {
    position: relative;
    background: linear-gradient(135deg, #EFF4F8 0%, #E4ECF4 100%);
    border-left: 4px solid #5278A5;
    border-radius: 0 0.75rem 0.75rem 0;
    padding: 1.5rem 1.5rem 1.5rem 1.75rem;
    margin: 2rem 0;
}
.article-blockquote-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #5278A5;
    opacity: 0.3;
    margin-bottom: 0.5rem;
}
.article-blockquote p {
    color: #22364F !important;
    font-size: 1rem !important;
    font-weight: 500;
    font-style: italic;
    line-height: 1.7 !important;
    margin-bottom: 0.75rem !important;
}
.article-blockquote cite {
    font-style: normal;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #5278A5;
}

/* ALL CAPS legal sections (14 & 17) */
.article-content .legal-caps {
    font-size: 0.8125rem;
    line-height: 1.9;
    letter-spacing: 0.01em;
}

/* Table of contents */
.toc {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}
.toc-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #22364F;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}
.toc ol {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 1;
}
.toc li {
    margin-bottom: 0.25rem;
}
.article-content .toc li {
    list-style-type: none;
    margin-bottom: 0.25rem;
}
.toc a {
    color: #4B5563;
    font-size: 0.8125rem;
    text-decoration: none;
    transition: color 0.15s ease;
    display: block;
    padding: 0.2rem 0;
}
.toc a:hover {
    color: #5278A5;
}

@media (min-width: 768px) {
    .article-content h2 {
        font-size: 1.75rem;
        margin-top: 3rem;
        padding-top: 2.5rem;
    }
    .article-content h3 {
        font-size: 1.25rem;
    }
    .article-content p,
    .article-content ul,
    .article-content ol {
        font-size: 1rem;
    }
    .toc ol {
        columns: 2;
        column-gap: 1.5rem;
    }
    .toc a {
        font-size: 0.875rem;
    }
}

/* Breadcrumb */
.breadcrumb li {
    display: flex;
    align-items: center;
}

/* ==================== MISC ==================== */

html { scroll-behavior: smooth; }

::selection {
    background-color: #DDE7F0;
    color: #22364F;
}
