/* Simple Invoices: shared styles for the marketing site, auth pages and app */
:root {
    --bg: #f7f6f2;
    --surface: #ffffff;
    --surface-2: #efede6;
    --ink: #1b2421;
    --muted: #5d6965;
    --line: #dcd9cf;
    --brand: #1f6f5c;
    --brand-ink: #ffffff;
    --brand-soft: #e2efeb;
    --accent: #c2572b;
    --danger: #b3261e;
    --danger-soft: #fbe9e7;
    --warn: #8a5a00;
    --warn-soft: #fdf1d6;
    --ok: #1c6b3a;
    --ok-soft: #e1f2e6;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(27, 36, 33, .06), 0 8px 24px rgba(27, 36, 33, .06);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121816;
        --surface: #1a2220;
        --surface-2: #222c29;
        --ink: #e8ece9;
        --muted: #9aa8a3;
        --line: #2f3a37;
        --brand: #4fb39a;
        --brand-ink: #0c1512;
        --brand-soft: #1d302b;
        --accent: #e58a63;
        --danger: #f2877f;
        --danger-soft: #3a1f1d;
        --warn: #e5b85c;
        --warn-soft: #33290f;
        --ok: #73c990;
        --ok-soft: #17301f;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.55 var(--font);
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; text-wrap: balance; }
p { margin: 0 0 1em; }
a { color: var(--brand); }
img { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4em;
    padding: .55em 1em; border-radius: 8px; border: 1px solid transparent;
    font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-lg { padding: .75em 1.3em; font-size: 1.05rem; }
.btn-sm { padding: .3em .7em; font-size: .875rem; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--brand); outline-offset: 2px;
}

/* Marketing header and footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.bar { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.site-nav { display: flex; gap: 20px; margin-right: auto; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-actions { display: flex; gap: 10px; }
.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 64px; padding: 40px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.footer-grid nav a { display: block; color: var(--ink); text-decoration: none; padding: 3px 0; }
.footer-grid nav a:hover { text-decoration: underline; }
.footer-base { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .875rem; }

/* Marketing sections */
.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow { color: var(--brand); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; margin-bottom: 12px; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -.02em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 56ch; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 12px; }
.page-head { padding: 56px 0 8px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -.02em; }
.section { padding: 40px 0; }
.section-alt { background: var(--surface-2); padding: 56px 0; margin-top: 24px; }
.section-title { text-align: center; font-size: 1.7rem; margin-bottom: 28px; }
.section-title.left { text-align: left; font-size: 1.3rem; margin-bottom: 16px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { font-size: 1.05rem; }
.card p { color: var(--muted); margin: 0; }
.steps { text-align: center; }
.step-list { list-style: none; counter-reset: step; padding: 0; margin: 0 auto 28px; max-width: 640px; text-align: left; }
.step-list li { counter-increment: step; position: relative; padding: 12px 0 12px 52px; color: var(--muted); }
.step-list li strong { color: var(--ink); }
.step-list li::before {
    content: counter(step); position: absolute; left: 0; top: 10px; width: 34px; height: 34px;
    border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 700;
    display: grid; place-items: center;
}

/* Hero invoice illustration */
.hero-art { display: flex; justify-content: center; }
.paper {
    position: relative; width: min(100%, 380px); background: #fff; color: #1b2421;
    border-radius: 6px; padding: 26px; box-shadow: var(--shadow); transform: rotate(1.5deg);
    border: 1px solid #e4e1d8; font-size: .9rem;
}
.paper-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.paper-logo { width: 44px; height: 44px; border-radius: 8px; background: #1f6f5c; }
.paper-title { text-align: right; display: grid; }
.paper-title strong { letter-spacing: .08em; }
.paper-title span, .paper-meta span { color: #6b7672; font-size: .8rem; }
.paper-meta { display: flex; justify-content: space-between; margin-bottom: 18px; }
.paper-meta div { display: grid; }
.paper-lines { width: 100%; border-collapse: collapse; }
.paper-lines td { padding: 7px 0; border-top: 1px solid #ebe8df; }
.paper-lines td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.paper-lines .total td { font-weight: 700; border-top: 2px solid #1b2421; }
.stamp {
    position: absolute; right: 22px; top: 92px; transform: rotate(-14deg);
    border: 3px solid #c2572b; color: #c2572b; font-weight: 800; letter-spacing: .12em;
    padding: 2px 12px; border-radius: 6px; opacity: .85;
}

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 20px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; }
.plan-highlight { border-color: var(--brand); box-shadow: var(--shadow); }
.plan h2 { font-size: 1.2rem; margin-bottom: 4px; }
.price { font-size: 2.2rem; font-weight: 700; margin: 8px 0 12px; }
.price span { font-size: 1rem; font-weight: 400; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 0 0 22px; flex: 1; }
.plan li { padding: 6px 0 6px 24px; position: relative; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 700; }

/* Error page */
.error-page { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.error-box { text-align: center; max-width: 720px; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--brand); margin: 0; line-height: 1; }
.error-detail { text-align: left; background: var(--surface); border: 1px solid var(--line); padding: 14px; border-radius: 8px; overflow: auto; font: .8rem/1.5 var(--mono); }

@media (max-width: 860px) {
    .hero { padding: 40px 0 32px; }
    .hero-grid { grid-template-columns: 1fr; }
    .cards, .cards-2, .plans { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .site-nav { order: 3; width: 100%; margin: 0 0 12px; }
    .bar { gap: 12px; padding-top: 10px; }
    .site-actions { margin-left: auto; }
}

/* Forms (shared by auth pages and the app) */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 5px; font-size: .925rem; }
.field label .muted { font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"],
input[type="search"], input[type="url"], input[type="tel"], select, textarea {
    width: 100%; padding: .55em .7em; font: inherit; color: var(--ink);
    background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
textarea { resize: vertical; min-height: 4.5em; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field .hint { margin: 5px 0 0; font-size: .85rem; color: var(--muted); }
.field .error { margin: 5px 0 0; font-size: .875rem; color: var(--danger); font-weight: 500; }
.check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; }
.check input { margin-top: .3em; width: 1.05em; height: 1.05em; flex: none; accent-color: var(--brand); }
.btn-block { width: 100%; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mt { margin-top: 16px; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }

/* Alerts */
.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert-warn, .alert-info { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.alert a { color: inherit; font-weight: 600; }

/* Auth pages */
.auth-page { display: grid; place-items: start center; min-height: 100vh; padding: 48px 16px; }
.auth-box { width: 100%; max-width: 420px; }
.auth-box > .brand { justify-content: center; width: 100%; margin-bottom: 20px; font-size: 1.25rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.panel h1 { font-size: 1.45rem; }
.auth-footer { text-align: center; margin-top: 18px; color: var(--muted); }
