/* OMNIA client dashboard - "private banking statement on dark".
   Ledger rows, hairline separators, big tabular numerals. No card grids. */

:root {
  --ink-0: #0b0d11;   /* page bg */
  --ink-1: #12161d;   /* surface */
  --ink-2: #1a202b;   /* raised */
  --line:  #232b38;   /* hairlines */
  --paper: #e8ecf4;   /* text */
  --muted: #8a94a6;
  --value: #14dfc4;   /* teal: data / value / links / focus */
  --signal: #f4211a;  /* red: brand dot + error states ONLY */
  --pend:  #e8b64a;   /* amber: pending */
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--ink-0);
  color: var(--paper);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--value); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--value); outline-offset: 2px; border-radius: 2px; }

/* ---------- header ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background: var(--ink-1);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: .55rem;
  color: var(--paper);
  font-weight: 700;
  letter-spacing: .18em;
  font-size: 15px;
}
.brand:hover { text-decoration: none; }

.brand-sub {
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--muted);
}

/* brand mark: teal circle outline with red dot core */
.brand-mark {
  position: relative;
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--value);
  border-radius: 50%;
  align-self: center;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--signal);
}
.brand-mark.big { width: 22px; height: 22px; border-width: 2px; }
.brand-mark.big::after { width: 8px; height: 8px; }

.top nav {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  font-size: 13.5px;
}
.top nav a { color: var(--muted); padding: .25rem 0; transition: color .15s ease; }
.top nav a:hover { color: var(--paper); text-decoration: none; }
.top nav a.on {
  color: var(--paper);
  box-shadow: 0 2px 0 0 var(--value);
}
.top nav a.quiet { opacity: .7; }

/* ---------- layout ---------- */

main.page {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 2.5rem);
  flex: 1;
}

main.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-card {
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
}
.auth-card.wide { max-width: 560px; }
.auth-brand { text-align: center; margin-bottom: 1.5rem; }
.auth-brand h1 { margin: .6rem 0 .2rem; letter-spacing: .2em; font-size: 1.4rem; }
.auth-h { margin: 0 0 .5rem; font-size: 1.3rem; }

.page-h {
  margin: 0 0 .35rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 650;
  letter-spacing: -.01em;
}

.lead { color: var(--muted); margin: .25rem 0 1.75rem; max-width: 62ch; }

section { margin-block: 2.25rem; }

/* eyebrow labels */
.fig-label, .sec-h, dt {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.sec-h { font-size: 12px; margin: 0 0 .75rem; border-bottom: 1px solid var(--line); padding-bottom: .5rem; }

/* ---------- figures ---------- */

.figures {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem 4rem;
  align-items: flex-end;
  margin-block: 2rem;
}
.figure { display: flex; flex-direction: column; gap: .2rem; }
.fig-num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 2rem;
  line-height: 1.05;
  color: var(--paper);
}
.figure.prime .fig-num {
  font-size: clamp(3rem, 8vw, 4.5rem);
  color: var(--value);
}
.fig-unit { color: var(--muted); font-size: 13px; }

/* ---------- pool strip ---------- */

.pool-strip { margin-block: 2.5rem; }
.pool-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .5rem; }
.pool-pct {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--value);
  font-size: 1.05rem;
}
.pool-bar {
  height: 6px;
  background: var(--ink-2);
  border-radius: 3px;
  overflow: hidden;
}
.pool-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #0d9e8b, var(--value));
  box-shadow: 0 0 12px rgba(20, 223, 196, .4);
}
.pool-sub { color: var(--muted); font-size: 12.5px; margin-top: .45rem; }

/* ---------- ledger rows ---------- */

.ledger .row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: .75rem;
  align-items: baseline;
  padding-block: .9rem;
  border-bottom: 1px solid var(--line);
}

.row-name { font-weight: 550; }
.row-data {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: .95em;
}
.quiet { color: var(--muted); }
.ledger.pending .row { opacity: .78; }

.note { color: var(--muted); font-size: 13.5px; margin-top: .8rem; max-width: 70ch; }

/* ---------- badges & chips ---------- */

.badge, .chip {
  display: inline-block;
  font-size: 10px;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: .15rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  vertical-align: middle;
  margin-inline: .2rem;
  white-space: nowrap;
}
.badge.demo, .chip.demo { border-color: var(--value); color: var(--value); }
.badge.pend, .chip.pend { border-color: var(--pend); color: var(--pend); }
.chip.paid { border-color: rgba(20, 223, 196, .5); color: var(--value); background: rgba(20, 223, 196, .07); }
.chip.void { border-color: var(--line); color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(138, 148, 166, .6); }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; }

.ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
.ledger-table th {
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  padding: .6rem;
  border-bottom: 1px solid var(--line);
}
.ledger-table td {
  padding: .6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.ledger-table .num { text-align: right; }
.ledger-table tbody tr { transition: background .15s ease; }
.ledger-table tbody tr:hover { background: var(--ink-1); }
.ledger-table.dense { font-size: 13px; }
.ledger-table.dense td { padding: .45rem .6rem; }
.item-line { padding-block: .05rem; }

/* projection table: path labels + secondary bear rows */
.ledger-table tr.path-label td {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  color: var(--value);
  padding-top: 1.1rem;
  border-bottom: 1px dashed var(--line);
}
.ledger-table tr.path-label.bear td { color: var(--muted); }
.ledger-table tbody tr.bear td { color: var(--muted); border-bottom-style: dashed; }

/* ---------- chart ---------- */

.chart-sec { margin-block: 2.5rem; }
#chart { width: 100%; }
#chart svg { display: block; width: 100%; height: auto; }

/* ---------- forms ---------- */

label {
  display: block;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin: 1rem 0 .35rem;
}

input, select {
  width: 100%;
  background: var(--ink-2);
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .65rem .8rem;
  font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--value);
  box-shadow: 0 0 0 3px rgba(20, 223, 196, .18);
}

button {
  margin-top: 1.25rem;
  background: var(--value);
  color: var(--ink-0);
  border: 0;
  border-radius: 6px;
  padding: .7rem 1.4rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s ease, transform .1s ease;
}
button:hover { filter: brightness(1.1); }
button:active { transform: translateY(1px); }
button:focus-visible { outline: 2px solid var(--value); outline-offset: 2px; }
button.small { margin: 0; padding: .35rem .8rem; font-size: 12px; }

.auth-card form button { width: 100%; }

.inline-form { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.inline-form label { margin: 0 0 .35rem; flex-basis: 100%; }
.inline-form select { width: auto; min-width: 10rem; text-transform: uppercase; }
.inline-form button { margin-top: 0; }

.panel {
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem;
}

.err {
  background: rgba(244, 33, 26, .08);
  border: 1px solid rgba(244, 33, 26, .45);
  color: #ff9d99;
  border-radius: 6px;
  padding: .7rem .9rem;
  font-size: 14px;
}

.ok {
  background: rgba(20, 223, 196, .07);
  border: 1px solid rgba(20, 223, 196, .4);
  color: var(--value);
  border-radius: 6px;
  padding: .7rem .9rem;
  font-size: 14px;
}

.banner.warn {
  border: 1px solid var(--pend);
  border-left-width: 3px;
  background: rgba(232, 182, 74, .07);
  color: var(--pend);
  border-radius: 6px;
  padding: .8rem 1rem;
  font-size: 14px;
  margin-block: 1.25rem;
}

.aux { font-size: 13.5px; text-align: center; margin-top: 1rem; }

.lang-row {
  display: flex;
  justify-content: center;
  gap: .9rem;
  margin-top: 1.5rem;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.lang-row a { color: var(--muted); }
.lang-row a.on { color: var(--value); }

/* ---------- legal / empty / cta ---------- */

.legal-box {
  border: 1px solid var(--line);
  border-left: 3px solid var(--pend);
  border-radius: 6px;
  padding: 1.25rem;
  color: var(--muted);
  font-size: 13.5px;
  margin-block: 2.5rem;
}
.legal-box strong { color: var(--paper); display: block; margin-bottom: .4rem; }
.legal-box p { margin: 0; }

.empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  padding: 3rem;
  text-align: center;
  margin-block: 2rem;
}

.cta-row { margin-top: 2rem; }
.cta { font-weight: 600; }

/* ---------- admin ---------- */

.sync-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ink-1);
  padding: 1.25rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.kv { display: flex; gap: 2.5rem; flex-wrap: wrap; margin: 0; }
.kv div { display: flex; flex-direction: column; gap: .25rem; }
.kv dd { margin: 0; font-size: 13px; word-break: break-all; max-width: 30ch; }
.sync-box button { margin-top: 0; }

.link-sec p { margin: .25rem 0; }

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .rise {
    animation: rise .5s ease-out both;
  }
  .rise:nth-child(2) { animation-delay: .05s; }
  .rise:nth-child(3) { animation-delay: .1s; }
  .rise:nth-child(4) { animation-delay: .15s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .top { flex-wrap: wrap; }
  .top nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: .25rem;
    -webkit-overflow-scrolling: touch;
  }
  .figures { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
  .ledger .row { grid-template-columns: 1fr 1fr; }
  .ledger .row .row-name { grid-column: 1 / -1; }
  .auth-card { padding: 1.75rem; }
}

/* ---------- disclaimer gate: readable legal text + a real checkbox row ---------- */

.legal {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  border-left: 3px solid var(--pend);
  padding: 0 0 0 1rem;
  margin: 0 0 1.75rem;
  text-wrap: pretty;
}

.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .75rem;
  align-items: start;
  margin: 0 0 1.5rem;
  cursor: pointer;
  color: var(--paper);
  font-size: 14.5px;
  line-height: 1.5;
}
.check input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin: .1rem 0 0;
  accent-color: var(--value);
  cursor: pointer;
  flex: none;
}
.check span { text-wrap: pretty; }
.check:hover span { color: #fff; }
.check:focus-within {
  outline: 2px solid var(--value);
  outline-offset: 6px;
  border-radius: 4px;
}

/* ---------- "how this works": a real, ordered sequence ---------- */

.how { margin-block: 3rem; }
.how-lead {
  color: var(--muted);
  max-width: 62ch;
  margin: .25rem 0 1.25rem;
  text-wrap: pretty;
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: 0;
}
.step {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: 1rem;
  padding-block: 1.4rem;
  border-top: 1px solid var(--line);
}
.step:first-child { border-top: 0; padding-top: .4rem; }
.step:last-child { border-bottom: 1px solid var(--line); }
.step::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--value);
  letter-spacing: .08em;
  padding-top: .3rem;
}
.step h3 {
  margin: 0 0 .35rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--paper);
}
.step p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 68ch;
  text-wrap: pretty;
}
.how-note {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 13.5px;
  border-left: 3px solid var(--pend);
  padding-left: 1rem;
  max-width: 68ch;
}

/* ---------- expandable package rows (the hover now leads somewhere) ---------- */

.row-x { border-bottom: 1px solid var(--line); }
.row-x[open] { background: transparent; }
.row-x > summary {
  list-style: none;
  cursor: default;
}
.row-x > summary::-webkit-details-marker { display: none; }
.row-x > summary:hover .row-name { color: #fff; }
.row-x > summary:focus-visible { outline: 2px solid var(--value); outline-offset: -2px; }
.row-x > summary .row { border-bottom: 0; }
.row-caret { display: flex; justify-content: flex-end; }
.row-detail {
  padding: .25rem 0 1.4rem 1rem;
  border-left: 2px solid var(--line);
  margin-left: .25rem;
  display: grid;
  gap: .6rem;
}
.row-detail p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 70ch;
  text-wrap: pretty;
}

/* stat-tile hints */
.fig-hint {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  margin-top: .5rem;
  max-width: 26ch;
}

@media (max-width: 720px) {
  .step { grid-template-columns: 2rem 1fr; gap: .75rem; }
  .row-x > summary .row { grid-template-columns: 1fr 1fr; }
  .row-caret { display: none; }
}

/* ---------- inline "i" explainer (no JS, keyboard reachable) ---------- */

.info {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  margin-left: .45rem;
  transform: translateY(-1px);
}
.info > button {
  all: unset;
  cursor: help;
  width: 15px;
  height: 15px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  /* explicit type: the eyebrow labels above are uppercase + tracked mono,
     which would turn this glyph into a serif capital I */
  font: 600 10px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  display: grid;
  place-items: center;
  padding-right: .5px;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.info > button:hover { background: rgba(20, 223, 196, .1); }
.info > button:hover,
.info > button:focus-visible { color: var(--value); border-color: var(--value); }
.info > button:focus-visible { outline: 2px solid var(--value); outline-offset: 2px; }

.info [role="tooltip"] {
  position: absolute;
  bottom: calc(100% + .6rem);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: 19rem;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .55);
  padding: .7rem .85rem;
  color: var(--paper);
  font: 400 13px/1.5 system-ui, sans-serif;
  letter-spacing: normal;
  text-transform: none;
  white-space: normal;
  text-wrap: pretty;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 20;
}
.info > button:hover + [role="tooltip"],
.info > button:focus-visible + [role="tooltip"] {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
/* a szelen ne csusszon ki a kepernyorol */
.figure:first-child .info [role="tooltip"],
th:first-child .info [role="tooltip"] { left: 0; transform: translateX(0) translateY(4px); }
.figure:first-child .info > button:hover + [role="tooltip"],
.figure:first-child .info > button:focus-visible + [role="tooltip"],
th:first-child .info > button:hover + [role="tooltip"],
th:first-child .info > button:focus-visible + [role="tooltip"] { transform: translateX(0) translateY(0); }

@media (max-width: 720px) {
  .info [role="tooltip"] { max-width: 15rem; }
}

/* package-row explainer carries three sentences, so it needs more room */
.row-caret .info [role="tooltip"] {
  max-width: 24rem;
  left: auto;
  right: 0;
  transform: translateX(0) translateY(4px);
}
.row-caret .info > button:hover + [role="tooltip"],
.row-caret .info > button:focus-visible + [role="tooltip"] { transform: translateX(0) translateY(0); }
