/* ==========================================================================
   Домашка — стили сайта

   Оглавление:
   1. Токены (цвета, шрифты, радиусы) — меняйте дизайн здесь
   2. База
   3. Общие элементы: логотип, кнопки, поля
   4. Страница входа
   5. Кабинет: шапка, приветствие, вкладки
   6. Карточки заданий
   7. Пустые состояния и просмотр картинок
   8. Анимации
   9. Мобильная версия и доступность
   ========================================================================== */


/* 1. Токены ================================================================ */
:root {
  /* Основа */
  --paper: #F7F8FA;
  --surface: #FFFFFF;
  --surface-muted: #EEF1F5;
  --line: #E4E8EE;
  --ink: #1E2A4A;
  --ink-soft: #5B6784;

  /* Акценты */
  --blue: #2F5BEA;        /* главные действия */
  --blue-dark: #2347C4;
  --blue-soft: #EAF0FE;
  --mint: #16A571;        /* «сделано» */
  --red: #E5484D;         /* срок горит */

  /* Цвета предметов */
  --math: #2F5BEA;
  --physics: #7A5AF8;
  --informatics: #0E9F9E;

  /* Шрифты */
  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Golos Text", system-ui, sans-serif;

  /* Скругления: чем крупнее блок, тем больше радиус */
  --radius-s: 10px;
  --radius-m: 18px;
  --radius-l: 32px;

  --shadow: 0 1px 2px rgba(30, 42, 74, 0.04), 0 8px 24px -12px rgba(30, 42, 74, 0.12);

  /* Кривые движения */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
}


/* 2. База ================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid rgba(47, 91, 234, 0.45);
  outline-offset: 2px;
}


/* 3. Общие элементы ======================================================== */

/* Логотип */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.25s var(--ease-spring);
}

.brand:hover {
  transform: translateY(-1px);
}

/* Знак: скруглённый квадрат с монограммой */
.brand__mark {
  display: block;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.brand__mark svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(47, 91, 234, 0.28));
}

.brand__monogram {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.04em;
  fill: #fff;
}

.brand__dot {
  fill: #fff;
  opacity: 0.85;
}

/* Плитка чуть поворачивается при наведении */
.brand__tile {
  transform-origin: 20px 20px;
  transition: transform 0.35s var(--ease-spring);
}

.brand:hover .brand__tile {
  transform: rotate(-6deg);
}

/* Название */
.brand__name {
  display: inline-flex;
  align-items: baseline;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand__name-main {
  color: var(--ink);
}

.brand__name-sep {
  margin: 0 3px;
  color: var(--blue);
  opacity: 0.55;
}

.brand__name-edu {
  color: var(--blue);
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  font: 600 15px/1.2 var(--font-body);
  color: var(--ink);
  background: none;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  cursor: progress;
  opacity: 0.7;
}

.btn--primary {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 6px 16px -8px rgba(47, 91, 234, 0.6);
}

.btn--primary:hover {
  background: var(--blue-dark);
}

.btn--ghost {
  color: var(--ink-soft);
}

.btn--ghost:hover {
  color: var(--ink);
  background: rgba(30, 42, 74, 0.06);
}

.btn--wide {
  width: 100%;
  padding: 16px;
}

/* Поля ввода */
.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field__label {
  font-size: 14px;
  font-weight: 500;
}

.field__input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font: 16px var(--font-body);
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field__input:hover {
  border-color: #C5CFE0;
}

.field__input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 91, 234, 0.14);
}

.field__password {
  position: relative;
}

.field__password .field__input {
  padding-right: 54px;
}

.field__toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  transform: translateY(-50%);
}

.field__toggle:hover {
  background: rgba(30, 42, 74, 0.06);
}

.field__toggle[aria-pressed="true"] {
  color: var(--blue);
}

.field__toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.alert {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 15px;
  color: #B4232A;
  background: #FDECEC;
  animation: shake 0.45s var(--ease);
}


/* 4. Страница входа ======================================================== */
.login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 24px;
  min-height: 100vh;
  padding: 24px;
}

.login__form-side {
  display: flex;
  flex-direction: column;
  padding: 16px clamp(8px, 5vw, 80px);
}

.login__form-wrap {
  width: 100%;
  max-width: 380px;
  margin: auto 0;
  padding: 40px 0;
}

.login__title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.15;
}

.login__lead {
  margin: 0 0 32px;
  color: var(--ink-soft);
}

.login__art {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius-l);
  background: linear-gradient(160deg, #F1F5FF 0%, #E6EDFD 100%);
}

.board {
  width: min(86%, 520px);
  text-align: center;
}

/* График */
.graph {
  width: 100%;
  overflow: visible;
}

.graph__axis {
  fill: none;
  stroke: #9AA6C0;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.graph__curve {
  fill: none;
  stroke: var(--blue);
  stroke-width: 4;
  stroke-linecap: round;
}

.graph__root {
  fill: var(--mint);
  transform: scale(0);
  transform-box: fill-box;
  transform-origin: center;
  animation: pop 0.5s var(--ease-spring) forwards;
}

.graph__root--first  { animation-delay: 2.0s; }
.graph__root--second { animation-delay: 2.15s; }

.graph__label {
  font: 500 16px var(--font-body);
  fill: var(--ink-soft);
  opacity: 0;
  animation: fade-in 0.4s var(--ease) 2.3s forwards;
}

/* Линии «рисуются»: работает через pathLength="1" в SVG */
.draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 0.8s var(--ease) forwards;
}

.graph__curve.draw {
  animation-duration: 1.4s;
  animation-delay: 0.6s;
}

/* Формула — белый бейдж, появляется после графика */
.formula {
  display: inline-block;
  margin: 16px 0 0;
  padding: 10px 20px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(18px, 2.2vw, 24px);
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  animation: rise-in 0.5s var(--ease) 2.4s forwards;
}


/* 5. Кабинет ================================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 250, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar__actions form {
  margin: 0;
}

.page {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px clamp(16px, 4vw, 40px) 96px;
}

.hello__grade {
  display: inline-block;
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
}

.hello__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 5.5vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

/* Вкладки */
.tabs {
  position: relative;
  display: flex;
  width: fit-content;
  max-width: 100%;
  gap: 4px;
  margin: 32px 0 28px;
  padding: 4px;
  overflow-x: auto;
  border-radius: 14px;
  background: var(--surface-muted);
  scrollbar-width: none;
}

.tabs__marker {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(30, 42, 74, 0.12);
}

/* Плавное движение включает JavaScript после первой отрисовки,
   чтобы подложка не «прилетала» при загрузке страницы */
.tabs.is-ready .tabs__marker {
  transition: transform 0.35s var(--ease), width 0.35s var(--ease);
}

.tabs__button {
  position: relative;
  z-index: 1;
  padding: 10px 20px;
  border: 0;
  border-radius: 10px;
  font: 600 15px/1 var(--font-body);
  white-space: nowrap;
  color: var(--ink-soft);
  background: none;
  cursor: pointer;
  transition: color 0.2s;
}

.tabs__button:hover,
.tabs__button[aria-selected="true"] {
  color: var(--ink);
}

.panel:not([hidden]) {
  animation: panel-in 0.35s var(--ease);
}


/* 6. Карточки заданий ======================================================= */
.hw-section--done {
  margin-top: 48px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-weight: 600;
  font-size: 17px;
}

.count {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  font: 600 13px/1 var(--font-body);
  color: var(--ink-soft);
  background: var(--surface-muted);
}

.count--done {
  color: var(--mint);
  background: #E3F5EC;
}

.count.is-bumped {
  animation: bump 0.4s var(--ease-spring);
}

.empty-note {
  margin: 0;
  color: var(--ink-soft);
}

.hw-list {
  display: grid;
  gap: 12px;
}

.hw-card {
  --accent: var(--math);
  position: relative;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  box-shadow: var(--shadow);
  /* Единственная анимация при загрузке: карточки раскладываются по очереди */
  animation: card-in 0.55s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

.hw-card--physics     { --accent: var(--physics); }
.hw-card--informatics { --accent: var(--informatics); }

.hw-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.subject-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
}

/* Цветная точка — цвет предмета */
.subject-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, var(--math));
}

.due {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
}

.due--today,
.due--overdue {
  color: var(--red);
}

.due--tomorrow {
  color: #C2610C;
}

.hw-card__title {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 19px;
  line-height: 1.35;
}

.hw-card__text {
  max-width: 65ch;
  color: var(--ink-soft);
}

.hw-card__text p {
  margin: 0 0 8px;
}

.hw-card__kind {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--ink-soft);
}

/* Сетка картинок — на карточке и на странице задания */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.image-grid__item {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: zoom-in;
}

.image-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}

.image-grid__item:hover img {
  transform: scale(1.05);
}

.hw-card__actions {
  margin: 18px 0 0;
}

/* Кнопка «Отметить выполненным» с галочкой, которая дорисовывается */
.btn--complete {
  border-color: var(--line);
  background: var(--surface);
}

.btn--complete:hover {
  border-color: var(--mint);
}

.tick {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid #C5CFE0;
  border-radius: 50%;
  transition: background-color 0.25s, border-color 0.25s;
}

.tick svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.35s var(--ease) 0.1s;
}

/* Состояние «сделано» */
.hw-card.is-done {
  background: #FAFDFB;
  box-shadow: none;
}

.hw-card.is-done .hw-card__title {
  color: var(--ink-soft);
}

.hw-card.is-done .tick {
  border-color: var(--mint);
  background: var(--mint);
}

.hw-card.is-done .tick svg {
  stroke-dashoffset: 0;
}

.hw-card.is-leaving {
  animation: card-out 0.3s var(--ease) forwards;
}

/* Искры при выполнении задания (создаются в JavaScript) */
.spark {
  position: fixed;
  z-index: 100;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
}


/* 6б. Страница теста / задач ================================================ */
.task-head {
  margin-bottom: 28px;
}

.task-head__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--ink-soft);
}

.task-head__title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 4.5vw, 38px);
  line-height: 1.15;
}

.task-head__text {
  max-width: 65ch;
  color: var(--ink-soft);
}

.task-head__text p {
  margin: 0 0 8px;
}

/* Итоговый результат */
.score {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: card-in 0.5s var(--ease) both;
}

.score__label {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.score__value {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.2;
}

.score__bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

/* Полоска заполняется до процента правильных ответов */
.score__bar span {
  display: block;
  width: var(--score);
  height: 100%;
  border-radius: inherit;
  background: var(--mint);
  transform-origin: left;
  animation: grow 0.9s var(--ease) 0.2s both;
}

/* Список вопросов */
.questions {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.question {
  position: relative;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: card-in 0.5s var(--ease) both;
}

.question__head {
  display: flex;
  gap: 14px;
}

.question__number {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-weight: 600;
  font-size: 14px;
  color: var(--blue);
  background: var(--blue-soft);
}

.question.is-correct .question__number {
  color: var(--mint);
  background: #E3F5EC;
}

.question.is-wrong .question__number {
  color: var(--red);
  background: #FDECEC;
}

.question__content {
  flex: 1;
  min-width: 0;
  padding-top: 3px;
}

.question__text p {
  margin: 0 0 8px;
}

.question__image {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: zoom-in;
}

.question__image img {
  max-height: 360px;
}

.question__hint {
  margin: 12px 0 0 44px;
  font-size: 14px;
  color: var(--ink-soft);
}

.result-pill {
  position: absolute;
  top: 22px;
  right: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.is-correct .result-pill { color: var(--mint); background: #E3F5EC; }
.is-wrong .result-pill   { color: var(--red);  background: #FDECEC; }

.question:has(.result-pill) .question__content {
  padding-right: 80px;
}

/* Варианты ответа */
.options {
  display: grid;
  gap: 8px;
  margin: 14px 0 0 44px;
  padding: 0;
  list-style: none;
}

.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.2s, background-color 0.2s;
}

.option--input {
  cursor: pointer;
}

.option--input:hover {
  border-color: #C5CFE0;
}

/* Настоящий input прячем, рисуем свой кружок/квадрат */
.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option__mark {
  flex: none;
  width: 20px;
  height: 20px;
  border: 2px solid #C5CFE0;
  border-radius: 50%;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.option input[type="checkbox"] + .option__mark {
  border-radius: 6px;
}

.option input:checked + .option__mark {
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: inset 0 0 0 3px #fff;
}

.option:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.option:has(input:focus-visible) {
  outline: 3px solid rgba(47, 91, 234, 0.45);
  outline-offset: 2px;
}

.option__text {
  flex: 1;
}

.option__note {
  font-size: 13px;
  color: var(--ink-soft);
}

/* Варианты в разборе */
.option.is-right   { border-color: var(--mint); background: #F1FAF5; }
.option.is-mistake { border-color: var(--red);  background: #FEF5F5; }
.option.is-missed  { border-style: dashed; border-color: var(--mint); }

.option.is-right .option__mark   { border-color: var(--mint); background: var(--mint); box-shadow: inset 0 0 0 3px #fff; }
.option.is-mistake .option__mark { border-color: var(--red);  background: var(--red);  box-shadow: inset 0 0 0 3px #fff; }

.field--answer {
  max-width: 280px;
  margin: 14px 0 0 44px;
}

.given-answer {
  margin: 10px 0 0 44px;
  color: var(--ink-soft);
}

.solve-form__footer {
  max-width: 380px;
  margin: 28px auto 0;
  text-align: center;
}

.solve-form__note {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}


/* 7. Пустые состояния и просмотр картинок =================================== */
.empty {
  padding: 56px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  text-align: center;
  background: var(--surface);
}

.empty__art {
  width: 120px;
  margin: 0 auto 16px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty__art circle {
  fill: var(--blue-soft);
}

.empty__title {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 19px;
}

.empty__text {
  max-width: 42ch;
  margin: 0 auto;
  color: var(--ink-soft);
}

.lightbox {
  max-width: min(92vw, 1000px);
  padding: 0;
  border: 0;
  overflow: visible;
  background: transparent;
}

.lightbox[open] {
  animation: zoom-in 0.3s var(--ease-spring);
}

.lightbox::backdrop {
  background: rgba(30, 42, 74, 0.6);
  backdrop-filter: blur(4px);
}

.lightbox__image {
  max-height: 84vh;
  margin: 0 auto;
  border-radius: var(--radius-m);
  background: #fff;
}

.lightbox__caption {
  margin: 12px 0 0;
  text-align: center;
  color: #fff;
}

.lightbox__close {
  position: absolute;
  top: -14px;
  right: -14px;
  z-index: 1;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
}


/* 8. Анимации =============================================================== */
@keyframes draw     { to { stroke-dashoffset: 0; } }
@keyframes pop      { to { transform: scale(1); } }
@keyframes fade-in  { to { opacity: 1; } }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@keyframes card-out {
  to { opacity: 0; transform: scale(0.96); }
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

@keyframes grow {
  from { transform: scaleX(0); }
}

@keyframes bump {
  50% { transform: scale(1.25); }
}

@keyframes zoom-in {
  from { opacity: 0; transform: scale(0.94); }
}

@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}


/* 9. Мобильная версия и доступность ========================================= */
@media (max-width: 900px) {
  .login {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .login__art {
    order: -1;
    padding: 20px 0;
  }

  .board {
    width: min(78%, 360px);
  }

  .login__form-side {
    padding: 8px 8px 24px;
  }

  .login__form-side .brand {
    display: none;
  }

  .login__form-wrap {
    margin: 0 auto;
    padding: 24px 0 0;
  }
}

@media (max-width: 560px) {
  .page {
    padding-top: 28px;
  }

  .topbar .btn {
    padding: 10px 12px;
  }

  .tabs {
    width: 100%;
  }

  .tabs__button {
    flex: 1 1 auto;
    padding: 11px 12px;
    font-size: 13px;
  }

  .hw-card {
    padding: 18px;
  }

  .btn--complete,
  .hw-card__actions .btn--primary {
    width: 100%;
  }

  .score {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .question {
    padding: 18px;
  }

  .result-pill {
    top: 18px;
    right: 18px;
  }

  .options,
  .field--answer,
  .given-answer,
  .question__hint {
    margin-left: 0;
  }

  .field--answer {
    max-width: none;
  }
}

/* Если в системе включено «уменьшить движение» — отключаем анимации */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* 10. Страница политики обработки данных =================================== */
.page-legal {
  background: var(--paper);
}

.legal {
  padding: 40px 24px 80px;
}

.legal__inner {
  max-width: 720px;
  margin: 0 auto;
}

.legal__title {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.2;
  margin: 32px 0 8px;
  color: var(--ink);
}

.legal__date {
  color: var(--ink-soft);
  margin: 0 0 40px;
}

.legal__section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 24px 28px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.legal__section h2 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0 0 12px;
  color: var(--ink);
}

.legal__section p,
.legal__section li {
  color: var(--ink-soft);
  line-height: 1.65;
}

.legal__section p {
  margin: 0 0 12px;
}

.legal__section p:last-child,
.legal__section ul:last-child {
  margin-bottom: 0;
}

.legal__section ul {
  margin: 0 0 12px;
  padding-left: 22px;
}

.legal__section li {
  margin-bottom: 6px;
}

.legal__section strong {
  color: var(--ink);
  font-weight: 600;
}

.legal__back {
  margin-top: 32px;
  text-align: center;
}

.legal__back a,
.login__legal a {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease);
}

.legal__back a:hover,
.login__legal a:hover {
  border-bottom-color: var(--blue);
}

.login__legal {
  margin: 20px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}


/* 11. Отметка «вопрос уже встречался» ====================================== */
.question__seen {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 14px;
  background: var(--blue-soft);
  border-radius: var(--radius-s);
  color: var(--blue-dark);
  font-size: 14px;
  line-height: 1.5;
}

.question__seen::before {
  content: "↻";
  font-size: 16px;
  line-height: 1.3;
}


/* 12. Логотип на узких экранах ============================================= */
@media (max-width: 480px) {
  .brand__mark {
    width: 32px;
    height: 32px;
  }

  .brand__name {
    font-size: 17px;
  }
}
