
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

/* ==============================
   ALAPBEÁLLÍTÁSOK
============================== */

:root {
  color-scheme: dark;
  font-family: 'Manrope', Arial, sans-serif;

  --bg: #080d18;
  --panel: rgba(17, 26, 44, 0.94);
  --panel-light: rgba(24, 38, 61, 0.85);
  --line: rgba(145, 174, 215, 0.15);
  --line-hover: rgba(104, 181, 255, 0.55);

  --text: #f1f5fc;
  --muted: #94a5bf;

  --blue: #78c8ff;
  --blue-strong: #4a9fff;
  --danger: #ff8b9c;
  --good: #5be0ad;

  --radius: 22px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 30px 18px;

  display: grid;
  place-items: center;

  color: var(--text);
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  background:
    radial-gradient(ellipse at 15% 10%, rgba(41, 111, 200, 0.19), transparent 38%),
    radial-gradient(ellipse at 90% 85%, rgba(74, 87, 190, 0.13), transparent 35%),
    linear-gradient(145deg, #070b14 0%, #0b1424 52%, #080e1b 100%);

  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.2;

  background-image:
    linear-gradient(rgba(151, 185, 230, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(151, 185, 230, 0.045) 1px, transparent 1px);

  background-size: 42px 42px;

  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

::selection {
  color: #06101e;
  background: var(--blue);
}

/* ==============================
   FŐ ELRENDEZÉS
============================== */

.app {
  position: relative;
  width: min(100%, 650px);
  margin: auto;
}

.hidden {
  display: none !important;
}

/* ==============================
   LOGÓ ÉS FEJLÉC
============================== */

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;

  margin: 0 0 30px;

  color: #f5f8ff;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.brand-mark {
  display: grid;
  place-items: center;

  min-width: 48px;
  height: 42px;
  padding: 0 7px;

  border: 1px solid rgba(157, 218, 255, 0.6);
  border-radius: 13px;

  color: #071426;
  background: linear-gradient(135deg, #b9e8ff, #62b6ff 65%, #8a9cff);

  box-shadow:
    0 5px 24px rgba(64, 159, 255, 0.2),
    inset 0 1px rgba(255, 255, 255, 0.55);

  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* ==============================
   KÖZÖS KÁRTYA
============================== */

.glass {
  border: 1px solid var(--line);
  border-radius: var(--radius);

  background: var(--panel);

  box-shadow:
    var(--shadow),
    inset 0 1px rgba(255, 255, 255, 0.025);

  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.login-screen {
  width: min(100%, 410px);
  margin: 0 auto;
  padding: 18px;
}

.content-screen {
  padding: clamp(24px, 5vw, 40px);
  animation: screen-in 0.28s ease both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==============================
   BELÉPÉSI FELÜLET
============================== */

#login-form {
  display: grid;
  gap: 12px;
}

.code-input {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 0 18px;

  border: 1px solid rgba(143, 174, 216, 0.2);
  border-radius: 15px;
  outline: none;

  background: rgba(5, 12, 24, 0.8);
  color: var(--text);

  text-align: center;
  letter-spacing: 0.2em;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.code-input::placeholder {
  color: var(--muted);
}

.code-input:focus {
  border-color: var(--blue);
  background: rgba(8, 19, 35, 0.98);

  box-shadow: 0 0 0 4px rgba(90, 169, 255, 0.1);
}

/* ==============================
   ELSŐDLEGES GOMBOK
============================== */

.enter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;

  min-height: 52px;
  padding: 0 22px;

  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;

  color: #071426;
  background: linear-gradient(110deg, #b8e9ff, #72c3ff 60%, #8ea6ff);

  box-shadow: 0 8px 25px rgba(52, 139, 245, 0.15);

  font-family: inherit;
  font-size: 13px;
  font-weight: 800;

  cursor: pointer;

  transition:
    filter 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.enter-button:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(52, 139, 245, 0.22);
}

.enter-button:active {
  transform: translateY(0);
}

.enter-button:focus-visible,
.topic-card:focus-visible,
.subtle-button:focus-visible,
.text-button:focus-visible,
.answer-option:focus-visible {
  outline: 2px solid #b7e8ff;
  outline-offset: 4px;
}

.enter-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.error {
  min-height: 0;
  margin: 0;
  color: var(--danger);
  text-align: center;
  font-size: 12px;
}

.error:empty {
  display: none;
}

/* ==============================
   CÍMSOROK ÉS KISEBB FELIRATOK
============================== */

.section-heading {
  margin: 0 0 28px;
}

.eyebrow {
  margin: 0 0 10px;

  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.5;
}

h1 {
  margin: 0;

  color: #f4f7ff;
  font-family: inherit;
  font-size: clamp(25px, 5vw, 34px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.055em;
  overflow-wrap: anywhere;
}

/* ==============================
   TÉMAKÖRVÁLASZTÁS
============================== */

.topic-card {
  display: flex;
  align-items: center;
  gap: 15px;

  width: 100%;
  padding: 19px;

  border: 1px solid rgba(116, 174, 237, 0.22);
  border-radius: 17px;

  color: var(--text);
  text-align: left;

  background: linear-gradient(
    120deg,
    rgba(29, 53, 83, 0.8),
    rgba(15, 27, 46, 0.95)
  );

  cursor: pointer;

  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.topic-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-hover);

  background: linear-gradient(
    120deg,
    rgba(35, 68, 105, 0.9),
    rgba(17, 32, 54, 0.98)
  );
}

.topic-icon {
  display: grid;
  flex: 0 0 48px;
  place-items: center;

  width: 48px;
  height: 48px;

  border: 1px solid rgba(121, 195, 255, 0.2);
  border-radius: 14px;

  color: var(--blue);
  background: rgba(74, 159, 255, 0.1);

  font-size: 23px;
}

.topic-copy {
  display: grid;
  flex: 1;
  gap: 5px;
  min-width: 0;
}

.topic-copy strong {
  color: #f2f6ff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.topic-copy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.topic-arrow {
  color: var(--blue);
  font-size: 22px;
  transition: transform 0.2s ease;
}

.topic-card:hover .topic-arrow {
  transform: translateX(3px);
}

.add-topic {
  display: grid;
  grid-template-columns: 25px 1fr auto;
  align-items: center;
  gap: 9px;

  margin-top: 12px;
  padding: 15px 17px;

  border: 1px dashed rgba(129, 170, 210, 0.2);
  border-radius: 15px;

  color: #9aabc2;
  font-size: 12px;
}

.add-topic > span:first-child {
  color: #8caed4;
  font-size: 19px;
}

.add-topic small {
  color: #788ba6;
  font-size: 10px;
}

/* ==============================
   TESZT FEJLÉC ÉS HALADÁS
============================== */

.quiz-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  margin-bottom: 18px;

  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.text-button {
  padding: 7px 0;

  border: 0;
  background: transparent;

  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;

  cursor: pointer;
  transition: color 0.18s ease;
}

.text-button:hover {
  color: var(--blue);
}

.progress-track,
.result-track {
  height: 5px;
  overflow: hidden;

  border-radius: 99px;
  background: rgba(129, 158, 197, 0.15);
}

.progress-track {
  margin-bottom: 28px;
}

.progress-bar,
.result-bar {
  width: 0;
  height: 100%;

  border-radius: inherit;
  background: linear-gradient(90deg, #499dff, #83d8ff);

  transition: width 0.3s ease;
}

/* ==============================
   KÉRDÉSEK ÉS VÁLASZOK
============================== */

.question-text {
  margin: 0 0 24px;

  color: #f2f6ff;
  font-family: inherit;
  font-size: clamp(21px, 4vw, 29px);
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.04em;

  overflow-wrap: anywhere;
}

.answer-list {
  display: grid;
  gap: 10px;
}

.answer-option {
  display: flex;
  align-items: center;
  gap: 13px;

  width: 100%;
  min-height: 58px;
  padding: 13px 15px;

  border: 1px solid rgba(129, 164, 205, 0.17);
  border-radius: 14px;

  background: rgba(7, 16, 30, 0.65);
  color: #eaf1fc;

  text-align: left;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;

  cursor: pointer;

  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.answer-option:hover {
  border-color: rgba(121, 195, 255, 0.5);
  background: rgba(25, 47, 75, 0.7);
}

.answer-option:active {
  transform: scale(0.995);
}

.answer-option.selected {
  border-color: var(--blue);
  background: rgba(55, 124, 188, 0.2);
  box-shadow: inset 0 0 0 1px rgba(121, 213, 255, 0.08);
}

.answer-letter {
  display: grid;
  flex: 0 0 30px;
  place-items: center;

  width: 30px;
  height: 30px;

  border: 1px solid rgba(140, 175, 219, 0.1);
  border-radius: 9px;

  color: #b5d8ff;
  background: rgba(40, 61, 91, 0.75);

  font-size: 11px;
  font-weight: 800;

  transition:
    color 0.18s ease,
    background 0.18s ease;
}

.answer-option.selected .answer-letter {
  color: #061426;
  background: var(--blue);
}

/* ==============================
   TESZT NAVIGÁCIÓ
============================== */

.quiz-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;

  margin-top: 24px;
}

.subtle-button {
  min-height: 49px;
  padding: 0 18px;

  border: 1px solid var(--line);
  border-radius: 13px;

  background: rgba(20, 34, 54, 0.75);
  color: var(--text);

  font-family: inherit;
  font-size: 12px;
  font-weight: 700;

  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease;
}

.subtle-button:hover:not(:disabled) {
  border-color: var(--line-hover);
  background: rgba(32, 52, 79, 0.85);
}

.subtle-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.quiz-controls .enter-button {
  min-width: 145px;
}

.message {
  min-height: 16px;
  margin: 12px 0 0;

  color: var(--danger);
  font-size: 12px;
  line-height: 1.6;
}

/* ==============================
   EREDMÉNYEK
============================== */

.result-score {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;

  margin: 25px 0 20px;
}

.result-score strong {
  color: #f4f7ff;
  font-size: clamp(40px, 8vw, 62px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.06em;
}

.result-score span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.result-track {
  height: 8px;
  margin-bottom: 25px;
}

.result-details {
  display: grid;
  gap: 11px;
  margin-bottom: 26px;
}

.result-item {
  padding: 16px;

  border: 1px solid var(--line);
  border-left: 3px solid var(--danger);
  border-radius: 13px;

  background: rgba(7, 16, 30, 0.6);
}

.result-item.correct {
  border-left-color: var(--good);
}

.result-item strong {
  display: block;
  margin-bottom: 9px;

  color: #f0f5ff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.65;

  overflow-wrap: anywhere;
}

.result-item p {
  margin: 5px 0 0;

  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;

  overflow-wrap: anywhere;
}

.result-item .correct-answer {
  color: var(--good);
}

.full-button {
  width: 100%;
}

.home-button {
  display: block;
  margin: 13px auto 0;
}

/* ==============================
   KÉPERNYŐOLVASÓ
============================== */

.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;
}

/* ==============================
   MOBILOS MEGJELENÉS
============================== */

@media (max-width: 480px) {
  body {
    padding: 20px 12px;
  }

  .app {
    width: 100%;
  }

  .brand {
    gap: 11px;
    margin-bottom: 23px;
    font-size: 18px;
  }

  .brand-mark {
    min-width: 45px;
    height: 39px;
    border-radius: 12px;
  }

  .glass {
    border-radius: 19px;
  }

  .login-screen {
    padding: 13px;
  }

  .content-screen {
    padding: 23px 17px;
  }

  .section-heading {
    margin-bottom: 23px;
  }

  .topic-card {
    gap: 12px;
    padding: 15px 13px;
  }

  .topic-icon {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
  }

  .topic-copy strong {
    font-size: 13px;
  }

  .topic-copy small {
    font-size: 11px;
  }

  .add-topic {
    grid-template-columns: 22px 1fr;
    padding: 14px;
  }

  .add-topic small {
    grid-column: 2;
  }

  .question-text {
    font-size: 22px;
  }

  .answer-option {
    gap: 11px;
    padding: 12px;
    font-size: 12px;
  }

  .quiz-controls .enter-button {
    min-width: 0;
    flex: 1;
    padding: 0 12px;
  }

  .subtle-button {
    padding: 0 12px;
  }

  .result-item {
    padding: 13px;
  }
}

/* ==============================
   MOZGÁSCSÖKKENTÉS
============================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}