/* ==========================================
   MeowBoard - public pages (home, terms, privacy)
   ========================================== */

/*
 * Theme: "auto" (default) follows the device's light/dark setting and
 * changes with it; the button in the nav can force light or dark
 * (stored on the device, see site-theme.js).
 */
:root {
    color-scheme: light;
    --bg: #ffffff;
    --bg-alt: #f4f6fa;
    --bg-card: #ffffff;
    --bg-dark: #0f172a;
    --nav-bg: rgb(255 255 255 / 0.92);
    --text: #0f172a;
    --text-body: #1e293b;
    --text-muted: #475569;
    --border: #e2e8f0;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #dbeafe;
    --shot-shadow: 0 20px 50px rgb(15 23 42 / 0.18);
    --missing-bg: #fef3c7;
    --missing-text: #92400e;
    --radius: 12px;
    --font: 'Inter Variable', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
        color-scheme: dark;
        --bg: #0b1120;
        --bg-alt: #111a2e;
        --bg-card: #162036;
        --bg-dark: #020617;
        --nav-bg: rgb(11 17 32 / 0.9);
        --text: #f1f5f9;
        --text-body: #cbd5e1;
        --text-muted: #94a3b8;
        --border: #263247;
        --primary: #3b82f6;
        --primary-hover: #2563eb;
        --primary-soft: rgb(59 130 246 / 0.18);
        --shot-shadow: 0 20px 50px rgb(0 0 0 / 0.5);
        --missing-bg: #422006;
        --missing-text: #fcd34d;
    }
}

:root[data-theme='dark'] {
    color-scheme: dark;
    --bg: #0b1120;
    --bg-alt: #111a2e;
    --bg-card: #162036;
    --bg-dark: #020617;
    --nav-bg: rgb(11 17 32 / 0.9);
    --text: #f1f5f9;
    --text-body: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #263247;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-soft: rgb(59 130 246 / 0.18);
    --shot-shadow: 0 20px 50px rgb(0 0 0 / 0.5);
    --missing-bg: #422006;
    --missing-text: #fcd34d;
}

/* Theme button in the nav */
.theme-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.theme-btn:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.theme-btn svg {
    width: 16px;
    height: 16px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

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

a {
    color: var(--primary);
}

.wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

.wrap.narrow {
    max-width: 820px;
}

.center {
    text-align: center;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 9px;
    border: 2px solid transparent;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.btn:focus-visible {
    outline: 3px solid var(--primary-soft);
    outline-offset: 2px;
}

.btn-large {
    padding: 14px 24px;
    font-size: 17px;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-outline {
    border-color: var(--border);
    color: var(--text);
    background: var(--bg-card);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Without a contact email set, contact buttons and section are hidden */
.no-contact .contact-link,
.no-contact .contact-only,
.no-contact .contact {
    display: none !important;
}

/* === Nav === */
.nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--nav-bg);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 64px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 19px;
    color: var(--text);
    text-decoration: none;
}

.brand .logo {
    display: flex;
    color: var(--primary);
}

.brand .logo svg {
    width: 26px;
    height: 26px;
}

.nav-links {
    display: flex;
    gap: 22px;
    margin-left: auto;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--text);
}

/* === Hero === */
.hero {
    padding: 72px 0 56px;
    background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
}

.hero-inner {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 48px;
    align-items: center;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

h1 {
    margin: 0 0 18px;
    font-size: clamp(34px, 4.4vw, 52px);
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.lead {
    margin: 0 0 28px;
    font-size: 19px;
    color: var(--text-muted);
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-note {
    margin: 16px 0 0;
    font-size: 15px;
    color: var(--text-muted);
}

.hero-shot,
.shot {
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shot-shadow);
}

/* === Sections === */
.section {
    padding: 80px 0;
}

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

h2 {
    margin: 0 0 10px;
    font-size: clamp(28px, 3vw, 36px);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.01em;
}

h3 {
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 700;
}

.section-lead {
    margin: 0 0 36px;
    font-size: 18px;
    color: var(--text-muted);
}

/* Steps */
.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.step {
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.step p {
    margin: 0;
    color: var(--text-muted);
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 800;
}

/* Text + screenshot */
.split {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 48px;
    align-items: center;
}

.checks {
    list-style: none;
    margin: 0;
    padding: 0;
}

.checks li {
    position: relative;
    padding-left: 32px;
    margin-bottom: 12px;
}

.checks li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 32px;
}

.feature {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.feature p {
    margin: 0;
    font-size: 15px;
    color: var(--text-muted);
}

/* Requirements */
.needs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 28px;
}

.need {
    padding: 24px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.need p {
    margin: 0;
    color: var(--text-muted);
}

/* Licence */
.licence {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: center;
    padding: 40px;
    border: 1px solid var(--border);
    border-radius: 16px;
}

.licence .section-lead {
    margin-bottom: 24px;
}

.licence-cta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 28px;
    border-radius: var(--radius);
    background: var(--bg-alt);
}

.licence-cta p {
    margin: 6px 0 0;
    font-weight: 600;
}

/* FAQ */
details {
    border-bottom: 1px solid var(--border);
}

summary {
    padding: 18px 0;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
}

details p {
    margin: 0 0 18px;
    color: var(--text-muted);
}

/* Contact */
.contact {
    background: var(--bg-dark);
    color: #fff;
}

.contact .section-lead {
    color: #cbd5e1;
}

/* Footer */
.footer {
    padding: 28px 0;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-muted);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    align-items: center;
}

.footer-inner .seller {
    flex: 1 1 100%;
    order: 2;
}

.footer-links {
    display: flex;
    gap: 20px;
    margin-left: auto;
}

.footer a {
    color: var(--text-muted);
}

/* === Legal pages === */
.legal {
    padding: 56px 0 80px;
}

.legal h1 {
    font-size: clamp(30px, 3.6vw, 40px);
}

.legal h2 {
    margin-top: 36px;
    font-size: 22px;
}

.legal p,
.legal li {
    color: var(--text-body);
}

.legal .updated {
    color: var(--text-muted);
    font-size: 15px;
}

.legal table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 15px;
}

.legal th,
.legal td {
    text-align: left;
    padding: 10px 12px;
    border: 1px solid var(--border);
    vertical-align: top;
}

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

/* Missing seller data: shown loudly so it gets filled in before going live */
.missing {
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--missing-bg);
    color: var(--missing-text);
    font-weight: 700;
}

/* === Responsive === */
@media (max-width: 1000px) {
    .hero-inner,
    .split,
    .licence {
        grid-template-columns: 1fr;
    }

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

    .steps,
    .needs {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .nav-links {
        display: none;
    }

    .nav-inner {
        gap: 12px;
    }

    /* Phone: theme button (icon only) and "Accedi" together on the right */
    .theme-btn {
        margin-left: auto;
    }

    .theme-btn span {
        display: none;
    }

    .hero {
        padding: 44px 0 36px;
    }

    .section {
        padding: 56px 0;
    }

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

    .licence {
        padding: 24px;
    }

    /* Wide tables in the privacy policy scroll sideways instead of breaking the page */
    .legal table {
        display: block;
        overflow-x: auto;
    }

    .wrap {
        padding: 0 16px;
    }
}

/* === Language selector and translation note === */
.lang-select select {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--bg-card);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.translation-note {
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--bg-alt);
    color: var(--text-muted) !important;
    font-size: 14px;
}

@media (max-width: 700px) {
    .lang-select {
        margin-left: auto;
    }

    .lang-select + .theme-btn {
        margin-left: 0;
    }
}

/* Phones: the bar goes on two rows (logo + login, then language + theme)
   so that long translations never push anything off screen */
@media (max-width: 560px) {
    .nav-inner {
        flex-wrap: wrap;
        height: auto;
        gap: 8px 10px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .nav-inner > .brand {
        flex: 1 0 50%;
    }

    .nav-inner > .btn {
        order: 1;
    }

    /* Long translations and the e-mail address: big buttons may wrap */
    .btn-large {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
        text-align: center;
    }

    .nav-inner > span:empty {
        display: none;
    }

    .lang-select {
        order: 2;
        margin-left: 0;
    }

    .theme-btn {
        order: 3;
        margin-left: 0;
    }
}

/* Highlighted feature across the whole row (judges calling from their phone) */
.feature-wide {
    grid-column: 1 / -1;
    border-color: var(--primary);
    background: linear-gradient(135deg, rgb(59 130 246 / 0.12), transparent 70%), var(--bg-card);
}
