/* ============================================================
   CrewLog – Shared Styles (iOS App Store Pages)
   ============================================================ */

:root {
    --brand: #204770;
    --brand-dark: #1b3b62;
    --brand-deeper: #142d4a;
    --accent: #3bb4e5;
    --accent-light: #e8f6fc;
    --text: #0f1b2d;
    --text-muted: #4a5b73;
    --bg: #f5f8fb;
    --surface: #ffffff;
    --border: #e1e6ee;
    --radius: 16px;
    --radius-lg: 24px;
    --shadow: 0 12px 30px rgba(15, 27, 45, 0.08);
    --shadow-lg: 0 24px 48px rgba(15, 27, 45, 0.12);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--surface);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ---- Layout ---- */

.container {
    width: min(1120px, 92vw);
    margin: 0 auto;
}

.section {
    padding: 96px 0;
    position: relative;
}

.section.alt {
    background: var(--bg);
}

.section-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}

.section-title {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    color: var(--brand);
    line-height: 1.2;
    margin-bottom: 18px;
}

.section-subtitle {
    color: var(--text-muted);
    max-width: 640px;
    font-size: 1.05rem;
    margin-bottom: 40px;
}

.text-center {
    text-align: center;
}

.text-center .section-subtitle {
    margin-left: auto;
    margin-right: auto;
}

/* ---- Top Bar ---- */

.top-bar {
    background: var(--brand);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    gap: 16px;
}

.top-bar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
}

.top-bar-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.main-nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.main-nav a {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    font-size: 0.9rem;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.main-nav a:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

/* ---- Buttons ---- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 999px;
    padding: 14px 28px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    border: 1px solid var(--border);
    color: var(--brand);
    background: rgba(32, 71, 112, 0.06);
}

.btn-secondary:hover {
    background: rgba(32, 71, 112, 0.12);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 8px 20px rgba(59, 180, 229, 0.25);
}

.btn-accent:hover {
    transform: translateY(-2px);
}

.btn-outline {
    border: 2px solid var(--brand);
    color: var(--brand);
    background: transparent;
}

.btn-outline:hover {
    background: var(--brand);
    color: #fff;
}

.btn-text {
    color: var(--brand);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: none;
    border: none;
}

.btn-text::after {
    content: '\2192';
    transition: transform 0.2s;
}

.btn-text:hover::after {
    transform: translateX(4px);
}

/* ---- Background Animation ---- */

.bg-animation {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

#canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}

.bg-animation::before,
.bg-animation::after {
    content: "";
    position: absolute;
    width: 160vw;
    height: 160vw;
    top: -30vw;
    left: -30vw;
    background: conic-gradient(from 90deg, rgba(32, 71, 112, 0.04), rgba(59, 180, 229, 0.08), rgba(255, 255, 255, 0));
    border-radius: 45%;
    animation: drift 32s linear infinite;
}

.bg-animation::after {
    animation-duration: 48s;
    animation-direction: reverse;
    opacity: 0.6;
    mix-blend-mode: screen;
}

@keyframes drift {
    0%   { transform: rotate(0deg) translate3d(0,0,0); }
    50%  { transform: rotate(180deg) translate3d(4vw, -3vw, 0); }
    100% { transform: rotate(360deg) translate3d(0,0,0); }
}

/* Ensure all content sits above canvas */
.top-bar, main, .hero, .site-footer, .cta-section {
    position: relative;
    z-index: 2;
}

/* ---- Hero ---- */

.hero {
    padding: 80px 0 100px;
    background: transparent;
    position: relative;
    overflow: visible;
    z-index: 2;
}

.hero-center {
    text-align: center;
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.hero-kicker {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.hero h1 {
    font-size: clamp(2rem, 4.5vw, 3rem);
    color: var(--brand);
    line-height: 1.15;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 520px;
}

.hero-video-showcase {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.hero-ctas {
    margin-top: 36px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding-bottom: 20px;
}

/* ---- Value Props ---- */

.value-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.value-item {
    text-align: center;
    padding: 32px 20px;
}

.value-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 1.5rem;
}

.value-item h3 {
    font-size: 1rem;
    color: var(--brand);
    margin-bottom: 8px;
}

.value-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---- Feature Grid ---- */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.feature-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 20px rgba(15, 27, 45, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: #fff;
    font-size: 1.3rem;
}

.feature-card h3 {
    font-size: 1.05rem;
    color: var(--brand);
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Feature icon colors */
.fi-roster    { background: linear-gradient(135deg, #1bc7ff, #1176ff); }
.fi-logbook   { background: linear-gradient(135deg, #ffd36b, #ff9f1c); }
.fi-calendar  { background: linear-gradient(135deg, #ff9b88, #ff5d8f); }
.fi-crew      { background: linear-gradient(135deg, #4be1c0, #1a9f8f); }
.fi-change    { background: linear-gradient(135deg, #ff7eb3, #ff758c); }
.fi-buddy     { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.fi-tax       { background: linear-gradient(135deg, #c39bff, #7d4dff); }
.fi-exchange  { background: linear-gradient(135deg, #34d399, #059669); }
.fi-layover   { background: linear-gradient(135deg, #fbbf24, #d97706); }
.fi-weather   { background: linear-gradient(135deg, #60a5fa, #2563eb); }

/* ---- Trust / Privacy Section ---- */

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.trust-item {
    padding: 32px 24px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    text-align: center;
}

.trust-item .trust-icon {
    font-size: 2rem;
    margin-bottom: 16px;
    display: block;
}

.trust-item h3 {
    font-size: 1.05rem;
    color: var(--brand);
    margin-bottom: 8px;
}

.trust-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---- Pain Points ---- */

.pain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.pain-item {
    padding: 24px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.pain-item .pain-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.pain-item h3 {
    font-size: 0.95rem;
    color: var(--brand);
    margin-bottom: 4px;
}

.pain-item p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ---- CTA Section ---- */

.cta-section {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    padding: 80px 0;
    text-align: center;
    color: #fff;
}

.cta-section h2 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    margin-bottom: 16px;
}

.cta-section p {
    opacity: 0.85;
    max-width: 520px;
    margin: 0 auto 32px;
    font-size: 1.05rem;
}

.cta-section .cta-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.cta-section .btn-primary {
    background: #fff;
    color: var(--brand);
}

.cta-section .btn-secondary {
    border-color: rgba(255,255,255,0.4);
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.cta-note {
    font-size: 0.85rem;
    opacity: 0.6;
}

/* ---- Footer ---- */

.site-footer {
    background: var(--brand-deeper);
    color: #fff;
    padding: 40px 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #fff;
}

.footer-copy {
    color: rgba(255, 255, 255, 0.5);
}

/* ---- Support Page Specifics ---- */

.support-hero {
    padding: 80px 0 60px;
    background: linear-gradient(135deg, rgba(248, 251, 255, 1) 0%, rgba(230, 237, 247, 1) 100%);
    text-align: center;
}

.support-hero h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: var(--brand);
    margin-bottom: 16px;
}

.support-hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 560px;
    margin: 0 auto;
}

/* Contact options */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.contact-card {
    padding: 32px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 8px 20px rgba(15, 27, 45, 0.04);
    text-align: center;
}

.contact-card .contact-icon {
    font-size: 2rem;
    margin-bottom: 16px;
    display: block;
}

.contact-card h3 {
    font-size: 1.1rem;
    color: var(--brand);
    margin-bottom: 8px;
}

.contact-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* FAQ Accordion */
.faq-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 20px 24px;
    background: none;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--brand);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    font-family: inherit;
    line-height: 1.4;
}

.faq-question:hover {
    background: rgba(32, 71, 112, 0.03);
}

.faq-chevron {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    transition: transform 0.25s ease;
    color: var(--text-muted);
}

.faq-item.open .faq-chevron {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer-inner {
    padding: 0 24px 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Troubleshooting */
.troubleshoot-list {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.troubleshoot-item {
    padding: 18px 24px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    font-size: 0.95rem;
    color: var(--text);
}

.troubleshoot-item .ts-icon {
    flex-shrink: 0;
    color: var(--accent);
    font-size: 1.2rem;
    line-height: 1.4;
}

/* ---- Legal / Policy Pages ---- */

.legal-page {
    padding: 80px 0 60px;
    background: linear-gradient(135deg, rgba(248, 251, 255, 1) 0%, rgba(230, 237, 247, 1) 100%);
}

.legal-page h1 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    color: var(--brand);
    margin-bottom: 8px;
}

.legal-page .legal-updated {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.legal-content {
    padding: 60px 0;
}

.legal-content .container {
    max-width: 780px;
}

.legal-content h2 {
    font-size: 1.3rem;
    color: var(--brand);
    margin: 40px 0 12px;
}

.legal-content h2:first-child {
    margin-top: 0;
}

.legal-content p,
.legal-content li {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 12px;
}

.legal-content ul {
    padding-left: 24px;
    margin-bottom: 16px;
}

.legal-content a {
    color: var(--accent);
    text-decoration: underline;
}

/* ---- Contact Form ---- */

.contact-form {
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 180, 229, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .section {
        padding: 64px 0;
    }

    .hero-video-wrapper {
        border-radius: 14px;
    }

    .hero-video-showcase {
        margin-top: 32px;
    }

    .screens-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .hero-video-wrapper {
        border-radius: 18px;
    }

    .hero {
        padding: 60px 0 60px;
    }

    .main-nav {
        gap: 14px;
    }

    .main-nav a {
        font-size: 0.8rem;
    }

    .top-bar-content {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .value-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .value-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 48px 0 40px;
    }

    .btn {
        padding: 12px 22px;
        font-size: 0.9rem;
    }

    .screens-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .hero-video-wrapper {
        border-radius: 14px;
    }
}

/* ---- Hero Video ---- */

.hero-video-wrapper {
    position: relative;
    width: 100%;
    max-width: 1000px;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(15, 27, 45, 0.22), 0 0 0 1px rgba(255,255,255,0.1);
    aspect-ratio: 16 / 9;
    background: var(--brand-dark);
}

.hero-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ---- Screenshots Gallery ---- */

.screens-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 8px;
}

.screen-button {
    border: none;
    background: transparent;
    border-radius: 12px;
    padding: 0;
    cursor: zoom-in;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.screen-button:hover,
.screen-button:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(15, 27, 45, 0.14);
    outline: none;
}

.screen-img,
.screen-video {
    width: 100%;
    border-radius: 12px;
    display: block;
    box-shadow: 0 8px 20px rgba(9, 19, 35, 0.06);
    object-fit: cover;
}

.screen-video-card {
    cursor: zoom-in;
}

/* ---- Lightbox ---- */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(8, 14, 28, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 200;
}

.lightbox.open {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
}

.lightbox-content {
    position: relative;
    max-width: min(90vw, 500px);
    margin: 0;
}

.lightbox-content img {
    width: 100%;
    border-radius: 24px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4);
    display: block;
}

.lightbox-close {
    position: absolute;
    top: -44px;
    right: 0;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ---- Store Badges ---- */

.store-badge {
    display: inline-block;
    transition: transform 0.2s, opacity 0.2s;
}

.store-badge img {
    display: block;
    height: 54px;
    width: auto;
}

.store-badge:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.cta-section .store-badge img {
    height: 48px;
}

/* ---- Hamburger (mobile) ---- */

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
}

@media (max-width: 640px) {
    .nav-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--brand);
        flex-direction: column;
        padding: 16px 24px;
        gap: 12px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .main-nav.open {
        display: flex;
    }

    .top-bar-content {
        position: relative;
    }
}
