/* Avalanche IQ web app — styles. Design tokens come from ../styles.css.
   App views: glass cards on navy, matching the iOS app's Liquid Glass. */

/* ---------- sticky footer: short views (e.g. a quiz question) pin the
   privacy/terms/contact bar to the bottom of the viewport instead of
   leaving an empty gap below the content ---------- */
body { min-height: 100vh; display: flex; flex-direction: column; }
.app-nav { flex-shrink: 0; }
.app-main { flex: 1 0 auto; }
.footer { flex-shrink: 0; }

.app-main { max-width: 720px; margin: 0 auto; padding: clamp(24px, 5vh, 48px) 20px 80px; }
.app-main h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; }
.app-main h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 6px; }

/* ---------- nav ---------- */
.app-nav__right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.app-nav__user { color: var(--muted); font-size: 0.85rem; font-weight: 600; }

/* ---------- language switcher (EN/DE/FR/IT pills, mirrors the marketing site) ---------- */
.app-lang { display: flex; gap: 2px; background: rgba(11, 30, 51, 0.55); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.app-lang__pill {
  font: inherit; font-weight: 700; font-size: 0.72rem; letter-spacing: 0.02em;
  color: var(--muted); background: transparent; border: none;
  border-radius: 999px; padding: 5px 9px; cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.app-lang__pill:hover { color: var(--frost); }
.app-lang__pill.is-active { background: var(--frost); color: var(--bg-deep); }
@media (max-width: 560px) { .app-lang__pill { padding: 4px 6px; font-size: 0.66rem; } }
.app-nav__btn {
  font: inherit; font-weight: 700; font-size: 0.85rem;
  color: var(--bg-deep); background: var(--frost);
  border: none; border-radius: 999px; padding: 8px 16px; cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.app-nav__btn:hover { background: #a5e0f2; transform: translateY(-1px); }
.app-nav__btn--ghost {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border);
}
.app-nav__btn--ghost:hover { color: var(--frost); background: rgba(127, 209, 232, 0.08); }

/* ---------- glass card ---------- */
.card {
  position: relative;
  background: var(--glass-grad);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border: var(--glass-border);
  border-radius: 22px;
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: 0 20px 44px -28px rgba(0, 0, 0, 0.65);
}
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--glass-sheen); pointer-events: none;
}
.card h2, .card p { position: relative; }
.card .muted { color: var(--muted); font-size: 0.92rem; }

/* ---------- stats row ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.stat {
  background: var(--glass-grad);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border: var(--glass-border);
  border-radius: 18px;
  padding: 14px 10px;
  text-align: center;
}
.stat__num { font-size: 1.4rem; font-weight: 800; color: var(--frost); line-height: 1.1; }
.stat__label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }
@media (max-width: 520px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- subject cards ---------- */
.subjects { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
@media (max-width: 560px) { .subjects { grid-template-columns: 1fr; } }
.subject {
  position: relative;
  text-align: left;
  font: inherit;
  cursor: pointer;
  background: var(--glass-grad);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border: var(--glass-border);
  border-radius: 18px;
  padding: 16px;
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.subject:hover { transform: translateY(-2px); border-color: rgba(127, 209, 232, 0.4); }
.subject__icon { font-size: 1.3rem; margin-bottom: 6px; display: block; }
.subject__name { font-weight: 800; font-size: 1rem; }
.subject__meta { color: var(--muted); font-size: 0.82rem; margin-top: 3px; }

/* ---------- quiz ---------- */
.quiz-progress { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-bottom: 20px; }
.quiz-progress__fill { height: 100%; background: var(--frost); border-radius: 999px; transition: width 0.3s ease; }
.quiz-question { font-size: clamp(1.15rem, 2.6vw, 1.4rem); font-weight: 700; line-height: 1.4; margin-bottom: 20px; }
.quiz-options { display: grid; gap: 10px; }
.quiz-option {
  font: inherit;
  text-align: left;
  cursor: pointer;
  background: rgba(11, 30, 51, 0.35);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 0.98rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.quiz-option:hover { border-color: rgba(127, 209, 232, 0.5); }
.quiz-option.is-correct { background: rgba(76, 175, 125, 0.25); border-color: rgb(76, 175, 125); }
.quiz-option.is-wrong { background: rgba(229, 99, 107, 0.22); border-color: rgb(229, 99, 107); }
.quiz-option:disabled { cursor: default; }
.feedback {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(11, 30, 51, 0.45);
  border: 1px solid var(--border);
}
.feedback--correct { border-color: rgb(76, 175, 125); }
.feedback--wrong { border-color: rgb(229, 99, 107); }
.feedback__title { font-weight: 800; margin-bottom: 6px; }
.feedback--correct .feedback__title { color: rgb(76, 175, 125); }
.feedback--wrong .feedback__title { color: rgb(229, 99, 107); }
.feedback__xp { color: var(--amber); font-weight: 800; margin-top: 8px; }
.feedback__streak { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--bg-deep);
  background: var(--frost);
  border: none;
  border-radius: 999px;
  padding: 13px 28px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { background: #a5e0f2; transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn--ghost {
  background: transparent; color: var(--frost);
  border: 1px solid var(--border);
}
.btn--ghost:hover { background: rgba(127, 209, 232, 0.08); }
.btn--block { display: block; width: 100%; text-align: center; }
.btn--amber { background: var(--amber); }
.btn--amber:hover { background: #ffd97a; }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: rgba(11, 30, 51, 0.45);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  box-sizing: border-box;
}
.field input:focus, .field select:focus { border-color: var(--frost); }
.hint { color: var(--muted); font-size: 0.85rem; margin-top: 10px; }
.error { color: rgb(229, 99, 107); font-size: 0.9rem; margin-top: 10px; }
.success { color: rgb(76, 175, 125); font-size: 0.9rem; margin-top: 10px; }

/* ---------- bars (progress) ---------- */
.bar-row { display: grid; grid-template-columns: 90px 1fr 60px; align-items: center; gap: 10px; margin-bottom: 9px; }
.bar-row__label { font-size: 0.88rem; color: var(--muted); }
.bar-track { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--frost); }
.bar-row__num { font-size: 0.85rem; color: var(--text); text-align: right; font-weight: 600; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 12px; }
.week__day { text-align: center; }
.week__bar { height: 46px; display: flex; align-items: flex-end; justify-content: center; }
.week__fill { width: 70%; border-radius: 6px 6px 0 0; background: var(--frost); min-height: 2px; }
.week__label { font-size: 0.7rem; color: var(--muted); margin-top: 4px; }

/* ---------- leaderboard ---------- */
.league { list-style: none; }
.league li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.league li:last-child { border-bottom: none; }
.league__rank { width: 26px; font-weight: 800; color: var(--muted); }
.league__flag { font-size: 1.1rem; }
.league__name { flex: 1; font-weight: 600; }
.league__xp { color: var(--muted); font-size: 0.88rem; }
.league li.me { color: var(--frost); }

/* ---------- feedback ---------- */
.fb-stars { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.fb-star {
  font: inherit; font-size: 2rem; line-height: 1; cursor: pointer;
  color: rgba(255, 255, 255, 0.22); background: none; border: none; padding: 2px 4px;
  transition: color 0.15s ease, transform 0.15s ease;
}
.fb-star:hover { transform: scale(1.12); }
.fb-star.is-on { color: var(--amber); }
.fb-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fb-chip {
  font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  color: var(--muted); background: rgba(11, 30, 51, 0.45);
  border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.fb-chip:hover { color: var(--frost); border-color: rgba(127, 209, 232, 0.5); }
.fb-chip.is-active { color: var(--bg-deep); background: var(--frost); border-color: var(--frost); }
.field textarea {
  width: 100%; font: inherit; font-size: 0.98rem; color: var(--text);
  background: rgba(11, 30, 51, 0.45); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; outline: none; box-sizing: border-box;
  resize: vertical;
}
.field textarea:focus { border-color: var(--frost); }
.subject--wide { grid-column: 1 / -1; }

/* ---------- misc ---------- */
.center { text-align: center; }
.spacer { height: 14px; }
.quick { text-align: center; }
.quick .btn { font-size: 1.05rem; padding: 15px 34px; }
