/* ============================================================
   FINZY — Shared Styles
   Used by all public-facing frontend pages.
   Page-specific styles stay in each page's <style> block.
   ============================================================ */

/* ======================== VARIABLES ======================== */
:root {
    --ink: #0a1628;
    --deep: #132240;
    --ocean: #0e4d8f;
    --wave: #1a7fd4;
    --sky: #4fb4f0;
    --foam: #d6eefb;
    --chalk: #f0f6fa;
    --white: #ffffff;
    --warm: #f5a623;
    --coral: #e8634a;
    --mint: #34c186;
    --pale-mint: #e8f7f0;
    --pale-coral: #fce9e4;
    --pale-warm: #fef3e0;
    --font-display: 'Poppins', 'Inter', sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
}

/* ======================== RESET ======================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ======================== NAV ======================== */
nav {
    position: fixed;
    top: 0; left: 0; width: 100%;
    z-index: 10000;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(10,22,40,0.06);
    transition: box-shadow 0.3s;
}
nav.scrolled { box-shadow: 0 2px 24px rgba(10,22,40,0.08); }

.nav-inner {
    max-width: 1200px; margin: 0 auto; padding: 0 2rem;
    display: flex; align-items: center; justify-content: space-between; height: 68px;
}

.nav-logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: var(--ink);
}
.nav-logo-icon {
    width: 55px; height: 55px; object-fit: contain; border-radius: 10px;
}
.nav-logo span {
    font-family: var(--font-display); font-weight: 700;
    font-size: 1.2rem; letter-spacing: -0.02em;
}

.nav-links {
    display: flex; align-items: center; gap: 2rem; list-style: none;
}
.nav-links a {
    text-decoration: none; color: var(--deep);
    font-size: 0.92rem; font-weight: 500; transition: color 0.2s;
}
.nav-links a:hover { color: var(--ocean); }

.nav-swimmer {
    color: var(--wave) !important; font-weight: 500 !important;
    position: relative;
}
.nav-swimmer:hover { color: var(--ocean) !important; }

.nav-divider {
    width: 1px; height: 20px; background: rgba(10,22,40,0.12); margin: 0 -0.75rem;
}

.nav-icon {
    width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px;
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.nav-cta {
    background: var(--ocean); color: white !important;
    padding: 10px 22px; border-radius: 8px; font-weight: 600;
    transition: background 0.2s, transform 0.15s;
}
.nav-cta .nav-icon { stroke: white; }
.nav-cta:hover { background: var(--deep); transform: translateY(-1px); }

.mobile-app-links { display: none; }
.nav-auth-row { display: none; }
.nav-legal-row { display: none; }

.mobile-toggle {
    display: none; background: none; border: none;
    cursor: pointer; padding: 8px;
}
.mobile-toggle span {
    display: block; width: 22px; height: 2px;
    background: var(--ink); margin: 5px 0; border-radius: 2px;
    transition: 0.3s;
}

/* ======================== BUTTONS ======================== */
.btn-primary {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--ocean); color: white; padding: 14px 28px; border-radius: 10px;
    font-size: 1rem; font-weight: 600; text-decoration: none;
    border: none; cursor: pointer;
    transition: all 0.2s; font-family: var(--font-body);
}
.btn-primary:hover {
    background: var(--deep); transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(14,77,143,0.25);
}

.btn-secondary {
    display: inline-flex; align-items: center; gap: 8px;
    background: transparent; color: var(--deep); padding: 14px 24px; border-radius: 10px;
    font-size: 1rem; font-weight: 500; text-decoration: none;
    border: 1.5px solid rgba(10,22,40,0.15); transition: all 0.2s;
}
.btn-secondary:hover {
    border-color: var(--ocean); color: var(--ocean); background: var(--chalk);
}

/* ======================== FOOTER ======================== */
footer {
    background: var(--ink); color: rgba(255,255,255,0.6);
    padding: 60px 2rem 40px;
}
.footer-inner {
    max-width: 1100px; margin: 0 auto;
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem;
}
.footer-brand p {
    font-size: 0.85rem; line-height: 1.6;
    margin-top: 1rem; max-width: 280px;
}
.footer-col h4 {
    color: white; font-size: 0.82rem; text-transform: uppercase;
    letter-spacing: 0.08em; margin-bottom: 1rem; font-weight: 600;
}
.footer-col a {
    display: block; color: rgba(255,255,255,0.6); text-decoration: none;
    font-size: 0.88rem; margin-bottom: 0.6rem; transition: color 0.2s;
}
.footer-col a:hover { color: white; }

.footer-bottom {
    max-width: 1100px; margin: 2.5rem auto 0; padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.8rem; flex-wrap: wrap; gap: 1rem;
}

.app-buttons { display: flex; gap: 10px; margin-top: 1.2rem; }
.app-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px; color: rgba(255,255,255,0.8);
    text-decoration: none; font-size: 0.75rem; transition: border-color 0.2s;
}
.app-btn:hover { border-color: rgba(255,255,255,0.4); }

/* ======================== SCROLL TO TOP ======================== */
.scroll-top {
    position: fixed; bottom: 4rem; right: 1.5rem;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(10,22,40,0.08); color: var(--deep); border: none;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
    opacity: 0; visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.3s, color 0.3s;
    z-index: 9998;
}
.scroll-top.visible {
    opacity: 0.6; visibility: visible; transform: translateY(0);
}
.scroll-top:hover {
    opacity: 1; background: rgba(10,22,40,0.12);
}
.scroll-top.light { background: rgba(255,255,255,0.15); color: white; }
.scroll-top.light:hover { background: rgba(255,255,255,0.25); }
.scroll-top svg {
    width: 16px; height: 16px; fill: none;
    stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}

/* ======================== COOKIE NOTICE ======================== */
.cookie-icon {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(10,22,40,0.08); color: var(--deep); border: none;
    cursor: pointer; display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
    opacity: 0.6;
    transition: opacity 0.3s, background 0.3s, color 0.3s;
    z-index: 9998;
}
.cookie-icon.visible { display: flex; }
.cookie-icon:hover { opacity: 1; background: rgba(10,22,40,0.12); }
.cookie-icon.light { background: rgba(255,255,255,0.15); color: white; }
.cookie-icon.light:hover { background: rgba(255,255,255,0.25); }
.cookie-icon svg { flex-shrink: 0; }

.cookie-banner {
    position: fixed; bottom: 1.5rem; left: 1.5rem;
    max-width: 380px;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(10,22,40,0.08);
    border-radius: 12px;
    padding: 1.25rem;
    display: none; flex-direction: column; gap: 1rem;
    box-shadow: 0 8px 32px rgba(10,22,40,0.10);
    z-index: 10001;
    animation: cookieSlideUp 0.3s ease;
}
.cookie-banner.show { display: flex; }
@keyframes cookieSlideUp {
    from { transform: translateY(16px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.cookie-text strong {
    font-size: 0.88rem; font-weight: 700; color: var(--ink);
    display: block; margin-bottom: 4px;
}
.cookie-text p {
    font-size: 0.78rem; color: rgba(10,22,40,0.6); line-height: 1.5; margin: 0;
}
.cookie-text a {
    color: var(--ocean); text-decoration: underline;
}
.cookie-status {
    display: none; font-size: 0.7rem; font-weight: 600;
    color: var(--mint); margin: 2px 0 4px;
}
.cookie-btns { display: flex; gap: 8px; }
.cookie-btn {
    flex: 1; padding: 8px 14px; border-radius: 7px; font-size: 0.78rem; font-weight: 600;
    cursor: pointer; border: none; font-family: var(--font-body);
    transition: background 0.2s; white-space: nowrap;
}
.cookie-btn-accept {
    background: var(--ocean); color: white;
}
.cookie-btn-accept:hover { background: var(--deep); }
.cookie-btn-decline {
    background: transparent; color: var(--deep);
    border: 1px solid rgba(10,22,40,0.12);
}
.cookie-btn-decline:hover { border-color: rgba(10,22,40,0.25); }

@media (max-width: 640px) {
    .cookie-banner {
        left: 0.75rem; right: 0.75rem;
        max-width: none; bottom: 0.75rem;
        padding: 1rem;
    }
    /* Push scroll-to-top + cookie icon above banner on mobile */
    body:has(.cookie-banner.show) .scroll-top {
        bottom: calc(0.75rem + 200px);
    }
    body:has(.cookie-banner.show) .cookie-icon {
        bottom: calc(0.75rem + 160px);
    }
}

/* ======================== ANIMATIONS ======================== */
.fade-up {
    opacity: 0; transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ======================== RESPONSIVE ======================== */
@media (max-width: 900px) {
    .footer-inner { grid-template-columns: 1fr 1fr; }
}

/* Mobile nav icon (hidden on desktop, shown on mobile) */
.mob-icon {
    display: none;
}

@media (max-width: 640px), (max-width: 1024px) and (orientation: portrait) {
    .nav-links { display: none; }
    .mobile-toggle { display: block; }

    /* Animated hamburger → X */
    .mobile-toggle.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .mobile-toggle.active span:nth-child(2) { opacity: 0; }
    .mobile-toggle.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Full-screen overlay menu */
    .nav-links.open {
        display: flex; flex-direction: column;
        align-items: stretch;
        position: absolute;
        top: 68px; left: 0; right: 0;
        min-height: calc(100vh - 68px);
        background: var(--chalk);
        padding: 0.75rem 1.5rem 2rem;
        gap: 0;
        overflow-y: auto;
        animation: mobileMenuFade 0.2s ease;
        z-index: 9999;
    }
    @keyframes mobileMenuFade {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    /* Show mobile icons */
    .mob-icon {
        display: inline-flex; align-items: center; justify-content: center;
        width: 28px; height: 28px; border-radius: 6px;
        background: rgba(14,77,143,0.06);
        margin-right: 10px; flex-shrink: 0;
    }
    .mob-icon svg {
        width: 14px; height: 14px;
        fill: none; stroke: var(--ocean); stroke-width: 2;
        stroke-linecap: round; stroke-linejoin: round;
    }

    /* Nav link items */
    .nav-links.open li {
        list-style: none;
        border-bottom: 1px solid rgba(10,22,40,0.05);
    }
    .nav-links.open a {
        display: flex; align-items: center;
        padding: 10px 2px;
        font-size: 0.88rem; font-weight: 500;
        color: var(--ink);
        text-decoration: none;
    }

    /* Swimmer link */
    .nav-links.open .nav-swimmer {
        color: var(--ink) !important;
    }

    /* Hide desktop-only items on mobile */
    .nav-divider { display: none; }
    .nav-links.open > li:has(> a[href*="signin"]):not(.nav-auth-row) { display: none; }
    .nav-links.open > li:has(> a.nav-cta):not(.nav-auth-row) { display: none; }

    /* Auth row — side by side */
    .nav-links.open .nav-auth-row {
        display: flex !important; gap: 10px;
        margin-top: 1rem; border-bottom: none;
    }
    .nav-links.open .nav-auth-row a {
        flex: 1; display: inline-flex; align-items: center; justify-content: center;
        padding: 15px 12px; border-radius: 10px;
        font-size: 1rem; font-weight: 600;
        white-space: nowrap;
    }

    /* Sign In — outlined */
    .nav-links.open .nav-auth-row .nav-signin {
        background: white; color: var(--deep);
        border: 1.5px solid rgba(10,22,40,0.12);
    }

    /* Sign Up — solid CTA */
    .nav-links.open .nav-auth-row .nav-cta {
        margin-top: 0; width: auto;
        box-shadow: 0 2px 10px rgba(14,77,143,0.15);
    }

    /* Legal links row */
    .nav-links.open .nav-legal-row {
        display: flex !important; justify-content: center; gap: 6px;
        margin-top: 0.5rem; border-bottom: none;
    }
    .nav-links.open .nav-legal-row a {
        font-size: 0.75rem; font-weight: 400; color: rgba(10,22,40,0.4);
        white-space: nowrap; padding: 2px 0;
    }
    .nav-links.open .nav-legal-row span {
        font-size: 0.75rem; color: rgba(10,22,40,0.15);
    }

    /* Hide old separate auth li items (fallback) */
    .nav-links.open li:nth-last-child(-n+4):not(.nav-auth-row):not(.mobile-app-links):not(.nav-legal-row) {
        border-bottom: none;
    }

    /* App store buttons — hidden in burger menu */
    .mobile-app-links { display: none !important; }

    .footer-inner { grid-template-columns: 1fr; }
}
