/* A megtakarítás-követő demó stíluslapja. Az éles pfgd sötét, mobile-first
   színvilágát követi (F-07: önálló másolat); rendszer-betűkészlet, külső
   erőforrás nélkül (F-02). */
:root {
  --bg: #0f172a;
  --card: #1e293b;
  --card-2: #334155;
  --line: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --faint: #64748b;
  --accent: #38bdf8;
  --accent-ink: #0f172a;
  --ok-bg: #16532b; --ok: #4ade80;
  --info-bg: #173a53; --info: #7dd3fc;
  --bad-bg: #531616; --bad: #f87171;
  --warn: #facc15;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--accent); }
main { max-width: 1080px; margin: 0 auto; padding: 16px calc(var(--gutter) + env(safe-area-inset-right)) 24px calc(var(--gutter) + env(safe-area-inset-left)); }

.demo-banner {
  position: sticky; top: 0; z-index: 50;
  background: #b42318; color: #fff;
  font-size: 0.8rem; font-weight: 700; text-align: center;
  padding: 6px var(--gutter);
  padding-top: calc(6px + env(safe-area-inset-top));
}

.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  max-width: 1080px; margin: 0 auto;
  padding: 10px calc(var(--gutter) + env(safe-area-inset-right)) 10px calc(var(--gutter) + env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
}
.brand { color: var(--text); font-weight: 700; text-decoration: none; letter-spacing: .01em; }
.topnav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.topnav > a { color: var(--muted); text-decoration: none; font-size: 0.88rem; padding: 6px 8px; border-radius: 6px; }
.topnav > a.active, .topnav > a:hover { color: var(--text); background: var(--card); }

.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.lang-switch a { padding: 5px 10px; color: var(--muted); text-decoration: none; font-size: 0.75rem; font-weight: 700; letter-spacing: .05em; }
.lang-switch a.active { background: var(--text); color: var(--bg); }

.inline-form { display: inline; margin: 0; }
.ghost-btn, .primary-btn, .link-btn { font: inherit; cursor: pointer; }
.ghost-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text); border: 1px solid #475569; border-radius: 8px;
  padding: 6px 12px; font-size: 0.85rem; text-decoration: none;
}
.ghost-btn:hover { border-color: var(--accent); }
.logout-btn { border-color: #7f1d1d; color: #fca5a5; }
.primary-btn {
  display: inline-block; background: var(--accent); color: var(--accent-ink); border: none; border-radius: 8px;
  padding: 10px 18px; font-weight: 700; text-decoration: none; font-size: 0.95rem;
}
.link-btn { background: none; border: none; color: var(--faint); padding: 2px 4px; font-size: 0.8rem; text-decoration: underline; }
.link-btn:hover { color: var(--bad); }

.info-btn {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid #475569; background: var(--card); color: var(--muted);
  font: italic 700 0.85rem Georgia, serif; cursor: pointer;
}
.info-btn:hover { color: var(--accent); border-color: var(--accent); }

h1 { font-size: 1.3rem; margin: 0; }
h2 { font-size: 1rem; margin: 0; }
h2 small { color: var(--muted); font-weight: 400; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 14px; }
.back-link { flex: 1 1 100%; color: var(--muted); text-decoration: none; font-size: 0.85rem; }
.lead { color: var(--muted); margin: -6px 0 14px; }
.hint { color: var(--muted); font-size: 0.82rem; margin: 8px 0 0; }
.warn-text { color: var(--warn); }

.card { background: var(--card); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }

.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
@media (min-width: 760px) { .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--card); border-radius: 12px; padding: 12px; min-width: 0; }
.kpi .label { font-size: 0.75rem; color: var(--muted); }
.kpi .value { font-size: 1.25rem; font-weight: 650; overflow-wrap: anywhere; }
.kpi .value small { color: var(--muted); font-weight: 400; font-size: 0.8rem; }
.kpi .sub { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

.status { display: inline-block; font-size: 0.75rem; padding: 2px 9px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.status.ok { background: var(--ok-bg); color: var(--ok); }
.status.info { background: var(--info-bg); color: var(--info); }
.status.bad { background: var(--bad-bg); color: var(--bad); }

.progress { background: var(--bg); border-radius: 6px; height: 8px; margin: 8px 0; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 6px; }

.portfolio-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 760px) { .portfolio-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.portfolio-card { display: block; color: inherit; text-decoration: none; margin: 0; border: 1px solid transparent; }
.portfolio-card:hover { border-color: #475569; }
.card-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; font-size: 0.85rem; }
.card-rows div { display: flex; justify-content: space-between; gap: 8px; }
.card-rows span { color: var(--muted); }
.card-foot { margin-top: 10px; font-size: 0.78rem; color: var(--faint); }

.operations { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.operations-label { flex: 1 1 100%; margin: 0; color: var(--faint); font-size: 0.72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 14px; }
@media (min-width: 860px) { .two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

form label { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 10px; }
input[type="text"], input[type="password"], input[type="date"], select {
  display: block; width: 100%; margin-top: 4px; padding: 9px 10px;
  background: var(--bg); color: var(--text); border: 1px solid #475569; border-radius: 8px; font: inherit; font-size: 16px;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
@media (min-width: 520px) { .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kind-picker { border: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.kind-picker legend { font-size: 0.82rem; color: var(--muted); margin-bottom: 4px; padding: 0; }
.kind-picker label { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 7px 12px; border: 1px solid #475569; border-radius: 999px; color: var(--text); cursor: pointer; }
.kind-picker input { accent-color: var(--accent); margin: 0; }
.form-error { background: var(--bad-bg); color: #fecaca; border-radius: 8px; padding: 8px 12px; font-size: 0.88rem; }
.narrow { max-width: 620px; }

.login-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 860px) { .login-wrap { grid-template-columns: 3fr 2fr; } }
.intro { background: #13213a; border: 1px solid #1e3a5f; border-radius: 12px; padding: 16px 18px; }
.intro h1 { margin-bottom: 8px; }
.intro p { color: var(--muted); }
.intro-points { padding-left: 1.2rem; margin: 0; font-size: 0.92rem; }
.intro-points li { margin-bottom: 6px; }
.demo-creds { background: var(--bg); border: 1px dashed #475569; border-radius: 8px; padding: 8px 12px; font-size: 0.88rem; }
.demo-creds code { color: var(--accent); font-size: 0.95rem; }
.login-card .primary-btn { width: 100%; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th, .data-table td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table th { color: var(--muted); font-weight: 600; font-size: 0.75rem; }
.data-table .num { text-align: right; white-space: nowrap; }
.data-table tfoot th { color: var(--text); font-size: 0.85rem; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.journal { min-width: 720px; }
.journal tr.is-new td { background: rgba(56, 189, 248, 0.07); }
.pos { color: var(--ok); }
.neg { color: var(--bad); }
.kind { font-weight: 600; }
.kind.withdrawal { color: #fca5a5; }
.kind.valuation { color: var(--info); }
.tag { font-size: 0.7rem; background: var(--card-2); border-radius: 4px; padding: 1px 5px; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Diagram (templates/_chart.html) */
.chart { margin: 0; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .target-line { stroke: var(--warn); stroke-width: 1.5; stroke-dasharray: 2 4; }
.chart .target-label { fill: var(--warn); font-size: 11px; font-weight: 600; }
.chart .today-line { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 1 3; }
.chart .plan-line { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 6 5; }
.chart .actual-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.chart .marker { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.chart .marker.last { fill: var(--text); pointer-events: none; }
.chart figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 0.8rem; color: var(--muted); margin-top: 8px; }
.legend { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--accent); }
.swatch.plan { border-top: 2px dashed var(--muted); }
.swatch.target { border-top: 2px dotted var(--warn); }

/* Összegek elrejtése */
body.hide-money .money { filter: blur(7px); }

.prose { max-width: 780px; }
.prose .lead { margin: 8px 0 16px; }
.prose-card { background: var(--card); border-radius: 12px; padding: 14px 18px; margin-bottom: 12px; }
.prose-card h2 { margin-bottom: 6px; }
.prose-card p, .prose-card li { color: #cbd5e1; font-size: 0.92rem; }
.prose-card ul { padding-left: 1.2rem; }

.footer { max-width: 1080px; margin: 0 auto; padding: 8px var(--gutter) 24px; color: var(--faint); font-size: 0.78rem; }

.dialog-backdrop { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(2, 6, 23, 0.7); }
.dialog-backdrop[hidden] { display: none; }
.dialog { width: min(500px, 100%); padding: 22px 24px; border-radius: 12px; background: var(--card); border: 1px solid #475569; box-shadow: 0 24px 64px rgba(0,0,0,0.45); }
.dialog .eyebrow { margin: 0 0 6px; color: #fca5a5; font-size: 0.72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.dialog h2 { margin: 0 0 8px; font-size: 1.15rem; }
.dialog p:not(.eyebrow) { color: #cbd5e1; margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.dialog-actions button { background: var(--accent); color: var(--accent-ink); border: none; padding: 8px 18px; border-radius: 6px; cursor: pointer; font: inherit; font-weight: 700; }

@media (max-width: 520px) {
  .kpi .value { font-size: 1.05rem; }
  .card-rows { grid-template-columns: minmax(0, 1fr); }
  .topnav { width: 100%; }
}
