/* Receipt Book — landing page (M1, static). Loads after base.css. */

[hidden] { display: none !important; }

@font-face {
    font-family: "Bricolage Grotesque";
    src: url("../fonts/bricolage-grotesque.woff2") format("woff2");
    font-weight: 500 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --display: "Bricolage Grotesque", var(--font);
    --ink: #1b1840;
    --marigold: #f2a81d;
    --wa: #128c7e;
    --wa-bubble: #dcf8c6;
}
:root[data-theme="dark"] { --ink: #eceaff; --wa-bubble: #1f4d3f; }

h1, h2, .section-title, .closing h2 { font-family: var(--display); letter-spacing: -.025em; }
.btn--whatsapp { background: var(--wa); color: #fff; }
.btn--whatsapp:hover { background: #0e7568; }

/* Hero */
.hero { padding: 32px 0 56px; scroll-margin-top: 64px; }
.hero__inner { display: grid; gap: 32px; }
.eyebrow {
    display: inline-block; margin: 0 0 14px; padding: 4px 10px; border-radius: 999px;
    font-size: 13px; font-weight: 600; color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, transparent);
}
.hero__title { font-size: clamp(34px, 7vw, 56px); font-weight: 800; line-height: 1.04; color: var(--ink); max-width: 12.5em; }
.lede { font-size: 18px; color: var(--text-muted); margin: 18px 0 28px; max-width: 32em; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__ctas .btn { flex: 1 1 auto; justify-content: center; }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }
.hero__points { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--text-muted); font-size: 14px; }
.hero__points li::before { content: "✓"; color: var(--accent); font-weight: 700; margin-right: 6px; }

.preview-hint {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin: 0 0 10px; font-size: 15px; font-weight: 600; color: var(--primary); text-align: center;
}
.preview-hint::before {
    content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--primary);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 50%, transparent);
    animation: hint-pulse 1.8s ease-out infinite;
}
.preview-hint.is-done { color: var(--accent); }
.preview-hint.is-done::before { background: var(--accent); animation: none; }
@keyframes hint-pulse { to { box-shadow: 0 0 0 10px transparent; } }

/* Invoice preview — always "paper", in both themes */
.invoice {
    background: var(--paper); color: var(--paper-text);
    border: 1px solid var(--paper-border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px; font-size: 14px;
    color-scheme: light;
}
.inv-field {
    width: 100%; display: block; font: inherit; color: inherit;
    background: transparent; border: 1px dashed transparent; border-radius: 6px;
    padding: 3px 6px; margin: 0 -6px; min-height: 30px;
    transition: border-color .15s ease, background-color .15s ease;
}
.inv-field { border-color: #dfe3ec; background: #fbfcfe; }
.inv-field:hover { border-color: #b9c0cf; }
.inv-field:focus { outline: none; border-color: #818cf8; border-style: solid; background: #eef2ff; }
.inv-field--strong { font-weight: 700; font-size: 15px; }
.inv-field--muted { color: var(--paper-muted); }
.inv-field::placeholder { color: #4b5567; opacity: 1; }
.inv-field--right { text-align: right; }
.inv-field--tax { display: inline-block; width: 3.2em; margin: 0 2px; text-align: right; min-height: 26px; }
.inv-field--select {
    display: inline-block; width: auto; flex-shrink: 0; margin: 0; padding-right: 22px; min-height: 30px; cursor: pointer;
    border-color: var(--paper-border); background: var(--paper);
}
.tax-picker { gap: 6px; flex-wrap: wrap; }
.tax-custom { display: inline-flex; align-items: center; }
.tax-custom[hidden] { display: none; }

.invoice__head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--paper-border); }
.invoice__head > div:first-child { flex: 1; min-width: 0; }
.invoice__meta { text-align: right; width: 9.5em; flex-shrink: 0; }
.invoice__title { display: block; font-weight: 800; letter-spacing: .12em; color: #4f46e5; font-size: 16px; padding-right: 0; }
.invoice__parties { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; }
.invoice__parties > div:first-child { flex: 1; min-width: 0; }
.invoice__dates { text-align: right; width: 10em; flex-shrink: 0; }
.invoice__label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--paper-muted); margin-bottom: 2px; }

.items { width: 100%; border-collapse: collapse; table-layout: fixed; }
.items th {
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
    color: var(--paper-muted); text-align: left; padding: 8px 4px;
    border-bottom: 1px solid var(--paper-border);
}
.items th:nth-child(2) { width: 3em; }
.items th:nth-child(3) { width: 6.4em; }
.items th:nth-child(4) { width: 7.6em; }
.items th:nth-child(5) { width: 30px; }
.items td { padding: 4px; border-bottom: 1px solid var(--paper-border); vertical-align: middle; }
.items .num { text-align: right; }
.items td .inv-field { margin: 0; padding: 3px 3px; }
.items__amount { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; font-size: 13px; padding-right: 8px !important; }
.items__row.is-new { animation: row-in .25s ease; }
@keyframes row-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.row-remove {
    width: 24px; height: 24px; border: 0; border-radius: 6px; cursor: pointer;
    background: transparent; color: var(--paper-muted); font-size: 18px; line-height: 1;
}
.row-remove:hover { background: #fee2e2; color: #b91c1c; }

.add-line {
    margin-top: 10px; border: 1px dashed var(--paper-border); background: transparent;
    color: #4f46e5; font: inherit; font-weight: 600; font-size: 13px;
    padding: 6px 12px; border-radius: 8px; cursor: pointer; min-height: 36px;
}
.add-line:hover { background: #eef2ff; border-color: #c7d2fe; }

.totals { margin: 16px 0 0 auto; max-width: 260px; }
.totals div { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
.totals dt { color: var(--paper-muted); display: flex; align-items: center; }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.totals__grand { border-top: 2px solid var(--paper-text); margin-top: 6px; padding-top: 8px !important; }
.totals__grand dt, .totals__grand dd { color: var(--paper-text); font-weight: 800; font-size: 18px; }

.preview-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.preview-actions .btn { justify-content: center; padding-left: 12px; padding-right: 12px; }
.preview-actions__error { margin: 10px 0 0; padding: 10px 12px; border: 1px solid #dc2626; border-radius: 10px; background: color-mix(in srgb, #dc2626 10%, transparent); color: var(--text); font-size: 14px; }
.preview-actions__note { margin: 10px 0 0; color: var(--text-muted); font-size: 14px; }

/* What the customer gets on WhatsApp: updates as you type */
.wa-preview { margin-top: 16px; }
.wa-preview__label { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.wa-bubble {
    position: relative; max-width: 340px; padding: 10px 12px 8px; border-radius: 4px 14px 14px 14px;
    background: var(--wa-bubble); color: var(--text); font-size: 14px; line-height: 1.45;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .08);
}
.wa-bubble__text { margin: 0 0 6px; }
.wa-bubble__link { display: block; color: #027eb5; font-size: 13px; text-decoration: underline; }
:root[data-theme="dark"] .wa-bubble__link { color: #53bdeb; }
.wa-bubble__pay {
    display: block; margin: 8px 0 4px; padding: 8px 10px; border-radius: 10px; text-align: center;
    background: var(--marigold); color: #2a1a00; font-weight: 700;
}
.wa-bubble__meta { display: block; text-align: right; font-size: 11px; color: var(--text-muted); }
.wa-ticks { color: #8696a0; letter-spacing: -3px; transition: color .3s ease; }
.wa-bubble.is-live .wa-ticks { color: #34b7f1; }

/* How it works: a real sequence, so the steps are numbered */
.how { padding: 56px 0; }
.steps { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 24px; counter-reset: step; }
.step { position: relative; padding-left: 56px; counter-increment: step; }
.step::before {
    content: counter(step); position: absolute; left: 0; top: -4px; width: 40px; height: 40px;
    display: grid; place-items: center; border-radius: 50%;
    background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary);
    font-family: var(--display); font-weight: 800; font-size: 20px;
}
.step h3 { font-family: var(--display); font-size: 20px; margin-bottom: 6px; color: var(--ink); }
.step p { margin: 0; color: var(--text-muted); max-width: 30em; }

/* Ask happy users to pass it on */
.share-band { padding: 8px 0 56px; }
.share-band__inner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px;
    padding: 28px; border-radius: 20px; background: var(--wa-bubble);
}
.share-band h2 { font-size: clamp(22px, 4vw, 30px); color: var(--ink); }
.share-band p { margin: 6px 0 0; color: var(--text-muted); }
:root[data-theme="dark"] .share-band p { color: #cfe9de; }

/* Social proof */
.proof { padding: 40px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
.proof__inner { display: grid; gap: 24px; }
.proof__count { margin: 0; text-align: center; color: var(--text-muted); font-size: 17px; }
.proof__count strong { color: var(--text); }
.proof__quotes { display: grid; gap: 16px; }
.quote { margin: 0; padding: 20px; border-radius: var(--radius); background: var(--surface-2); }
.quote blockquote { margin: 0 0 10px; font-size: 16px; }
.quote figcaption { color: var(--text-muted); font-size: 14px; }

/* Sections */
.features, .pricing { padding: 64px 0; }
.section-title { font-size: clamp(26px, 5vw, 36px); font-weight: 800; text-align: center; }
.section-sub { text-align: center; color: var(--text-muted); max-width: 36em; margin: 12px auto 0; }

.feature-grid { display: grid; gap: 16px; margin-top: 32px; }
.feature { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.feature h3 { font-size: 18px; margin-bottom: 8px; }
.feature p { margin: 0; color: var(--text-muted); }

/* Pricing */
.pricing { background: var(--surface); border-top: 1px solid var(--border); scroll-margin-top: 64px; }
.plans { display: grid; gap: 16px; margin-top: 36px; }
.plan {
    position: relative; padding: 24px; border-radius: var(--radius);
    background: var(--bg); border: 1px solid var(--border);
    transition: transform .2s ease, box-shadow .2s ease;
}
.plan:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.plan--featured { border: 2px solid var(--primary); }
.plan__badge {
    position: absolute; top: -12px; left: 24px; padding: 3px 10px; border-radius: 999px;
    background: var(--primary); color: var(--primary-text); font-size: 12px; font-weight: 700;
}
.plan--free { border: 2px solid var(--accent); }
.plan__badge--free { background: var(--accent); color: #04281c; }
.footer__maker { font-weight: 600; color: var(--text); }
.plan__name { font-size: 18px; }
.plan__price { margin: 8px 0 16px; color: var(--text-muted); }
.plan__price span { font-size: 34px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.plan__features { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 15px; }
.plan__features li { padding-left: 24px; position: relative; }
.plan__features li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.pricing__cta { text-align: center; margin-top: 40px; }
.pricing__note { color: var(--text-muted); font-size: 14px; margin: 12px 0 0; }

/* Closing band */
.closing { padding: 56px 0; background: linear-gradient(135deg, #4338ca, #6d28d9 60%, #0f766e); color: #fff; }
.closing__inner { display: grid; gap: 20px; justify-items: center; text-align: center; }
.closing h2 { font-size: clamp(24px, 5vw, 34px); font-weight: 800; }

/* Footer */
.footer { padding: 28px 0; color: var(--text-muted); font-size: 14px; }
.footer__inner { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--text); }


/* Document type switcher above the try-it preview */
.type-switch { display: flex; justify-content: center; gap: 6px; margin: 0 0 12px; }
.type-switch__btn {
    padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-muted); font: inherit; font-size: 14px; cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.type-switch__btn:hover { border-color: var(--primary); color: var(--primary); }
.type-switch__btn.is-active { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }

/* Sign-up nudge after a PDF download */
.save-nudge {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; padding: 14px 16px;
    border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
    background: color-mix(in srgb, var(--primary) 8%, var(--surface)); font-size: 14px;
}
.save-nudge p { margin: 0; flex: 1 1 16em; }

/* Not just invoices: each type as a little sheet of paper */
.create { padding: 64px 0 24px; scroll-margin-top: 64px; }
.sheet-filter { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 24px 0 0; }
.sheet-filter__btn {
    padding: 7px 16px; border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.sheet-filter__btn:hover { border-color: var(--primary); color: var(--primary); }
.sheet-filter__btn.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.sheets {
    list-style: none; margin: 28px 0 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 32px 20px;
}
.sheet { display: block; color: var(--text); text-decoration: none; }
.sheet__paper {
    position: relative; display: flex; flex-direction: column; gap: 5px;
    aspect-ratio: 1 / 1.08; padding: 14px 14px 12px; margin-bottom: 12px; overflow: hidden;
    background: var(--paper); color: #1f2937; border: 1px solid var(--paper-border); border-radius: 6px;
    box-shadow: 0 1px 1px rgba(15, 23, 42, .05), 0 8px 18px -10px rgba(15, 23, 42, .25);
    font-size: 11px; line-height: 1.3; font-variant-numeric: tabular-nums;
    transform: rotate(var(--tilt, 0deg));
    transition: transform .2s ease, box-shadow .2s ease;
}
.sheets__item:nth-child(3n+1) .sheet__paper { --tilt: -1.2deg; }
.sheets__item:nth-child(3n+2) .sheet__paper { --tilt: .8deg; }
.sheet:hover .sheet__paper, .sheet:focus-visible .sheet__paper {
    transform: translateY(-6px) rotate(0deg);
    box-shadow: 0 2px 2px rgba(15, 23, 42, .05), 0 18px 30px -12px rgba(79, 70, 229, .45);
}
.sheet__title {
    align-self: flex-end; max-width: 100%; text-align: right; margin-bottom: 4px;
    font-weight: 800; font-size: 11px; line-height: 1.25; letter-spacing: .12em; color: #4f46e5;
}
.sheet__to { font-weight: 700; color: #111827; padding-bottom: 5px; border-bottom: 1px solid #e5e7eb; margin-bottom: 2px; }
.sheet__row { display: flex; justify-content: space-between; gap: 6px; color: #374151; }
.sheet__row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet__row > span:last-child { white-space: nowrap; }
.sheet__row--total { margin-top: auto; padding-top: 6px; border-top: 1.5px solid #111827; font-weight: 800; color: #111827; font-size: 12px; }
.sheet__stamp {
    position: absolute; left: 12px; bottom: 40px; padding: 2px 7px; border-radius: 4px;
    background: var(--marigold); color: #2a1a00; font-weight: 800; font-size: 10px;
}
.sheet__stamp--paid {
    background: transparent; color: #059669; border: 2px solid #059669; letter-spacing: .1em;
    transform: rotate(-10deg); left: auto; right: 14px; bottom: 44px;
}
.sheets__item[data-group="buying"] .sheet__title { color: #0f766e; }
.sheets__item[data-group="other"] .sheet__title { color: #b45309; }
.sheet__name { display: block; font-weight: 700; }
.sheet:hover .sheet__name { color: var(--primary); }
.sheet__desc { display: block; margin-top: 2px; font-size: 14px; line-height: 1.4; color: var(--text-muted); }
.sheet__cta { display: inline-block; margin-top: 6px; font-size: 14px; font-weight: 700; color: var(--primary); }
.sheet:hover .sheet__cta { text-decoration: underline; }

/* Small phones: tighter invoice */
@media (max-width: 420px) {
    .preview-actions { grid-template-columns: 1fr; }
    .invoice { padding: 14px; font-size: 13px; }
    .items th:nth-child(2) { width: 2.6em; }
    .items th:nth-child(3) { width: 5.2em; }
    .items th:nth-child(4) { width: 6.8em; }
    .items__amount { font-size: 12px; padding-right: 4px !important; }
    .invoice__meta { width: 7.5em; }
    .invoice__dates { width: 8.5em; }
}

/* Tablet: the home page header has three buttons, so "Sign up free" waits for 900px (Log in and Make an invoice stay) */
@media (min-width: 720px) and (max-width: 899px) {
    .nav__signup { display: none; }
}
/* Tablet+ */
@media (min-width: 720px) {
    .nav__links { display: flex; }
    .nav__cta { display: inline-flex; }
    .proof__quotes { grid-template-columns: 1fr 1fr; }
    .feature-grid { grid-template-columns: repeat(3, 1fr); }
    .hero__ctas .btn { flex: 0 0 auto; }
    .steps { grid-template-columns: repeat(3, 1fr); }
    .doc-groups { grid-template-columns: repeat(3, 1fr); align-items: start; }
    .plans { grid-template-columns: repeat(2, 1fr); }
    .invoice { padding: 28px; }
}

/* Desktop */
@media (min-width: 1024px) {
    .hero { padding: 72px 0 88px; }
    .hero__inner {
        grid-template-columns: .9fr 1.1fr; grid-template-areas: "copy preview" "wa preview";
        grid-template-rows: auto 1fr; align-items: start; column-gap: 56px; row-gap: 28px;
    }
    .hero__copy { grid-area: copy; padding-top: 40px; }
    .hero__preview { grid-area: preview; }
    .wa-preview { grid-area: wa; margin-top: 0; }
    .plans { grid-template-columns: repeat(4, 1fr); }
}

/* Legal pages (privacy, terms, refunds) */
.legal { padding: 24px 0 48px; }
.legal__inner { max-width: 760px; }
.legal__tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.legal__tabs a {
    padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
    font-size: 14px; color: var(--text-muted); text-decoration: none;
}
.legal__tabs a[aria-current="page"] { border-color: var(--primary); color: var(--primary); font-weight: 600; }
.legal__draft {
    margin: 0 0 20px; padding: 12px 14px; border-radius: 12px; font-size: 14px;
    background: color-mix(in srgb, #f59e0b 14%, var(--surface)); border: 1px solid color-mix(in srgb, #f59e0b 40%, var(--border));
}
.legal__body { overflow-wrap: anywhere; }
.legal__body h1 { font-size: clamp(28px, 6vw, 38px); margin: 0 0 4px; }
.legal__body h2 { font-size: 21px; margin: 32px 0 8px; }
.legal__body h3 { font-size: 16px; margin: 20px 0 6px; }
.legal__body p, .legal__body li { line-height: 1.65; }
.legal__body ul { padding-left: 20px; }
.legal__body li + li { margin-top: 6px; }
.legal__body code { font-size: .9em; padding: 1px 5px; border-radius: 6px; background: color-mix(in srgb, var(--text) 8%, transparent); }
.legal__updated { color: var(--text-muted); margin: 0 0 20px; }
.legal-todo { padding: 0 4px; border-radius: 4px; background: color-mix(in srgb, #f59e0b 35%, transparent); color: inherit; }
.legal__cta { white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
    .preview-hint::before { animation: none; }
    .wa-ticks { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
    .sheet__paper { transition: none; transform: none; }
}

/* Help pages */
.help-apps { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 15px; }
.help-apps th, .help-apps td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.help-apps th { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.help-apps a { font-weight: 600; }
.help-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.pricing__toggle { text-align: center; margin-top: 8px; }
.plan__save { display: block; margin-top: 2px; font-size: 13px; font-weight: 700; color: var(--accent); }
