/* ==========================================================================
   Bokförklaring — "Huvudboken, moderniserad"
   Paper, ink, tabular figures — and the red margin rule that carries the
   severity. The visual language is the Swedish cash book's.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

html {
  /* Palette */
  --bf-paper:  #FAFAF7;   /* paper — white with a hint of warmth, not cream */
  --bf-ink:    #1B2A41;   /* ink — blue-black, never pure black */
  --bf-ink-2:  #52607A;   /* ink, thinned — secondary text */
  --bf-green:  #3E6B4F;   /* ledger green — accent, "the books add up" */
  --bf-red:    #B3402A;   /* margin red — error */
  --bf-ochre:  #C7862B;   /* ochre — warning */
  --bf-line:   #E4E2D8;   /* ruled paper */
  --bf-line-2: #EFEEE6;   /* fainter rule */

  /* Lumo mapped onto the palette */
  --lumo-base-color: var(--bf-paper);
  --lumo-body-text-color: var(--bf-ink);
  --lumo-secondary-text-color: var(--bf-ink-2);
  --lumo-primary-color: var(--bf-green);
  --lumo-primary-text-color: var(--bf-green);
  --lumo-primary-color-50pct: rgba(62, 107, 79, 0.5);
  --lumo-primary-color-10pct: rgba(62, 107, 79, 0.1);
  --lumo-error-color: var(--bf-red);
  --lumo-font-family: 'IBM Plex Sans', system-ui, sans-serif;
  --lumo-border-radius-m: 4px;
  --lumo-border-radius-l: 6px;

  background: var(--bf-paper);
}

/* --- The page ------------------------------------------------------------ */

.page {
  max-width: 54rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 4rem) 1.25rem 6rem;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  color: var(--bf-ink);
}

.masthead { margin-bottom: 2.5rem; }

.wordmark {
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--bf-ink);
}

/* The wordmark's full stop in ledger green — a small, stubborn detail */
.wordmark::after {
  content: '.';
  color: var(--bf-green);
}

.tagline {
  margin: 0.5rem 0 0;
  font-size: 1.05rem;
  color: var(--bf-ink-2);
}

/* --- The drop zone ------------------------------------------------------- */

.dropzone {
  border: 1.5px dashed var(--bf-ink-2);
  border-radius: 6px;
  background: transparent;
  padding: 0.75rem;
  transition: border-color 120ms ease, background 120ms ease;
}
.dropzone:hover { border-color: var(--bf-green); }
.dropzone[dragover] {
  border-color: var(--bf-green);
  background: rgba(62, 107, 79, 0.06);
}

.footnote {
  font-size: 0.85rem;
  color: var(--bf-ink-2);
  margin-top: 0.5rem;
}

/* --- Fetching straight from Fortnox --------------------------------------
   The second door into the same review, so it sits under the drop zone as an
   alternative rather than beside it as an equal. Ledger green: this is the
   path where the books add up by themselves. */

.connect {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.connect-button {
  background: transparent;
  color: var(--bf-green);
  border: 1.5px solid var(--bf-green);
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
}
.connect-button:hover { background: rgba(62, 107, 79, 0.08); }

.connect-note {
  font-size: 0.85rem;
  color: var(--bf-ink-2);
}

/* --- After the review: mail it, or watch the books ----------------------
   Two panels under the ledger page, not on it. Drawn on the ruled paper they
   read as part of the report, the lines ran through their text, and they sat
   flush against the page edge with no margin of their own. Side by side when
   there is room, stacked on a phone. */

.next-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.mail-report,
.watch {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: center;
  gap: 0.6rem 0.75rem;
  padding: 1.1rem 1.25rem 1.2rem;
  background: #fff;
  border: 1px solid var(--bf-line);
  border-radius: 6px;
}

/* The one place the product asks to keep something, so it is the one panel
   with a filled ground and a margin rule: a commitment, not another control. */
.watch {
  background: rgba(62, 107, 79, 0.05);
  border-left: 4px solid var(--bf-green);
}

.step-heading {
  flex-basis: 100%;
  margin: 0 0 0.15rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--bf-ink);
}

.mail-field { flex: 1 1 12rem; min-width: 0; }

.mail-button,
.watch-button,
.watch-stop {
  background: transparent;
  color: var(--bf-green);
  border: 1.5px solid var(--bf-green);
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
}
.mail-button:hover { background: rgba(62, 107, 79, 0.08); }
.watch-button:hover { background: rgba(62, 107, 79, 0.1); }

.watch-stop {
  border-color: var(--bf-ink-2);
  color: var(--bf-ink-2);
}
.watch-stop:hover { background: rgba(27, 42, 65, 0.06); }

.mail-note,
.watch-note {
  flex-basis: 100%;
  margin-top: 0.25rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--bf-ink-2);
}

/* --- The ledger page: the report as a page from the books ---------------- */

.ledger-page {
  margin-top: 2.5rem;
  background: #fff;
  border: 1px solid var(--bf-line);
  border-radius: 6px;
  /* Ruled paper — discreet, a memory rather than a stage set */
  background-image: repeating-linear-gradient(
      to bottom, transparent 0, transparent 31px, var(--bf-line-2) 31px, var(--bf-line-2) 32px);
  overflow: hidden;
}

.ledger-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  align-items: baseline;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--bf-line);
}

.company { font-weight: 600; font-size: 1.05rem; }

.figure {
  font-family: 'IBM Plex Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--bf-ink-2);
}

/* --- Summary badges ------------------------------------------------------ */

.summary {
  display: flex;
  gap: 0.6rem;
  padding: 1rem 1.5rem 0.25rem;
}

.badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  border: 1px solid;
}
.badge--error   { color: var(--bf-red);    border-color: var(--bf-red);   background: rgba(179, 64, 42, 0.07); }
.badge--warning { color: var(--bf-ochre);  border-color: var(--bf-ochre); background: rgba(199, 134, 43, 0.08); }
.badge--info    { color: var(--bf-ink-2);  border-color: var(--bf-line);  background: #fff; }

/* --- The finding row: a ledger line with a margin rule ------------------- */
/* The signature: severity IS the cash book's red margin.                  */

.finding {
  position: relative;
  margin: 1.1rem 1.5rem;
  padding: 0.9rem 1.1rem 0.9rem 1.35rem;
  background: #fff;
  border: 1px solid var(--bf-line);
  border-radius: 4px;
}
.finding::before {
  content: '';
  position: absolute;
  inset: -1px auto -1px -1px;
  width: 4px;
  border-radius: 4px 0 0 4px;
}
.finding--error::before   { background: var(--bf-red); }
.finding--warning::before { background: var(--bf-ochre); }
.finding--info::before    { background: var(--bf-ink-2); }

.finding-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.finding h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

.rule-code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--bf-ink-2);
  white-space: nowrap;
  border: 1px solid var(--bf-line);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  background: var(--bf-paper);
}

/* The page is wider than a comfortable line; the prose inside it is not. */
.explanation,
.action { max-width: 44rem; }

.explanation {
  margin: 0.6rem 0 0;
  line-height: 1.55;
  font-size: 0.95rem;
}

.action {
  margin: 0.6rem 0 0;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--bf-line);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--bf-green);
}
.action::before {
  content: 'Förslag — ';
  font-weight: 600;
}

/* --- All clear ----------------------------------------------------------- */

.all-clear {
  padding: 2.25rem 1.5rem 2.5rem;
  text-align: center;
}
.all-clear h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--bf-green);
}
.all-clear p { margin: 0.4rem 0 0; color: var(--bf-ink-2); }

/* --- Accessibility ------------------------------------------------------- */

:focus-visible { outline: 2px solid var(--bf-green); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* --- What we checked: the working out, folded away ------------------------ */
/* Quieter than a finding on purpose — this is the audit trail, not the news. */

.checked-panel {
  margin: 1.1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--bf-line);
  padding-top: 0.9rem;
  background: transparent;
}
.checked-panel::part(summary) {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--bf-ink-2);
  padding: 0.2rem 0;
}
.checked-panel::part(content) { padding: 0; }

.checked-intro {
  margin: 0.4rem 0 1.1rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--bf-ink-2);
  max-width: 34rem;
}

/* Each check keeps the margin line, thinner and in ink — it belongs to the
   same form language as a finding without competing with one. */
.checked-rule {
  border-left: 2px solid var(--bf-line);
  padding: 0.1rem 0 0.1rem 0.85rem;
  margin-bottom: 1rem;
}

.checked-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.checked-what {
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--bf-ink);
}

/* A figure per line: label left, value right, leadered by the ruled paper. */
.checked-figure {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.82rem;
  padding: 0.1rem 0;
}
.checked-label {
  color: var(--bf-ink-2);
  white-space: nowrap;
}
.checked-value {
  font-family: 'IBM Plex Mono', monospace;
  font-variant-numeric: tabular-nums;
  color: var(--bf-ink);
  margin-left: auto;
  text-align: right;
}

/* ==========================================================================
   The landing page — the same ledger, told to someone who has not seen it
   ========================================================================== */

.landing {
  max-width: 54rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.landing .hero { margin-bottom: 3.5rem; }

.landing .lead {
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--bf-ink);
  max-width: 40rem;
  margin: 0.75rem 0 1.75rem;
}

/* Ledger green: the colour of "the books add up", and the only filled control
   on the page. Everything else is paper and ink. */
.cta {
  display: inline-block;
  background: var(--bf-green);
  color: var(--bf-paper);
  padding: 0.7rem 1.4rem;
  border-radius: 4px;
  font-weight: 500;
  text-decoration: none;
  transition: background 120ms ease;
}
.cta:hover { background: #355C44; }

.reassurance {
  font-size: 0.9rem;
  color: var(--bf-ink-2);
  margin-top: 0.85rem;
}

.landing .section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--bf-line);
}

.landing h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.body-text {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--bf-ink);
  max-width: 40rem;
}

/* The checks, as a ruled column — the form the rest of the product is in. */
.check-list { margin-top: 1.25rem; }

.check {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--bf-line-2);
}
.check:last-child { border-bottom: 0; }

.check-what {
  font-size: 0.95rem;
  line-height: 1.5;
}

.check-code {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--bf-ink-2);
  white-space: nowrap;
}

.landing .finding { margin-top: 1.25rem; }

.landing .contact { font-size: 1rem; margin-bottom: 1.5rem; }
.landing .contact a { color: var(--bf-green); }

@media (max-width: 34rem) {
  .check { flex-direction: column; gap: 0.15rem; }
  .check-code { white-space: normal; }
}

/* --- What it costs ------------------------------------------------------
   Priced like a line in the book: the name on the left, the figure on the
   right in tabular mono, a rule under each. No cards, no badges, no "most
   popular" — this is a ledger, not a pricing page. */

.price {
  padding: 1rem 0;
  border-bottom: 1px solid var(--bf-line);
}
.price:last-of-type { border-bottom: 0; }

.price-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.price-name {
  font-size: 1.05rem;
  font-weight: 600;
}

.price-amount {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  color: var(--bf-green);
  white-space: nowrap;
}

.price-body {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--bf-ink);
  margin: 0.4rem 0 0;
  max-width: 34rem;
}

/* The early price is a promise, so it gets the margin rule that carries
   meaning everywhere else — in green, because it is good news. */
.price-early {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--bf-ink-2);
  margin: 0.6rem 0 0;
  padding-left: 0.75rem;
  border-left: 2px solid var(--bf-green);
  max-width: 34rem;
}

.price-yearly {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--bf-ink);
  margin: 0.5rem 0 0;
  max-width: 34rem;
}

.price-fineprint {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--bf-ink-2);
  margin-top: 1.25rem;
}

/* --- Telling us we got it wrong ------------------------------------------
   Quiet on purpose. It should be findable by someone who wants it and
   invisible to someone reading the finding — a report tool that nags for
   feedback is a report tool people stop reading. */

.feedback-link {
  font-size: 0.82rem;
  color: var(--bf-ink-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.feedback-link:hover { color: var(--bf-green); }

.finding .feedback-link {
  display: inline-block;
  margin-top: 0.9rem;
}

/* The page's foot: off the ruling, with the same inset as everything above it. */
.missing {
  padding: 0.9rem 1.5rem;
  background: var(--bf-paper);
  border-top: 1px solid var(--bf-line);
  font-size: 0.88rem;
  color: var(--bf-ink-2);
}

/* --- The user agreement -------------------------------------------------- */

.terms .terms-heading {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 2rem 0 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bf-line);
}

.terms .body-text { max-width: 36rem; }

/* Where to go after the agreement. Each link on its own line and clear of the last clause:
   an anchor is inline, so these ran together with the closing paragraph and with each other,
   and three separate things read as one sentence. */
.agreement-footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--bf-line);
}

.agreement-footer .feedback-link {
  display: block;
  margin-top: 0.4rem;
}

.agreement-footer .feedback-link:first-child { margin-top: 0; }

/* --- Getting started ----------------------------------------------------- */

.step {
  display: flex;
  gap: 0.85rem;
  align-items: baseline;
  padding: 0.5rem 0;
}

.step-number {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.85rem;
  color: var(--bf-green);
  min-width: 1.2rem;
}

.step-text {
  font-size: 1rem;
  line-height: 1.6;
  max-width: 32rem;
}


/* Fortnox's mark, at the foot of the landing page. Quiet by design: it is a fact about
   compatibility, not a seal of approval, and it must not compete with the call to action
   directly above it. Used unaltered — their guidelines will say so, and a framed or
   recoloured logo would look borrowed rather than official. */
/* A section of its own under the hero, not a footer: no rule above it, since the sections
   around it already carry their own spacing. */
.partner {
    display: block;
}

.partner-head {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* Their boiler, quieter than our own prose. It is context, not the pitch. */
.partner-boiler {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--bf-ink-2);
    margin: 0.9rem 0 0;
    max-width: 52ch;
}

.partner-logo {
    width: 116px;
    height: auto;
    opacity: 0.85;
}

.partner-note {
    font-size: 0.85rem;
    color: var(--bf-ink-2);
}

/* ==========================================================================
   The server-rendered pages — landing, checks, guides
   The same ledger, without Vaadin: plain HTML that links this stylesheet, so
   the page a visitor reads first and the review it leads to are styled by the
   same rules. Lumo is not loaded there, so the base is set here.
   ========================================================================== */

body.public {
  margin: 0;
  background: var(--bf-paper);
  color: var(--bf-ink);
  font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.public a { color: var(--bf-green); }
body.public .cta { color: var(--bf-paper); }

.site-header {
  max-width: 54rem;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

body.public .site-mark {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--bf-ink);
  text-decoration: none;
}
.site-mark::after { content: '.'; color: var(--bf-green); }

.site-nav { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: 0.92rem; }
body.public .site-nav a { color: var(--bf-ink-2); text-decoration: none; }
body.public .site-nav a:hover { color: var(--bf-green); }
body.public .site-nav .site-nav-cta { color: var(--bf-green); font-weight: 500; }

body.public .landing { padding-top: 2rem; }

.hero-title {
  font-size: clamp(1.75rem, 5vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}

.crumbs {
  font-size: 0.82rem;
  color: var(--bf-ink-2);
  margin-bottom: 1.25rem;
}
body.public .crumbs a { color: var(--bf-ink-2); }

.more { margin-top: 1.25rem; }
body.public .check-what a { color: var(--bf-ink); text-decoration-color: var(--bf-line); text-underline-offset: 3px; }
body.public .check-what a:hover { color: var(--bf-green); }

.finding h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
.landing .finding { margin-left: 0; margin-right: 0; }

/* --- An article: the prose of a check or a guide ------------------------- */

.article { font-size: 1rem; line-height: 1.7; }
.article p, .article li { max-width: 42rem; }
.article h2 {
  margin: 2.5rem 0 0.6rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--bf-line);
}
.article h3 { font-size: 1.02rem; font-weight: 600; margin: 1.5rem 0 0.3rem; }
.article ul, .article ol { padding-left: 1.25rem; }
.article code {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.88em;
}

.article-rule {
  margin: 0.9rem 0 0;
  color: var(--bf-ink-2);
  font-size: 0.95rem;
}
.article-rule .check-code { margin-right: 0.4rem; }

/* A correcting entry, ruled like a verifikation: mono figures, right-aligned. */
.article table {
  border-collapse: collapse;
  margin: 1rem 0;
  min-width: min(100%, 26rem);
  background: #fff;
  border: 1px solid var(--bf-line);
  font-size: 0.92rem;
}
.article th, .article td {
  padding: 0.45rem 0.8rem;
  border-bottom: 1px solid var(--bf-line-2);
  text-align: left;
}
.article th { font-weight: 600; background: var(--bf-paper); }
.article td + td, .article th + th {
  text-align: right;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.article td:first-child { font-variant-numeric: tabular-nums; }

/* The call to action between the answer and the questions — ledger green, the one
   filled control on the page, the way the landing page has it. */
.article-cta {
  margin: 2.5rem 0 0;
  padding: 1.25rem 1.35rem 1.4rem;
  background: #fff;
  border: 1px solid var(--bf-line);
  border-left: 4px solid var(--bf-green);
  border-radius: 4px;
}
.article .article-cta h2 { margin: 0 0 0.4rem; padding: 0; border: 0; font-size: 1.15rem; }

.related { list-style: none; padding: 0; margin: 0; }
.related li { padding: 0.45rem 0; border-bottom: 1px solid var(--bf-line-2); }
.related li:last-child { border-bottom: 0; }

.site-footer {
  max-width: 54rem;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
  border-top: 1px solid var(--bf-line);
  font-size: 0.85rem;
  color: var(--bf-ink-2);
}
.site-footer p { margin: 0.3rem 0; }
body.public .site-footer a { color: var(--bf-ink-2); }

@media (max-width: 34rem) {
  .article table { font-size: 0.85rem; }
  .article th, .article td { padding: 0.4rem 0.5rem; }
}
