/* ============================================================
   Felvizz! — design tokenek + komponensek
   Kánon: "E2 · Kék kaland · Bricolage Grotesque" (VÉGLEGES)
   Referencia: docs/design/reference/E2-kek-kaland-brand-sheet.html
   Token-dokumentáció: docs/design/DESIGN-SYSTEM.md (#14)
   ============================================================ */

/* ---------- Betűk (self-host, GDPR-tiszta) ---------- */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/bricolage-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201A, U+201C-201E, U+2026;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/bricolage-latin-ext-600.woff2") format("woff2");
  unicode-range: U+0100-024F, U+0150-0151, U+0170-0171;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/bricolage-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201A, U+201C-201E, U+2026;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/bricolage-latin-ext-700.woff2") format("woff2");
  unicode-range: U+0100-024F, U+0150-0151, U+0170-0171;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal; font-weight: 800; font-display: swap;
  src: url("/static/fonts/bricolage-latin-800.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201A, U+201C-201E, U+2026;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal; font-weight: 800; font-display: swap;
  src: url("/static/fonts/bricolage-latin-ext-800.woff2") format("woff2");
  unicode-range: U+0100-024F, U+0150-0151, U+0170-0171;
}
@font-face {
  font-family: "Figtree";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/figtree-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201A, U+201C-201E, U+2026;
}
@font-face {
  font-family: "Figtree";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/figtree-latin-ext-400.woff2") format("woff2");
  unicode-range: U+0100-024F, U+0150-0151, U+0170-0171;
}
@font-face {
  font-family: "Figtree";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/figtree-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201A, U+201C-201E, U+2026;
}
@font-face {
  font-family: "Figtree";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/figtree-latin-ext-600.woff2") format("woff2");
  unicode-range: U+0100-024F, U+0150-0151, U+0170-0171;
}
@font-face {
  font-family: "Figtree";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/figtree-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201A, U+201C-201E, U+2026;
}
@font-face {
  font-family: "Figtree";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/figtree-latin-ext-700.woff2") format("woff2");
  unicode-range: U+0100-024F, U+0150-0151, U+0170-0171;
}

/* ---------- Tokenek (E2 kánon) ---------- */
:root {
  /* Szín — krém alap, navy tinta, KÉK elsődleges, narancs akcentus-jel */
  --c-bg: #faf9f4;
  --c-surface: #ffffff;
  --c-paper: #efeee4;
  --c-ink: #1c3550;
  --c-ink-deep: #142840;
  --c-muted: #5c6f84;
  --c-primary: #2767c4;       /* link, gomb, hangsúly — AA a krémen (5.2:1) */
  --c-primary-deep: #1d4f99;  /* hover */
  --c-primary-tint: #edf0f4;
  --c-accent: #ff7a33;        /* CSAK jel/dekor — szövegnek NEM (2.3:1) */
  --c-accent-soft: #ffd08a;
  --c-line: #dfddce;
  --c-error-bg: #fdece4;
  --c-error-ink: #a23315;
  --c-error-line: #f0c0a6;

  /* Tipográfia */
  --font-display: "Bricolage Grotesque", system-ui, -apple-system, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text-sm: 0.9rem;
  --text-base: 1.0625rem;
  --text-lg: 1.1875rem;
  --text-xl: 1.5rem;
  --text-h1: clamp(2.3rem, 7vw, 3.5rem);

  /* Térköz (4px rács) */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;

  /* Forma */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Mélység */
  --shadow-1: 0 1px 2px rgba(20, 40, 64, 0.06);
  --shadow-2: 0 12px 32px rgba(20, 40, 64, 0.1);

  /* Mozgás */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast: 160ms;
  --dur-slow: 480ms;

  /* A jel ("!") döntése — az E2 lap szerint */
  --mark-skew: -13deg;
}

/* ---------- Alapok ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--c-ink);
}

a { color: var(--c-primary); text-underline-offset: 3px; }
a:hover { color: var(--c-primary-deep); }

:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

/* ---------- Oldalváz ---------- */
.page {
  max-width: 40rem;
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-4) var(--sp-8);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) 0 var(--sp-6);
}

/* Fiók-navigáció a fejléc jobb szélén (#22). Mobil-első: a hosszú e-mail csonkolódik,
   nem tördeli szét a fejlécet. Az akciók KÉK linkek (E2: narancs csak dekor). */
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--text-sm);
  min-width: 0;
}
.nav-link {
  color: var(--c-primary);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover { color: var(--c-primary-deep); text-decoration: underline; }
.nav-email {
  color: var(--c-muted);
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* A kijelentkezés CSRF-védett POST, de a fejlécben szöveg-linknek látszik (nem nagy gomb) —
   ezért a globális gomb-stílusokat itt felülírjuk. */
.logout-form { margin: 0; display: inline; }
.nav-button {
  display: inline;
  width: auto;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  font-size: var(--text-sm);
  cursor: pointer;
}
.nav-button:hover { background: none; }

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
  color: var(--c-ink);
  text-decoration: none;
}
.brand .mark {
  color: var(--c-accent);
  font-family: var(--font-body);   /* a "!" szándékosan MÁS típus (E2 jel-recept) */
  font-weight: 700;
  display: inline-block;
  transform: skewX(var(--mark-skew)) translateX(0.05em);
}
.brand:hover { color: var(--c-ink); }

/* belépő animáció — egyszer, visszafogottan */
.rise { animation: rise var(--dur-slow) var(--ease) both; }
.rise-2 { animation-delay: 90ms; }
.rise-3 { animation-delay: 180ms; }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Hero ---------- */
.kicker {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-primary);
  margin: 0 0 var(--sp-3);
}

h1.headline {
  font-size: var(--text-h1);
  margin: 0 0 var(--sp-4);
}
h1 .mark { color: var(--c-accent); }

.subline {
  font-size: var(--text-lg);
  color: var(--c-ink);
  opacity: 0.85;
  margin: 0 0 var(--sp-3);
  max-width: 34rem;
}

.price-line {
  font-size: var(--text-sm);
  color: var(--c-muted);
  margin: 0 0 var(--sp-6);
}

/* ---------- Lépések (számozott, szerkesztői) ---------- */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0 0 var(--sp-7);
  padding: var(--sp-5) 0 0;
  border-top: 1px solid var(--c-line);
}
.steps li {
  counter-increment: step;
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  color: var(--c-muted);
}
.steps li::before {
  content: counter(step);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-xl);
  color: var(--c-primary);
  min-width: 1.6rem;
}
.steps strong { color: var(--c-ink); font-weight: 600; }

/* ---------- Űrlap-felület ---------- */
.upload {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: var(--sp-6) var(--sp-5);
  margin-bottom: var(--sp-6);
}
.upload h2 {
  font-size: var(--text-xl);
  margin: 0 0 var(--sp-4);
}

form { display: flex; flex-direction: column; gap: var(--sp-4); }

label {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--c-ink);
}

select,
input[type="text"],
input[type="email"],
input[type="file"] {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--c-ink);
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  transition: border-color var(--dur-fast) var(--ease);
}
select:hover, input:hover { border-color: var(--c-muted); }
select:focus, input:focus { border-color: var(--c-primary); outline: none; }
select:focus-visible, input:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
}

small { color: var(--c-muted); font-weight: 400; }

button,
.button-link {
  display: block;
  width: 100%;
  margin-top: var(--sp-2);
  padding: var(--sp-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  color: #ffffff;
  background: var(--c-primary);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: background var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
button:hover, .button-link:hover { background: var(--c-primary-deep); color: #ffffff; }
button:active, .button-link:active { transform: translateY(1px); }
button:disabled { background: var(--c-muted); cursor: not-allowed; }

/* ---------- OAuth: „vagy" elválasztó + provider-gombok (U3) ---------- */
/* A magic-link űrlap az elsődleges (kék, tömör); a provider-gombok ezért
   MÁSODLAGOS stílust kapnak (krém/körvonal), hogy ne versengjenek vele. */
.or-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-4) 0 var(--sp-2);
  color: var(--c-muted);
  font-size: var(--text-sm);
}
.or-divider::before,
.or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--c-line);
}
.provider-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.button-link.provider-button {
  color: var(--c-ink);
  background: var(--c-surface);
  border: 1.5px solid var(--c-line);
  box-shadow: none;
}
.button-link.provider-button:hover {
  color: var(--c-ink);
  background: var(--c-primary-tint);
  border-color: var(--c-primary);
}

/* ---------- Fiók: előzmény-lista, felajánlás, törlés (U5) ---------- */
.notice {
  margin: var(--sp-3) 0;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 600;
}
.notice-ok { color: #14532d; background: #e4f3e8; }
.notice-err { color: #7a1d1d; background: #fbe6e3; }

.upload-list { list-style: none; padding: 0; margin: var(--sp-3) 0; }
.upload-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--c-line);
}
.upload-item:last-child { border-bottom: none; }
.ui-subject { font-weight: 700; }
.ui-date { color: var(--c-muted); font-size: var(--text-sm); }
.ui-badge {
  margin-left: auto;
  font-size: var(--text-sm);
  font-weight: 700;
  white-space: nowrap;
}
.ui-ready { color: var(--c-primary); text-decoration: none; }
.ui-ready:hover { color: var(--c-primary-deep); }
.ui-pending { color: var(--c-muted); font-weight: 600; }
.muted-list .upload-item { color: var(--c-muted); }

.checkbox-label {
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
  margin: var(--sp-4) 0;
  font-weight: 400;
}
.checkbox-label input { width: auto; margin-top: 0.2em; }
.button-danger { background: #b3261e; }
.button-danger:hover { background: #8f1b15; }

.fineprint {
  margin-top: var(--sp-4);
  color: var(--c-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* ---------- Dashboard: össz-stat, sparkline, téma-sávok (U8) ---------- */
.big-stat {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--c-ink);
  line-height: 1.1;
  margin: var(--sp-2) 0;
}
.big-stat-sub {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--c-muted);
}
.sparkline {
  display: block;
  width: 100%;
  height: 70px;
  margin-top: var(--sp-3);
  overflow: visible;
}

.tema-row { padding: var(--sp-3) 0; border-bottom: 1px solid var(--c-line); }
.tema-row:last-child { border-bottom: none; }
.tema-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.tema-nev { font-weight: 700; }
.tema-pct { margin-left: auto; font-weight: 700; }
.tema-trend {
  font-size: var(--text-sm);
  font-weight: 700;
  padding: 0.1em 0.6em;
  border-radius: var(--radius-pill);
}
.tema-trend-javul { color: #14532d; background: #e4f3e8; }
.tema-trend-romlik { color: #7a1d1d; background: #fbe6e3; }
.tema-trend-stagnal { color: var(--c-muted); background: var(--c-primary-tint); }
.tema-trend-uj { color: var(--c-primary-deep); background: var(--c-primary-tint); }

.tema-bar {
  margin-top: var(--sp-2);
  height: 10px;
  background: var(--c-primary-tint);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.tema-bar-fill {
  display: block;
  height: 100%;
  background: var(--c-primary);
  border-radius: var(--radius-pill);
}
.tema-bar-low { background: var(--c-accent, #ff7a33); }
.tema-nehez .tema-nev { color: var(--c-ink-deep); }

.gyakorlo-form { margin-top: var(--sp-2); }
.button-small {
  display: inline-block;
  width: auto;
  margin-top: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-sm);
  box-shadow: none;
}
.summary-mini {
  margin-top: var(--sp-2);
  color: #14532d;
  font-weight: 600;
  font-size: var(--text-sm);
}

/* ---------- Bizalmi blokk ---------- */
.trust {
  border-top: 1px solid var(--c-line);
  padding-top: var(--sp-5);
  color: var(--c-muted);
  font-size: var(--text-sm);
  line-height: 1.65;
}
.trust strong { color: var(--c-ink); }

.hint { color: var(--c-muted); font-size: var(--text-sm); line-height: 1.6; }

/* ---------- Állapot-elemek ---------- */
.error {
  background: var(--c-error-bg);
  border: 1px solid var(--c-error-line);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
  color: var(--c-error-ink);
}
.error p { margin: 0; }
.error ul { margin: var(--sp-2) 0 0; padding-left: var(--sp-5); }

.summary {
  border: 1px solid var(--c-line);
  border-left: 4px solid var(--c-primary);
  border-radius: var(--radius-md);
  background: var(--c-surface);
  padding: var(--sp-4) var(--sp-5);
  margin: var(--sp-5) 0;
}
.summary p { margin: var(--sp-1) 0; }

.warn { color: var(--c-error-ink); }

.report-link {
  background: var(--c-primary-tint);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5);
  margin: var(--sp-5) 0;
  word-break: break-all;
}
.report-link p { margin: var(--sp-1) 0; }

/* ---------- Lábjegyzet ---------- */
.footnote {
  margin-top: var(--sp-6);
  font-size: var(--text-sm);
  color: var(--c-muted);
}
