/* Shared styles for the SpeSys Számlamenedzser project site. */
:root {
  --bg: #f6f8fa; --surface: #ffffff; --fg: #17212b; --muted: #586673; --line: #d9e0e6;
  --accent: #0b5c7a; --accent-soft: #e2f0f5;
  --ok-fg: #17603a; --ok-bg: #dff3e6;
  --crit-fg: #9b1c1c; --crit-bg: #fde8e6;
  --warn-fg: #7a4a00; --warn-bg: #fdf0d3;
  --calm-fg: #3d4b57; --calm-bg: #e9eef2;
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10161c; --surface: #18212a; --fg: #e6edf2; --muted: #9aa9b5; --line: #2b3742;
    --accent: #6cc3e0; --accent-soft: #16323d;
    --ok-fg: #8fdcab; --ok-bg: #173a26;
    --crit-fg: #ffb4ab; --crit-bg: #4a1c1a; --warn-fg: #f3cf8a; --warn-bg: #44330f;
    --calm-fg: #c3ced7; --calm-bg: #26323c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: 15px; line-height: 1.55;
}
a { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .inner {
  max-width: 60rem; margin: 0 auto; padding: 0.75rem 16px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem;
}
.brand { font-family: var(--font-display); font-weight: 600; color: var(--fg); text-decoration: none; }
.brand small { font-family: var(--font-body); font-weight: 400; color: var(--muted); margin-left: 0.5rem; }
.menu { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.menu a {
  padding: 0.35rem 0.75rem; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 500;
}
.menu a:hover { color: var(--fg); }
.menu a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }

.page { max-width: 60rem; margin: 0 auto; padding: 2.5rem 16px 4rem; display: flex; flex-direction: column; gap: 2.5rem; }
header.intro { display: flex; flex-direction: column; gap: 0.75rem; }
.eyebrow { font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
h1 { font-family: var(--font-display); font-weight: 600; font-size: 2rem; line-height: 1.15; margin: 0; text-wrap: balance; }
h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; line-height: 1.2; margin: 0; }
h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; margin: 0; }
.lede { max-width: 65ch; color: var(--muted); margin: 0; }
.lede strong { color: var(--fg); font-weight: 600; }
section { display: flex; flex-direction: column; gap: 0.9rem; scroll-margin-top: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.note { color: var(--muted); font-size: 0.88rem; max-width: 70ch; margin: 0; }
footer { color: var(--muted); font-size: 0.85rem; max-width: 70ch; }

.chip { font-size: 0.75rem; font-weight: 600; padding: 0.15rem 0.55rem; border-radius: 999px; white-space: nowrap; }
.chip.ok { color: var(--ok-fg); background: var(--ok-bg); }
.chip.crit { color: var(--crit-fg); background: var(--crit-bg); }
.chip.warn { color: var(--warn-fg); background: var(--warn-bg); }
.chip.calm { color: var(--calm-fg); background: var(--calm-bg); }
.chip.now { color: var(--surface); background: var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: 0.85rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 0.4rem; }

/* Rows: identifier | text | chip. Used by questions and steps. */
.q { display: grid; grid-template-columns: 4.25rem minmax(0, 1fr) auto; gap: 0.25rem 1rem; padding: 0.9rem 1rem; align-items: start; }
.q + .q { border-top: 1px solid var(--line); }
.id { font-family: var(--font-mono); font-size: 0.82rem; color: var(--accent); padding-top: 0.15rem; }
.text { min-width: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.text p { margin: 0; }
.ask { font-weight: 500; }
.why { color: var(--muted); font-size: 0.9rem; }
.shared { font-size: 0.82rem; color: var(--accent); }
.answer { font-size: 0.9rem; color: var(--ok-fg); }
.q.closed .ask { color: var(--muted); font-weight: 400; }

@media (max-width: 34rem) {
  h1 { font-size: 1.6rem; }
  .q { grid-template-columns: minmax(0, 1fr) auto; }
  .id { grid-column: 1; grid-row: 1; }
  .q > .chip { grid-column: 2; grid-row: 1; }
  .text { grid-column: 1 / -1; }
}

/* Forms: login, password change, answers. */
.formpage { max-width: 26rem; }
.form { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.9rem; }
.form label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 500; font-size: 0.9rem; }
input, textarea {
  font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 0.55rem 0.7rem; width: 100%;
}
input:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 6px; padding: 0.55rem 1rem;
  background: var(--accent); color: var(--surface);
}
button:disabled { opacity: 0.6; cursor: default; }
button.quiet { background: none; color: var(--muted); font-weight: 500; padding: 0.35rem 0.5rem; }
button.quiet:hover { color: var(--fg); }
.error { color: var(--crit-fg); margin: 0; font-size: 0.9rem; }
.who-am-i { display: flex; align-items: center; gap: 0.25rem; color: var(--muted); font-size: 0.88rem; }
.who-am-i a { color: var(--muted); padding: 0.35rem 0.5rem; }

.answers { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.35rem; }
.answer-item { background: var(--accent-soft); border-radius: 6px; padding: 0.55rem 0.75rem; }
.answer-item .meta { font-size: 0.8rem; color: var(--muted); }
.answer-item .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.answer-form { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }
.answer-form textarea { min-height: 4.5rem; resize: vertical; }
details.reply summary { cursor: pointer; color: var(--accent); font-size: 0.88rem; font-weight: 500; width: fit-content; }
details.reply[open] summary { margin-bottom: 0.5rem; }
