/* =============================================================
   Egészségbiztosítási Demó – Fő stíluslap
   tunde.9g.hu | mobile-first, majd desktop
   ============================================================= */

/* --- Google Fonts betöltése --- */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600;700&display=swap');

/* =============================================================
   1. CSS VÁLTOZÓK (design tokens)
   ============================================================= */
:root {
  /* Alap színek */
  --bg:           #F7F5EF;
  --page:         #FFFEFA;
  --text:         #223047;
  --text-muted:   #5a6a7e;
  --text-light:   #8a99ab;
  --primary:      #3D5B49;
  --primary-dark: #2d4436;
  --primary-light:#527a62;
  --sage:         #DCE5D3;
  --sage-dark:    #c4d2b8;
  --coral:        #E98878;
  --coral-dark:   #d4645a;
  --coral-light:  #f5b5aa;
  --blue:         #E5F0F6;
  --blue-dark:    #c5dde9;
  --blue-mid:     #7ab0cb;
  --ochre:        #E6AE58;
  --ochre-dark:   #c9913a;
  --white:        #ffffff;
  --border:       #e2ddd4;
  --border-light: #ede9e2;

  /* Funkcionális */
  --success:      #3D5B49;
  --success-bg:   #edf3eb;
  --error:        #c0392b;
  --error-bg:     #fdf2f2;
  --warning:      #E6AE58;
  --warning-bg:   #fdf7ec;
  --info:         #3d6fa0;
  --info-bg:      #e8f2fa;

  /* Árnyékok */
  --shadow-xs:    0 1px 3px rgba(34,48,71,.06);
  --shadow-sm:    0 2px 8px rgba(34,48,71,.08);
  --shadow-md:    0 4px 16px rgba(34,48,71,.1);
  --shadow-lg:    0 8px 32px rgba(34,48,71,.12);
  --shadow-xl:    0 16px 48px rgba(34,48,71,.14);
  --shadow-book:  0 4px 24px rgba(34,48,71,.14), 0 1px 4px rgba(34,48,71,.08);

  /* Tipográfia */
  --font-body:    'Lora', Georgia, 'Times New Roman', serif;
  --font-ui:      'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'Courier New', monospace;

  /* Betűméretek (fluid) */
  --text-xs:      0.75rem;    /* 12px */
  --text-sm:      0.875rem;   /* 14px */
  --text-base:    1rem;       /* 16px */
  --text-md:      1.0625rem;  /* 17px */
  --text-lg:      1.125rem;   /* 18px */
  --text-xl:      1.25rem;    /* 20px */
  --text-2xl:     1.5rem;     /* 24px */
  --text-3xl:     1.875rem;   /* 30px */
  --text-4xl:     2.25rem;    /* 36px */
  --text-5xl:     3rem;       /* 48px */

  /* Sorköz */
  --leading-tight:  1.3;
  --leading-snug:   1.45;
  --leading-normal: 1.6;
  --leading-relaxed:1.7;
  --leading-loose:  1.85;

  /* Könyvtartalom sorköz */
  --book-leading:   1.72;
  --book-measure:   65ch; /* max sorhossz */

  /* Térközök */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Lekerekítés */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Méretek */
  --header-h:   60px;
  --header-h-mobile: 52px;
  --book-max-w: 1600px;
  --admin-sidebar: 240px;
  --nav-bottom-h: 64px;

  /* Animációk */
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in:    cubic-bezier(0.64, 0, 0.78, 0);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:   150ms;
  --dur-normal: 250ms;
  --dur-slow:   350ms;
  --dur-page:   300ms;

  /* Z-indexek */
  --z-below:    -1;
  --z-base:     0;
  --z-raised:   10;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  500;
  --z-modal:    600;
  --z-toast:    700;
}

/* Csökkentett mozgás */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast:   0ms;
    --dur-normal: 0ms;
    --dur-slow:   0ms;
    --dur-page:   0ms;
  }
}

/* =============================================================
   2. RESET & ALAP
   ============================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text);
  background-color: var(--bg);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

ul, ol { list-style: none; }

/* Fókusz */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Szövegkijelölés */
::selection {
  background: var(--sage);
  color: var(--text);
}

/* =============================================================
   3. TIPOGRÁFIA
   ============================================================= */

/* Olvasókönyv tartalom */
.prose {
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--book-leading);
  color: var(--text);
  max-width: var(--book-measure);
}

@media (min-width: 768px) {
  .prose {
    font-size: var(--text-xl);
  }
}

.prose p {
  margin-bottom: var(--space-5);
}
.prose p:last-child { margin-bottom: 0; }

.prose h1, .prose h2, .prose h3 {
  font-family: var(--font-body);
  font-weight: 600;
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
  margin-top: var(--space-8);
  color: var(--text);
}
.prose h1 { font-size: var(--text-3xl); }
.prose h2 { font-size: var(--text-2xl); }
.prose h3 { font-size: var(--text-xl); }
.prose > *:first-child { margin-top: 0; }

.prose em { font-style: italic; }
.prose strong { font-weight: 600; }

/* UI fejlécek */
.heading-1 { font-size: var(--text-4xl); font-weight: 700; line-height: var(--leading-tight); }
.heading-2 { font-size: var(--text-3xl); font-weight: 600; line-height: var(--leading-tight); }
.heading-3 { font-size: var(--text-2xl); font-weight: 600; line-height: var(--leading-snug); }
.heading-4 { font-size: var(--text-xl);  font-weight: 600; line-height: var(--leading-snug); }

.label-sm { font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; }
.label-md { font-size: var(--text-sm); font-weight: 500; letter-spacing: 0.04em; }

/* =============================================================
   4. LAYOUT ALAPOK
   ============================================================= */
.container {
  width: 100%;
  max-width: var(--book-max-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 640px) {
  .container { padding-left: var(--space-6); padding-right: var(--space-6); }
}
@media (min-width: 1024px) {
  .container { padding-left: var(--space-8); padding-right: var(--space-8); }
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* =============================================================
   5. FŐ FEJLÉC
   ============================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  height: var(--header-h-mobile);
  background: var(--page);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
}

@media (min-width: 768px) {
  .site-header {
    height: var(--header-h);
  }
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  height: 100%;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}

.site-header__logo {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-body);
  flex-shrink: 0;
}

.site-header__title {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 640px) {
  .site-header__title { max-width: 240px; }
}
@media (min-width: 1024px) {
  .site-header__title { max-width: none; }
}

.site-header__chapter {
  font-size: var(--text-sm);
  color: var(--text-muted);
  display: none;
}

@media (min-width: 1200px) {
  .site-header__chapter { display: block; }
}

.site-header__nav {
  display: none;
  align-items: center;
  gap: var(--space-1);
}

@media (min-width: 1200px) {
  .site-header__nav { display: flex; }
}

.site-header__nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  transition: background var(--dur-fast), color var(--dur-fast);
  text-decoration: none;
}

.site-header__nav-link:hover {
  background: var(--sage);
  color: var(--primary);
  text-decoration: none;
}

.site-header__nav-link.active {
  background: var(--primary);
  color: white;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

@media (max-width: 639px) {
  .site-header .demo-badge { display: none; }
}

/* Demóprofil badge */
.demo-badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--blue);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--info);
  white-space: nowrap;
}

/* Hamburger mobilon */
.header-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--text);
  transition: background var(--dur-fast);
}
.header-menu-btn:hover { background: var(--sage); }
@media (min-width: 1200px) { .header-menu-btn { display: none; } }

/* =============================================================
   6. MOBIL OLDAL NAVIGÁCIÓ (alul rögzített)
   ============================================================= */
.mobile-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  height: var(--nav-bottom-h);
  background: var(--page);
  border-top: 1px solid var(--border-light);
  box-shadow: 0 -2px 12px rgba(34,48,71,.08);
}

@media (min-width: 1200px) {
  .mobile-nav { display: none; }
}

.mobile-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-light);
  font-size: 10px;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--dur-fast);
  min-height: 44px;
}

.mobile-nav__item:hover,
.mobile-nav__item.active {
  color: var(--primary);
  text-decoration: none;
}

.mobile-nav__icon {
  width: 22px;
  height: 22px;
}

/* =============================================================
   7. GOMBOK
   ============================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
  border: 2px solid transparent;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  text-decoration: none;
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-secondary:hover {
  background: var(--sage);
  text-decoration: none;
  color: var(--primary-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}

.btn-coral {
  background: var(--coral);
  color: white;
  border-color: var(--coral);
}
.btn-coral:hover {
  background: var(--coral-dark);
  border-color: var(--coral-dark);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-ochre {
  background: var(--ochre);
  color: white;
  border-color: var(--ochre);
}
.btn-ochre:hover {
  background: var(--ochre-dark);
  color: white;
  text-decoration: none;
}

.btn-sm {
  padding: 0.4rem 0.875rem;
  font-size: var(--text-xs);
  min-height: 36px;
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: var(--text-base);
  min-height: 52px;
}

.btn-xl {
  padding: 1rem 2.5rem;
  font-size: var(--text-lg);
  min-height: 58px;
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
}

/* Icon gomb */
.btn-icon {
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
}
.btn-icon:hover { background: var(--sage); color: var(--text); text-decoration: none; }

/* =============================================================
   8. KÁRTYÁK
   ============================================================= */
.card {
  background: var(--page);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-body {
  padding: var(--space-5) var(--space-6);
}

.card-sm .card-body {
  padding: var(--space-4);
}

.card-lg .card-body {
  padding: var(--space-8);
}

.card-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-light);
  background: var(--bg);
}

/* =============================================================
   9. BADGE / CHIP / TAG
   ============================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  padding: 0.2em 0.6em;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-primary   { background: var(--primary); color: white; }
.badge-sage      { background: var(--sage); color: var(--primary); }
.badge-coral     { background: var(--coral); color: white; }
.badge-ochre     { background: var(--ochre); color: white; }
.badge-blue      { background: var(--blue); color: var(--info); }
.badge-ghost     { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.badge-success   { background: var(--success-bg); color: var(--success); }
.badge-error     { background: var(--error-bg); color: var(--error); }
.badge-warning   { background: var(--warning-bg); color: var(--ochre-dark); }

/* =============================================================
   10. FORM ELEMEK
   ============================================================= */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--page);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  min-height: 44px;
}

.form-input:hover { border-color: var(--sage-dark); }
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(61,91,73,.15);
}

.form-input::placeholder { color: var(--text-light); }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 7L11 1' stroke='%235a6a7e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 2.5rem;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Keresőmező */
.search-field {
  position: relative;
}

.search-field input {
  padding-left: 2.75rem;
}

.search-field__icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

/* =============================================================
   11. HALADÁSSÁV
   ============================================================= */
.progress-bar-wrap {
  height: 6px;
  background: var(--sage);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.4s var(--ease-out);
}

.progress-bar-wrap.thick { height: 8px; }
.progress-bar-wrap.thin  { height: 3px; }

.progress-bar-wrap.coral .progress-bar-fill { background: var(--coral); }
.progress-bar-wrap.ochre .progress-bar-fill { background: var(--ochre); }

/* =============================================================
   12. KÖNYVOLVASÓ – FŐ ELRENDEZÉS
   ============================================================= */
.book-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

/* Könyvfelület */
.book-surface {
  flex: 1;
  padding: var(--space-3) var(--space-3) calc(var(--nav-bottom-h) + var(--space-3));
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (min-width: 768px) {
  .book-surface {
    padding: var(--space-5) var(--space-4) calc(var(--nav-bottom-h) + var(--space-3));
  }
}
@media (min-width: 1200px) {
  .book-surface { padding-bottom: var(--space-5); }
}

/* Könyvlap */
.book-page {
  width: 100%;
  max-width: var(--book-max-w);
  background: var(--page);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-book);
  overflow: clip;               /* clip nem töri meg a sticky pozicionálást */
  transition: opacity var(--dur-page) var(--ease-inout),
              transform var(--dur-page) var(--ease-inout);
}

/* Lap animációk */
.book-page.page-enter { opacity: 0; transform: translateX(24px); }
.book-page.page-enter-active { opacity: 1; transform: translateX(0); }
.book-page.page-exit { opacity: 1; transform: translateX(0); }
.book-page.page-exit-active { opacity: 0; transform: translateX(-24px); }
.book-page.page-prev-enter { opacity: 0; transform: translateX(-24px); }
.book-page.page-prev-enter-active { opacity: 1; transform: translateX(0); }

@media (prefers-reduced-motion: reduce) {
  .book-page,
  .book-page.page-enter,
  .book-page.page-enter-active,
  .book-page.page-exit,
  .book-page.page-exit-active { transition: none; transform: none; }
}

/* ── Belső elrendezés ──────────────────────────────────────────────────── */

/* Alap: mobil-first oszlopos */
.book-page__inner {
  display: flex;
  flex-direction: column;
}

/* Desktop kéthasábos: szöveg BAL, kép JOBB */
@media (min-width: 900px) {
  .book-page__inner {
    flex-direction: row;
    align-items: flex-start;    /* a két oszlop saját magasságát veszi fel */
  }
}

/* ── Képhasáb ──────────────────────────────────────────────────────────── */

.book-page__media {
  flex-shrink: 0;
  background: #111;             /* letterbox háttér ha kell */
  line-height: 0;
  overflow: hidden;
}

/* Mobil: teljes szélesség, felül, lekerekített felső sarkok */
.book-page__media {
  width: 100%;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* Desktop kéthasábos: kép jobb oldalon, 45% szélesség, sticky */
@media (min-width: 900px) {
  .book-page__inner > .book-page__media {
    order: 2;                   /* jobb oldal (content order:1) */
    flex: 0 0 45%;
    max-width: 45%;
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
    position: sticky;
    top: calc(var(--header-h) + 1rem);
    align-self: flex-start;
  }
}

/* A kép maga – mindig természetes arány, soha nem vágódik le */
.book-page__media img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Szöveghasáb ───────────────────────────────────────────────────────── */

.book-page__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-6) var(--space-5);
  min-width: 0;
}

/* Desktop kéthasábos: szöveg bal oldalon, 55% */
@media (min-width: 900px) {
  .book-page__inner > .book-page__content {
    order: 1;                   /* bal oldal */
    flex: 0 0 55%;
    max-width: 55%;
    padding: var(--space-8) var(--space-8);
  }
}

/* Desktop wide mód: tartalom teljes szélességben */
@media (min-width: 768px) and (max-width: 899px) {
  .book-page__inner--wide .book-page__content {
    padding: var(--space-7) var(--space-8);
  }
}

/* Oldalcím */
.book-page__chapter-tag {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.book-page__chapter-tag::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--coral);
  border-radius: var(--radius-full);
}

.book-page__title {
  font-family: var(--font-body);
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--text);
  margin-bottom: var(--space-6);
}

@media (min-width: 768px) {
  .book-page__title { font-size: var(--text-3xl); }
}

.book-page__text {
  flex: 1;
}

/* =============================================================
   13. KÖNYV NAVIGÁCIÓ (alul)
   ============================================================= */
.book-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: 100%;
  max-width: var(--book-max-w);
  padding: var(--space-4) 0 var(--space-2);
}

.book-nav__page-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
}

.book-nav__page-counter {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
}

.book-nav__progress-bar {
  width: 100%;
  max-width: 200px;
  height: 3px;
  background: var(--sage);
  border-radius: var(--radius-full);
}

.book-nav__progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.4s var(--ease-out);
}

.book-nav__btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  border: 2px solid transparent;
  min-height: 44px;
  white-space: nowrap;
}

.book-nav__btn-prev {
  background: var(--page);
  color: var(--text-muted);
  border-color: var(--border);
}
.book-nav__btn-prev:hover:not(:disabled) {
  background: var(--sage);
  color: var(--text);
  border-color: var(--sage-dark);
}

.book-nav__btn-next {
  background: var(--primary);
  color: white;
}
.book-nav__btn-next:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateX(2px);
}

.book-nav__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Arrow ikonok */
.icon-arrow-left::before  { content: '←'; margin-right: 0.25em; }
.icon-arrow-right::after  { content: '→'; margin-left: 0.25em; }

/* =============================================================
   14. TARTALOMJEGYZÉK PANEL
   ============================================================= */
.toc-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 100vw);
  background: var(--page);
  border-left: 1px solid var(--border-light);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease-out);
}

.toc-panel.open { transform: translateX(0); }

.toc-panel__header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toc-panel__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
}

.toc-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) 0;
}

.toc-chapter {
  margin-bottom: var(--space-2);
}

.toc-chapter__title {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.toc-page-item {
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-6);
  gap: var(--space-3);
  cursor: pointer;
  transition: background var(--dur-fast);
  text-decoration: none;
}

.toc-page-item:hover {
  background: var(--sage);
  text-decoration: none;
}

.toc-page-item.current {
  background: rgba(61,91,73,.1);
}

.toc-page-item__num {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-light);
  width: 28px;
  flex-shrink: 0;
}

.toc-page-item__title {
  font-size: var(--text-sm);
  color: var(--text);
  flex: 1;
}

.toc-page-item__status {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--border);
  flex-shrink: 0;
}

.toc-page-item.visited .toc-page-item__status {
  background: var(--sage-dark);
}

.toc-page-item.reviewed .toc-page-item__status {
  background: var(--primary);
}

/* TOC overlay */
.toc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(34,48,71,.35);
  z-index: calc(var(--z-modal) - 1);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.toc-overlay.visible { opacity: 1; pointer-events: all; }

/* =============================================================
   15. FOGALOMKÁRTYÁK / TOOLTIP
   ============================================================= */
.glossary-term-inline {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px dotted var(--primary);
  transition: color var(--dur-fast);
}
.glossary-term-inline:hover { color: var(--primary-dark); }

/* Fogalomkártya popup */
.glossary-popup {
  position: absolute;
  z-index: var(--z-dropdown);
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-5);
  max-width: 320px;
  width: max-content;
}

.glossary-popup__label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-2);
}

.glossary-popup__def {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text);
}

.glossary-popup__footer {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-light);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Fogalomtár oldal kártyái */
.glossary-card {
  background: var(--page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--dur-fast), border-color var(--dur-fast);
}

.glossary-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--sage-dark);
}

.glossary-card__front {
  padding: var(--space-5) var(--space-6);
}

.glossary-card__back {
  display: none;
  padding: var(--space-5) var(--space-6);
  background: var(--sage);
  border-top: 1px solid var(--border-light);
}

.glossary-card.flipped .glossary-card__back { display: block; }

.glossary-card__term {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.glossary-card__chapter {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* =============================================================
   16. INTERAKTÍV FELADATOK
   ============================================================= */

/* Feladatblokk */
.activity-block {
  background: var(--blue);
  border: 1px solid var(--blue-dark);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin: var(--space-6) 0;
}

.activity-block__header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.activity-block__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.activity-block__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
}

.activity-block__desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* Párosítás feladat */
.matching-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

@media (max-width: 480px) {
  .matching-area { grid-template-columns: 1fr; }
}

.matching-col__title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.match-item {
  width: 100%;
  text-align: left;
  background: var(--page);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  user-select: none;
  min-height: 56px;
  display: flex;
  align-items: center;
}

.match-item + .match-item { margin-top: var(--space-2); }
.match-item__pair { display: block; font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-1); }
.matching-area > div { min-width: 0; }
.book-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1rem; }

.match-item:hover:not(.matched):not(:disabled) {
  border-color: var(--primary);
  background: rgba(61,91,73,.05);
}

.match-item.selected {
  border-color: var(--primary);
  background: rgba(61,91,73,.1);
  box-shadow: 0 0 0 3px rgba(61,91,73,.15);
}

.match-item.matched {
  border-color: var(--success);
  background: var(--success-bg);
  cursor: default;
  color: var(--primary);
}

.match-item.matched.incorrect {
  border-color: var(--error);
  background: var(--error-bg);
  color: var(--error);
}

/* Kvíz kérdések */
.quiz-question {
  margin-bottom: var(--space-6);
}

.quiz-question__text {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--text);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-4);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--page);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  min-height: 52px;
  text-align: left;
}

.quiz-option:hover:not(.selected):not(.correct):not(.incorrect) {
  border-color: var(--primary);
  background: rgba(61,91,73,.04);
}

.quiz-option.selected {
  border-color: var(--primary);
  background: rgba(61,91,73,.08);
}

.quiz-option.correct {
  border-color: var(--success);
  background: var(--success-bg);
}

.quiz-option.incorrect {
  border-color: var(--error);
  background: var(--error-bg);
}

.quiz-option__letter {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all var(--dur-fast);
}

.quiz-option.selected .quiz-option__letter {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.quiz-option.correct .quiz-option__letter {
  border-color: var(--success);
  background: var(--success);
  color: white;
}

.quiz-option.incorrect .quiz-option__letter {
  border-color: var(--error);
  background: var(--error);
  color: white;
}

.quiz-option__text {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text);
  flex: 1;
}

/* Visszajelzés */
.feedback-box {
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-top: var(--space-4);
  display: flex;
  gap: var(--space-3);
}

.feedback-box.correct {
  background: var(--success-bg);
  border: 1px solid rgba(61,91,73,.2);
}

.feedback-box.incorrect {
  background: var(--error-bg);
  border: 1px solid rgba(192,57,43,.2);
}

.feedback-box.info {
  background: var(--blue);
  border: 1px solid var(--blue-dark);
}

.feedback-box__icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.feedback-box__text {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text);
}

/* Véleménykérdés */
.opinion-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-4) 0;
}

.opinion-btn {
  padding: var(--space-2) var(--space-4);
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  background: var(--page);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  min-height: 44px;
}

.opinion-btn:hover { border-color: var(--primary); background: rgba(61,91,73,.05); }
.opinion-btn.selected { border-color: var(--primary); background: var(--primary); color: white; }

/* =============================================================
   17. JÁTÉKOK
   ============================================================= */
.game-card {
  background: var(--page);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
  text-align: center;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast);
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.game-card__icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-xl);
  margin: 0 auto var(--space-5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.game-card.taboo .game-card__icon { background: var(--coral); }
.game-card.match .game-card__icon { background: var(--ochre); }
.game-card.bloff .game-card__icon { background: var(--primary); }

.game-card__name {
  font-family: var(--font-body);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.game-card__desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
}

/* TABOO! kártya */
.taboo-card {
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-dark) 100%);
  color: white;
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  box-shadow: var(--shadow-md);
}

.taboo-card__term {
  font-family: var(--font-body);
  font-size: var(--text-3xl);
  font-weight: 700;
}

.taboo-words {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-3);
}

.taboo-word {
  padding: var(--space-1) var(--space-3);
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  text-decoration: line-through;
  text-decoration-color: rgba(255,255,255,.6);
}

/* MATCH! kártyák */
.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
  gap: var(--space-3);
}

.match-card {
  aspect-ratio: 3/2;
  border-radius: var(--radius-lg);
  cursor: pointer;
  perspective: 600px;
  min-height: 110px;
}

.match-card__inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.4s var(--ease-out);
}

.match-card.flipped .match-card__inner { transform: rotateY(180deg); }

.match-card__face {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 500;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.match-card__back {
  background: var(--primary);
  color: white;
  font-size: 20px;
}

.match-card__front {
  background: var(--sage);
  color: var(--text);
  transform: rotateY(180deg);
  font-size: var(--text-xs);
  overflow: auto;
}

.match-card.term .match-card__front { background: var(--blue); }
.match-card.matched .match-card__front { background: var(--success-bg); border: 2px solid var(--success); }

/* =============================================================
   18. ADMIN ELRENDEZÉS
   ============================================================= */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* Admin oldalsáv */
.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--admin-sidebar);
  background: var(--text);
  color: white;
  display: flex;
  flex-direction: column;
  z-index: var(--z-sticky);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform var(--dur-slow) var(--ease-out);
}

.admin-sidebar.open { transform: translateX(0); }

@media (min-width: 1024px) {
  .admin-sidebar { transform: translateX(0); position: sticky; height: 100vh; flex-shrink: 0; }
}

.admin-sidebar__header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.admin-sidebar__brand {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
  color: white;
  margin-bottom: var(--space-1);
}

.admin-sidebar__sub {
  font-size: var(--text-xs);
  color: rgba(255,255,255,.5);
}

.admin-nav {
  flex: 1;
  padding: var(--space-4) 0;
}

.admin-nav__section-title {
  padding: var(--space-3) var(--space-6) var(--space-2);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,.4);
}

.admin-nav__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 500;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  transition: all var(--dur-fast);
  border-left: 3px solid transparent;
}

.admin-nav__link:hover {
  color: white;
  background: rgba(255,255,255,.07);
  text-decoration: none;
}

.admin-nav__link.active {
  color: white;
  background: rgba(255,255,255,.1);
  border-left-color: var(--coral);
}

.admin-nav__icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}

.admin-nav__link.active .admin-nav__icon { opacity: 1; }

.admin-sidebar__footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid rgba(255,255,255,.1);
}

/* Admin fő tartalom */
.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .admin-main { margin-left: 0; }
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-raised);
  height: var(--header-h);
  background: var(--page);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-4);
  justify-content: space-between;
}

.admin-topbar__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
}

.admin-content {
  padding: var(--space-6);
  flex: 1;
}

@media (min-width: 1280px) {
  .admin-content { padding: var(--space-8); }
}

/* Admin statisztika kártyák */
.stat-card {
  background: var(--page);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.stat-card__label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.stat-card__value {
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: var(--space-1);
}

.stat-card__sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(6, 1fr); }
}

/* Admin táblázatok */
.data-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--page);
  font-size: var(--text-sm);
}

.data-table th {
  background: var(--bg);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.data-table th:hover { color: var(--text); }
.data-table th.sorted { color: var(--primary); }

.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover td { background: rgba(61,91,73,.03); }

.data-table tbody tr.clickable { cursor: pointer; }

/* Admin fülrendszer */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: var(--space-6);
  overflow-x: auto;
}

.admin-tab {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--dur-fast);
  white-space: nowrap;
}

.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* =============================================================
   19. HALADÁSPANEL / ÖSSZESÍTŐ
   ============================================================= */
.progress-overview {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .progress-overview { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .progress-overview { grid-template-columns: repeat(3, 1fr); }
}

.progress-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.progress-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-item__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}

.progress-item__value {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--primary);
}

/* =============================================================
   20. ÉRTESÍTÉSEK / TOASTOK
   ============================================================= */
.toast-container {
  position: fixed;
  bottom: calc(var(--nav-bottom-h) + var(--space-4));
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
  width: min(360px, calc(100vw - 2rem));
}

@media (min-width: 768px) {
  .toast-container { bottom: var(--space-6); }
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--text);
  color: white;
  border-radius: var(--radius-xl);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toastIn 0.3s var(--ease-out);
}

.toast.toast-success { background: var(--primary); }
.toast.toast-error   { background: var(--error); }
.toast.toast-info    { background: var(--info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================================
   21. MODAL DIALÓGUS
   ============================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(34,48,71,.45);
  z-index: var(--z-overlay);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-normal) var(--ease-out);
}

@media (min-width: 640px) {
  .modal-backdrop {
    align-items: center;
    padding: var(--space-4);
  }
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--page);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(24px);
  transition: transform var(--dur-normal) var(--ease-out);
}

@media (min-width: 640px) {
  .modal {
    border-radius: var(--radius-2xl);
    transform: scale(0.96);
    max-height: 80vh;
  }
}

.modal-backdrop.open .modal {
  transform: translateY(0);
}

@media (min-width: 640px) {
  .modal-backdrop.open .modal { transform: scale(1); }
}

.modal__header {
  padding: var(--space-5) var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--page);
  z-index: 1;
}

.modal__title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text);
}

.modal__body {
  padding: var(--space-6);
}

.modal__footer {
  padding: var(--space-4) var(--space-6) var(--space-6);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* =============================================================
   22. KEZDŐOLDAL
   ============================================================= */
.home-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
  text-align: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.home-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  background: var(--sage);
  opacity: 0.4;
  z-index: 0;
}

.home-hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 50vmax;
  height: 50vmax;
  border-radius: 50%;
  background: var(--blue);
  opacity: 0.5;
  z-index: 0;
}

.home-hero__content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  width: 100%;
}

.home-hero__tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--blue);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--primary);
  margin-bottom: var(--space-6);
}

.home-hero__title {
  font-family: var(--font-body);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--text);
  margin-bottom: var(--space-5);
}

.home-hero__title em {
  font-style: normal;
  color: var(--primary);
}

.home-hero__desc {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-muted);
  margin-bottom: var(--space-8);
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}

/* Jelenetkártyák a Főoldalon */
.home-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-top: var(--space-12);
  text-align: left;
}

@media (min-width: 640px) {
  .home-features { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .home-features { grid-template-columns: repeat(3, 1fr); }
}

.feature-card {
  background: var(--page);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  border: 1px solid var(--border-light);
}

.feature-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: var(--space-4);
}

.feature-card__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.feature-card__desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
}

/* =============================================================
   23. BELÉPÉSI OLDAL
   ============================================================= */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
  background: var(--bg);
}

.profile-picker {
  width: 100%;
  max-width: 640px;
}

.profile-card {
  background: var(--page);
  border: 2px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  text-decoration: none;
  color: var(--text);
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

.profile-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--text);
}

.profile-card.selected {
  border-color: var(--primary);
  background: rgba(61,91,73,.04);
}

.profile-card__avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.profile-card.new-reader .profile-card__avatar  { background: var(--blue); }
.profile-card.mid-reader .profile-card__avatar   { background: var(--sage); }
.profile-card.done-reader .profile-card__avatar  { background: var(--ochre); opacity: 0.9; }

.profile-card__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-1);
}

.profile-card__desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* =============================================================
   24. BREADCRUMB / OLDALCÍMKE
   ============================================================= */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); text-decoration: none; }
.breadcrumb__sep { color: var(--text-light); }
.breadcrumb__current { color: var(--text); font-weight: 500; }

/* =============================================================
   25. PAGINATION (admin)
   ============================================================= */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-6);
}

.pagination__btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--page);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast);
}

.pagination__btn:hover { border-color: var(--primary); color: var(--primary); }
.pagination__btn.active { background: var(--primary); border-color: var(--primary); color: white; }

/* =============================================================
   26. UTILITIES
   ============================================================= */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.text-primary   { color: var(--primary); }
.text-muted     { color: var(--text-muted); }
.text-light     { color: var(--text-light); }
.text-coral     { color: var(--coral-dark); }
.text-ochre     { color: var(--ochre-dark); }
.text-success   { color: var(--success); }
.text-error     { color: var(--error); }

.bg-sage   { background: var(--sage); }
.bg-blue   { background: var(--blue); }
.bg-page   { background: var(--page); }
.bg-ochre  { background: var(--ochre); }
.bg-coral  { background: var(--coral); }

.font-body { font-family: var(--font-body); }
.font-ui   { font-family: var(--font-ui); }

.font-bold    { font-weight: 700; }
.font-semibold{ font-weight: 600; }
.font-medium  { font-weight: 500; }

.rounded     { border-radius: var(--radius-md); }
.rounded-lg  { border-radius: var(--radius-lg); }
.rounded-xl  { border-radius: var(--radius-xl); }
.rounded-full{ border-radius: var(--radius-full); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.hidden { display: none !important; }
.block  { display: block !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }

.divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: var(--space-6) 0;
}

/* Scrroll tartalom jelölő */
.scroll-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--sage);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
  margin-top: var(--space-6);
  align-self: flex-start;
  transition: background var(--dur-fast);
}

.scroll-indicator:hover { background: var(--sage-dark); }

/* Nyomcédulák */
.clue-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--ochre);
  color: white;
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast);
  margin: var(--space-1);
}

.clue-tag:hover { background: var(--ochre-dark); transform: scale(1.03); }

/* Két hasáb összehasonlítás */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin: var(--space-5) 0;
}

@media (max-width: 480px) {
  .compare-grid { grid-template-columns: 1fr; }
}

.compare-col {
  background: var(--page);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  border: 1px solid var(--border-light);
}

.compare-col__title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--coral);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.compare-col.correct-side .compare-col__title { color: var(--primary); }

.compare-col__text {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text);
}

/* Expandálható fogalommagyarázat */
.expandable {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--space-3) 0;
}

.expandable__trigger {
  width: 100%;
  padding: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--page);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  transition: background var(--dur-fast);
}

.expandable__trigger:hover { background: var(--sage); }

.expandable__icon {
  width: 20px;
  height: 20px;
  transition: transform var(--dur-fast);
  flex-shrink: 0;
}

.expandable.open .expandable__icon { transform: rotate(180deg); }

.expandable__body {
  display: none;
  padding: var(--space-4);
  background: var(--bg);
  border-top: 1px solid var(--border-light);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text);
}

.expandable.open .expandable__body { display: block; }

/* Nyomvonal sáv */
.clue-trail {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-4);
  background: var(--ochre);
  background: linear-gradient(135deg, rgba(230,174,88,.15) 0%, rgba(230,174,88,.05) 100%);
  border: 1px solid rgba(230,174,88,.3);
  border-radius: var(--radius-xl);
  margin: var(--space-4) 0;
}

.clue-trail__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--page);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.clue-trail__item.found {
  color: var(--ochre-dark);
  border-color: var(--ochre);
  background: rgba(230,174,88,.1);
}

/* =============================================================
   27. PRINT
   ============================================================= */
@media print {
  .site-header, .mobile-nav, .book-nav,
  .toc-panel, .admin-sidebar, .admin-topbar { display: none; }
  .book-page { box-shadow: none; border: 1px solid #ccc; }
}

/* =============================================================
   28. SÖTÉT MÓD (jövőbeni kiterjesztés) – alapvetés
   ============================================================= */
@media (prefers-color-scheme: dark) {
  /* A demó explicit világos témát használ - ha szükséges, ide kerül */
}

/* =============================================================
   29. SZÖVEGMÉRET SEGÉDOSZTÁLYOK
   ============================================================= */
.text-size-lg .book-page__text,
.text-size-lg .prose { font-size: 1.125rem; line-height: 1.8; }

.text-size-xl .book-page__text,
.text-size-xl .prose { font-size: 1.25rem; line-height: 1.85; }

/* =============================================================
   30. CSÖKKENTETT MOZGÁS OSZTÁLY (JS-ből beállítva)
   ============================================================= */
html.reduced-motion *,
html.reduced-motion *::before,
html.reduced-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* =============================================================
   31. KÖNYV TÁRTALOMJEGYZÉK OLDAL – teljes nézet
   ============================================================= */
.toc-full { max-width: 800px; margin: 0 auto; padding: 2rem var(--space-4); }

.toc-full .toc-chapter { margin-bottom: 2rem; }

/* =============================================================
   32. RESZPONZÍV FINOMHANGOLÁS (kiegészítők)
   ============================================================= */
@media (max-width: 639px) {
  .dash-charts { grid-template-columns: 1fr !important; }
  .stat-grid   { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .dash-charts { grid-template-columns: 1fr 1fr; }
}

/* Haladás oldal aktív gomb */
#btn-reviewed {
  width: 100%;
  text-align: center;
  background: var(--bg);
  border: 1.5px dashed var(--border);
  color: var(--text-muted);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--dur-fast);
}
#btn-reviewed:hover { background: var(--sage); border-color: var(--sage-dark); color: var(--primary); }
#btn-reviewed:disabled { cursor: default; }

/* Matching összekapcsolt állapot */
.match-item.selected {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Quiz kérdés disabled állapot */
.quiz-option:disabled {
  cursor: default;
}
.quiz-option.correct  { background: var(--success-bg); border-color: var(--primary); color: var(--primary); }
.quiz-option.incorrect { background: var(--error-bg); border-color: var(--error); color: var(--error); }
