/* TeamHub-IA landing page */

:root {
    --primary: #2e5bff;
    --primary-dark: #1e45d9;
    --primary-light: #2e5bff;

    --bg: #ffffff;
    --bg-soft: #f6f7f9;
    --bg-elevated: #f0f1f4;

    --text-primary: #14181f;
    --text-secondary: #565e6c;
    --text-muted: #8a919e;

    --border: #e4e6ea;
    --border-hover: #c9cdd4;

    --transition-fast: 0.12s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;

    --container-width: 1040px;
    --nav-height: 64px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

h1, h2, h3 { font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1rem; }

/* ── Buttons ─────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 18px;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-quiet {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-quiet:hover { border-color: var(--border-hover); background: var(--bg-soft); }

.btn-full { width: 100%; }

/* ── Navbar ──────────────────────────────────────────────── */

.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo { font-weight: 600; letter-spacing: -0.02em; }

.nav-links {
    display: flex;
    gap: 24px;
    margin-right: auto;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.nav-links a:hover { color: var(--text-primary); }

.nav-actions { display: flex; align-items: center; gap: 16px; }

.nav-signin { font-size: 0.9375rem; color: var(--text-secondary); }
.nav-signin:hover { color: var(--text-primary); }

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
}

.mobile-menu-btn span {
    width: 18px;
    height: 1.5px;
    background: var(--text-primary);
    transition: transform var(--transition-base), opacity var(--transition-base);
}

/* ── Hero ────────────────────────────────────────────────── */

.hero { padding: 96px 0 80px; }

.hero h1 { max-width: 16ch; }

.lede {
    margin-top: 20px;
    max-width: 54ch;
    font-size: 1.0625rem;
    color: var(--text-secondary);
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* ── Sections ────────────────────────────────────────────── */

.section {
    padding: 72px 0;
    border-top: 1px solid var(--border);
    /* Native anchor offset — the sticky navbar would otherwise cover the heading. */
    scroll-margin-top: var(--nav-height);
}

.section h2 { margin-bottom: 36px; }

/* What it does */
.what-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 36px 48px;
}

.what-grid p { margin-top: 6px; color: var(--text-secondary); font-size: 0.9375rem; }

/* How it works */
.steps { list-style: none; max-width: 620px; }

.steps li {
    display: flex;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.steps li:last-child { border-bottom: 0; }
.steps b { color: var(--text-primary); font-weight: 500; }

.step-n {
    flex-shrink: 0;
    width: 24px;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

/* ── Pricing ─────────────────────────────────────────────── */

.pricing-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 36px;
}

.pricing-head h2 { margin-bottom: 0; }

.pricing-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.toggle-label.active { color: var(--text-primary); }

.toggle-switch { position: relative; width: 38px; height: 22px; cursor: pointer; }
.toggle-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: background var(--transition-base);
    pointer-events: none;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition-base);
}

.toggle-switch input:checked + .toggle-slider { background: var(--primary); border-color: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }
.toggle-switch input:focus-visible + .toggle-slider { outline: 2px solid var(--primary); outline-offset: 2px; }

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.plan {
    display: flex;
    flex-direction: column;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: 2px;
    margin: 12px 0 20px;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.plan-price .currency { font-size: 1.125rem; }
.plan-price .period { font-size: 0.875rem; font-weight: 400; color: var(--text-muted); margin-left: 4px; }

.plan ul {
    list-style: none;
    margin-bottom: 24px;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.plan li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.plan li:last-child { border-bottom: 0; }
.plan .btn { margin-top: auto; }

/* ── Sign up ─────────────────────────────────────────────── */

.signup-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
    gap: 56px;
    align-items: start;
}

.signup-intro h2 { margin-bottom: 12px; }
.signup-intro p { color: var(--text-secondary); max-width: 40ch; }

.signup-form { display: flex; flex-direction: column; gap: 16px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label { font-size: 0.875rem; color: var(--text-secondary); }

.form-group input,
.form-group select {
    height: 42px;
    padding: 0 12px;
    font: inherit;
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus { outline: none; border-color: var(--primary); }

.form-hint { font-size: 0.8125rem; color: var(--text-muted); }

.form-checkbox {
    display: flex;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-checkbox input { margin-top: 3px; accent-color: var(--primary); }
.form-checkbox a { color: var(--primary); }

.signin-link { font-size: 0.875rem; color: var(--text-secondary); text-align: center; }
.signin-link a { color: var(--primary); }

/* ── Footer ──────────────────────────────────────────────── */

.footer { border-top: 1px solid var(--border); padding: 28px 0; }

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 28px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-brand { font-weight: 600; color: var(--text-primary); }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; margin-right: auto; }
.footer-links a:hover { color: var(--text-primary); }

/* ── Feedback (toast + button spinner) ───────────────────── */

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 100;
    max-width: calc(100vw - 32px);
    padding: 12px 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--text-primary);
    color: #fff;
    font-size: 0.875rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.toast-error { background: #c0342f; border-color: #c0342f; }

.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    vertical-align: -2px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.btn:disabled { opacity: 0.6; cursor: default; }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 820px) {
    .nav-links, .nav-actions { display: none; }
    .mobile-menu-btn { display: flex; margin-left: auto; }

    /* Open menu grows the bar itself — no absolute offsets to keep in sync. */
    .navbar:has(.nav-links.show) { height: auto; }
    .nav-container { flex-wrap: wrap; gap: 0 16px; }
    .nav-container > .logo, .nav-container > .mobile-menu-btn { height: var(--nav-height); display: flex; align-items: center; }

    .nav-links.show, .nav-actions.show {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        width: 100%;
    }

    .nav-links.show { padding-top: 4px; }
    .nav-actions.show { padding: 14px 0 20px; }

    .mobile-menu-btn.active span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
    .mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
    .mobile-menu-btn.active span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
    .signup-wrap { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

@media (max-width: 520px) {
    .hero { padding: 64px 0 56px; }
    .section { padding: 56px 0; }
    .form-row { grid-template-columns: 1fr; }
    .hero-cta .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}
