/* pages.css - the inner pages (dashboard, sign-in, quickstart, knowledge,
   legal texts, protocol page, error pages) on the foundation. Tokens,
   fonts, buttons, header bar, menu and footer come from foundation.css;
   this file gives the inner pages' existing class names the foundation
   look. No motion here except the dashboard's one-time logo turn. */

/* --- Header (shared with /docs) ---------------------------------------- */
.f-site .f-lock { font-size: 19px; min-height: 44px; }
.f-site .f-lock b { color: var(--brand-deep); font-weight: 800; }
.f-account { display: flex; align-items: center; gap: 12px; margin-left: 20px;
  font: 500 12px/1.4 var(--mono); color: var(--ink-2); }
.f-account form, .f-menu__account form { margin: 0; }
.f-account__plan { margin-left: 6px; padding: 3px 9px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); color: var(--ink); }
.f-account .f-btn, .f-menu__account .f-btn { padding: 0 14px; font-size: 14px; }
.f-menu__account { display: grid; gap: 8px; margin-top: 6px; padding: 12px 12px 4px;
  border-top: 1px solid var(--line); font: 500 12px/1.4 var(--mono); color: var(--ink-2); }
@media (max-width: 880px) {
  .f-site .f-nav, .f-site .f-account { display: none; }
  .f-site .f-menu { margin-left: auto; }
}

/* --- Page column and headings ----------------------------------------- */
/* <main> keeps the .f-wrap width and side padding, so its left edge is the
   logo's; the content is capped at 960 px and stays left-aligned. The
   sign-in grid spans the whole wrapper so its card stays centred. :where()
   keeps the cap at zero specificity, so reading widths (.lesespalte 68ch,
   .untertitel ...) still win. */
.f-page { padding-top: clamp(24px, 4vw, 44px); padding-bottom: 72px; }
:where(.f-page > :not(.f-auth)) { max-width: 960px; }
.f-page > h1, .f-page .lesespalte > h1 {
  font: 800 40px/1.1 var(--sans); letter-spacing: -0.03em; margin: 0 0 10px; }
.untertitel { color: var(--ink-2); font-size: 15px; margin: 0 0 28px; max-width: 68ch; }

/* --- Cards: foundation .f-card look, "§" line as a mono eyebrow -------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px; margin-bottom: 20px; }
.abschnitt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px;
  margin: 0 0 14px; }
.abschnitt .par { font: 500 11px/1 var(--mono); letter-spacing: .14em;
  text-transform: uppercase; color: var(--mute); }
.abschnitt h2 { font: 600 20px/1.3 var(--sans); letter-spacing: -0.01em; margin: 0; }
.abschnitt .zusatz { margin-left: auto; font: 500 12px/1.4 var(--mono); color: var(--mute); }
.card h3 { font: 600 16px/1.4 var(--sans); margin: 18px 0 6px; }
.card ul, .card ol { margin: 0 0 10px; padding-left: 1.3em; }

/* --- Text ----------------------------------------------------------------- */
.text { font-size: 16px; line-height: 1.55; color: var(--ink-2); margin: 0; max-width: 68ch; }
.hinweis { color: var(--ink-2); font-size: 14px; margin: 12px 0 0; }
.leer { color: var(--mute); font-size: 14px; }
.fehler { color: var(--err); font-size: 14px; }
p.fehler { background: var(--err-bg); border-radius: 10px; padding: 10px 12px; }
.notiz { font-size: 14px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--bg); }
.mono, td.mono { font-family: var(--mono); font-size: 13px; }
.text code, .hinweis code, .card li code { font: 400 .86em var(--mono); background: var(--bg);
  border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }

/* --- Forms and buttons inside <main> --------------------------------------- */
.f-page input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.f-page select,
.f-page textarea {
  min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: 400 16px/1.3 var(--sans); }
.f-page input::placeholder, .f-page textarea::placeholder { color: var(--mute); }
.f-page button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 0 18px; border: 1px solid var(--brand-deep); border-radius: 10px;
  background: var(--brand-deep); color: var(--on-brand); font: 600 15px/1 var(--sans);
  cursor: pointer; }
.f-page button:hover { opacity: .92; }
.f-page button.leise { background: transparent; border-color: var(--line); color: var(--ink); }
.f-page button.leise:hover { border-color: var(--brand-deep); color: var(--brand-deep); opacity: 1; }
.f-page button.stempel { background: transparent; border-color: var(--err); color: var(--err);
  font: 500 12px/1 var(--mono); letter-spacing: .06em; padding: 0 12px; }
.f-page button.stempel:hover { background: var(--err-bg); opacity: 1; }
form.inline { display: inline; }
.formzeile { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.glossar { display: grid; gap: 10px; margin-top: 12px; }
.f-page .glossar textarea { width: 100%; min-height: 140px; resize: vertical;
  font: 400 14px/1.5 var(--mono); }
.zustimmung { display: flex; gap: 10px; align-items: flex-start; min-height: 44px;
  font-size: 14px; color: var(--ink-2); margin: 4px 0 16px; cursor: pointer; }
.zustimmung input { width: 20px; height: 20px; margin: 1px 0 0; flex: none;
  accent-color: var(--brand-deep); }

/* --- Tables (wrap wide ones in .tabelle: scrolls inside, not the page) ---- */
.tabelle { overflow-x: auto; margin-top: 14px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; margin-top: 14px; }
.tabelle > table { margin-top: 0; }
th { text-align: left; font: 500 11px/1.3 var(--mono); letter-spacing: .1em;
  text-transform: uppercase; color: var(--mute); padding: 8px 12px;
  border-bottom: 1px solid var(--line); }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; }
.vermerk-ok { color: var(--fk-deep); font-weight: 600; }
.vermerk-aus, .vermerk { color: var(--mute); }

/* --- Secret and code boxes ------------------------------------------------- */
.durchschlag { background: var(--code-bg); color: var(--code-ink);
  border: 1px dashed color-mix(in srgb, var(--code-ink) 35%, transparent);
  border-radius: 10px; padding: 16px 18px; font: 400 14px/1.5 var(--mono);
  word-break: break-all; }
.durchschlag::before { content: attr(data-label); display: block; font-size: 10.5px;
  letter-spacing: .14em; margin-bottom: 8px;
  color: color-mix(in srgb, var(--code-ink) 72%, var(--code-bg)); }
pre.code { position: relative; margin: 10px 0 0; padding: 14px 64px 14px 16px;
  overflow-x: auto; background: var(--code-bg); color: var(--code-ink);
  border: 1px solid var(--code-bg); border-radius: 10px; font: 400 13px/1.55 var(--mono); }
pre.code + pre.code { margin-top: 12px; }
@media (prefers-color-scheme: dark) { pre.code { border-color: var(--line); } }
.f-page pre.code .kopieren { position: absolute; top: 6px; right: 6px; min-height: 44px;
  min-width: 44px; padding: 0 10px; background: transparent; color: var(--code-ink);
  border: 1px solid color-mix(in srgb, var(--code-ink) 35%, transparent);
  font: 500 11px/1 var(--mono); letter-spacing: .06em; }
.fehlertabelle td:first-child { width: 48px; color: var(--err); }
.fehlertabelle.codes td { font-size: 13px; }
.fehlertabelle td.code { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere;
  width: 34%; }
.tabellenkopf { font-size: 14px; margin: 18px 0 6px; }
.tabellenkopf span { font-weight: 400; color: var(--ink-2); }

/* --- Quota meter (Task 4 turns it into the brand-coloured bar; Task 7 reuses
   it for the free-allowance list of the Guthaben card) ---------------------- */
.meter { margin: 12px 0 4px; }
.meter .kopf { display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: baseline; gap: 2px 12px; font-size: 14px; margin-bottom: 6px; }
.meter .kopf .wert { font: 400 12px/1.4 var(--mono); color: var(--ink-2); }
/* the bar shows the USED share: empty while nothing is used */
.meter .bahn { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.meter .stand { height: 100%; background: var(--brand); border-radius: 99px; }
.meter.knapp .stand { background: var(--err); }

/* --- Guthaben (prepaid credit, Task 7) ------------------------------------- */
.card .meter-liste { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 14px; }
.meter-liste .meter { margin: 0; }
.betrag { font: 700 32px/1.2 var(--sans); letter-spacing: -0.01em; margin: 4px 0 0; }
.betrag small { display: block; font: 500 13px/1.4 var(--mono); color: var(--mute);
  margin-top: 2px; }
.hinweis.warn { color: var(--warn); background: var(--warn-bg); border-radius: 10px;
  padding: 10px 12px; }
.hinweis.ok { color: var(--fk-deep); }
.preise { margin-top: 20px; }
.preise td { font-size: 14px; }
.preise td:first-child { padding-left: 0; white-space: nowrap; }
.preise td.zahl { font-variant-numeric: normal; }
.preise small { display: block; margin-top: 2px; font: 400 12px/1.4 var(--mono);
  color: var(--ink-2); }
.preise td:last-child { padding-right: 0; }
/* buy buttons + invoices: one wrapping row with an even gap both ways;
   the forms dissolve so all buttons sit in the same flow */
.kaufleiste { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.kaufleiste form { display: contents; }

/* ledger: date · item · quantity · free · signed amount */
.buchungen td.b-tag { white-space: nowrap; color: var(--ink-2); }
.buchungen td.b-betrag, .buchungen td.b-menge { white-space: nowrap; }
.buchungen td.b-was { font-weight: 500; }

/* phones: every ledger row becomes a small block -
   "item ........ amount" / "date · quantity · of which free n" */
@media (max-width: 600px) {
  .buchungen thead { display: none; }
  .buchungen, .buchungen tbody { display: block; }
  .buchungen tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px;
    padding: 12px 0; border-bottom: 1px solid var(--line); }
  .buchungen tr:last-child { border-bottom: 0; }
  .buchungen td { display: block; padding: 0; border: 0; text-align: left; }
  .buchungen td.b-was { order: 1; flex: 1 1 0; min-width: 0; font-size: 15px; }
  .buchungen td.b-betrag { order: 2; font-size: 14px; font-weight: 600; color: var(--ink); }
  .buchungen tr::after { content: ""; order: 3; flex-basis: 100%; height: 0; }
  .buchungen td.b-tag, .buchungen td.b-menge, .buchungen td.b-frei {
    order: 4; font-size: 12px; color: var(--ink-2); }
  .buchungen td.b-menge::before, .buchungen td.b-frei::before { content: "· "; color: var(--mute); }
  .buchungen td.b-frei::after { content: " " attr(data-label); }
  .kaufleiste { display: grid; grid-template-columns: 1fr 1fr; }
  .kaufleiste button { width: 100%; padding: 0 10px; }
  .meter .kopf { flex-direction: column; }
}

@media (max-width: 640px) {
  .f-page > h1, .f-page .lesespalte > h1 { font-size: 30px; }
  .card { padding: 18px 16px; }
  .abschnitt .zusatz { margin-left: 0; flex-basis: 100%; }
  pre.code { padding: 58px 14px 14px; }
}

/* --- Dashboard ------------------------------------------------------------- */
.f-grow { flex: 1; min-width: 160px; }
.f-gap { margin-top: 14px; }
/* the first key of an account: the header logo's core turns once */
.f-lock svg .core { transform-box: fill-box; transform-origin: center; }
@keyframes f-core-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) {
  .is-first-key .f-lock svg .core { animation: f-core-spin .7s cubic-bezier(.2,1.4,.3,1) .3s 1 both; }
}

/* --- Sign-in, sign-up, password: one centred card -------------------------- */
.f-auth { display: grid; justify-items: center; align-content: center; gap: 14px;
  min-height: calc(100dvh - 260px); padding: 24px 0; }
.f-auth__card { width: 100%; max-width: 420px; margin: 0; }
.f-auth__card .untertitel { margin-bottom: 18px; }
.f-auth__card form p { margin: 0 0 12px; }
.f-auth__card .hinweis { line-height: 2.2; }
.f-page .f-field { width: 100%; }
.f-field-help { margin: -4px 0 12px; }
.f-notice { margin: 0 0 12px; }
.f-submit { margin-bottom: 4px; }
.f-auth__note { max-width: 420px; margin: 0; text-align: center; }

/* --- Quickstart ------------------------------------------------------------- */
.f-center { text-align: center; }

/* --- Legal texts: typography only (wording pinned by test_legal_wording) -- */
.anschrift { margin: 0; white-space: pre-line; }
.f-flush { margin-top: 0; }
.f-mt10 { margin: 10px 0 0; }
.kurz { background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 20px; margin: 0 0 20px; font-size: 15px; line-height: 1.6; max-width: 72ch; }
.kurz b { display: block; margin-bottom: 4px; }
.agb p { margin: 0 0 10px; font-size: 15px; line-height: 1.6; max-width: 72ch; }
.agb p:last-child { margin-bottom: 0; }
.agb ol { margin: 0; padding-left: 24px; font-size: 15px; line-height: 1.6; max-width: 72ch; }
.avv ol { margin: 0; padding-left: 24px; font-size: 15px; line-height: 1.6; max-width: 72ch; }
.agb ol li, .avv ol li { margin-bottom: 8px; }
.agb ol li::marker, .avv ol li::marker { font: 400 12px var(--mono); color: var(--ink-2); }
.avv ul { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.6; }
.avv table td:first-child { color: var(--ink-2); width: 34%; }

/* --- Protocol page ---------------------------------------------------------- */
.chip { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 14%, var(--surface)); color: var(--ink);
  font: 500 12px/1.5 var(--mono); }
#dialog, #dialog-translation { margin: 0; padding-left: 1.6em; max-width: 72ch; }
#dialog li, #dialog-translation li { margin: 0 0 10px; line-height: 1.6; }
.f-gone { display: grid; justify-items: start; }
.f-gone__mark { color: var(--ink); margin: 8px 0 20px; }
.f-gone .card { width: 100%; }

/* --- Error pages; 404: the slipped cube ------------------------------------- */
.f-error { display: grid; justify-items: start; gap: 14px; padding: 12px 0 24px; }
.f-error h1 { font: 800 40px/1.1 var(--sans); letter-spacing: -0.03em; margin: 0; }
.f-error .f-lead { max-width: 52ch; }
.nf-stage { display: grid; justify-items: start; gap: 6px; }
.f-page .nf-cube { display: block; min-height: 0; padding: 0; border: 0; border-radius: 14px;
  background: none; color: var(--ink); cursor: grab; touch-action: none; }
.nf-cube svg { display: block; width: min(240px, 60vw); height: auto; overflow: visible; }
.is-dragging .nf-cube { cursor: grabbing; }
.f-page .is-home .nf-cube { cursor: default; }
.nf-core { transform-box: view-box; transform-origin: 0 0;
  transition: transform .6s cubic-bezier(.2,1.4,.3,1); }
.is-dragging .nf-core { transition: none; }
/* the dashed socket only marks the gap - once the core is home it would show as a rim */
.nf-cube [stroke-dasharray] { transition: opacity .2s cubic-bezier(.2,.9,.2,1) .4s; }
.is-home .nf-cube [stroke-dasharray] { opacity: 0; }
.nf-hint { margin: 0; min-height: 1.5em; font: 500 12px/1.5 var(--mono); color: var(--mute); }
@media (max-width: 640px) { .f-error h1 { font-size: 30px; } }
