/* Личный кабинет ученика. Открывается с телефона, поэтому всё в одну
   колонку, крупно и пальцем попадается. Палитра та же, что в админке:
   светло-синий, белый, пастельно-розовый. */

:root {
  --blue: #0EA5E9;
  --blue-dark: #0369A1;
  --blue-soft: #E0F2FE;
  --pink: #F472B6;
  --pink-soft: #FCE7F3;
  --ink: #0F172A;
  --muted: #64748B;
  --line: #E2E8F0;
  --card-shadow: 0 6px 20px rgba(2, 132, 199, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #F0F9FF;
  color: var(--ink);
  font: 16px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: 40px;
}

.wrap { max-width: 620px; margin: 0 auto; padding: 0 14px; }

/* --- шапка ------------------------------------------------------------------ */

.top {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 14px 0 0;
  position: sticky;
  top: 0;
  z-index: 5;
}

.top-row { display: flex; align-items: center; gap: 10px; }
.top-name { font-size: 18px; font-weight: 600; }
.top-row .spacer { margin-left: auto; }

.exit {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.exit:hover { color: var(--blue-dark); }

.tabs { display: flex; gap: 4px; margin-top: 12px; }

.tabs a {
  padding: 9px 14px;
  border-radius: 10px 10px 0 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  transition: background .15s ease, color .15s ease;
}

.tabs a:hover { background: #F0F9FF; color: var(--blue-dark); }
.tabs a.now { background: #F0F9FF; color: var(--blue-dark); font-weight: 600; }

/* --- плашки ------------------------------------------------------------------
   Форма одна на всю платформу: слегка закруглённый прямоугольник,
   обычный текст 13px, пастельная заливка. */

.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
  transition: transform .13s ease;
}

a > .tag:hover { transform: scale(1.05); }
.tag-quiet { background: #F1F5F9; color: #475569; }

/* --- карточки ---------------------------------------------------------------- */

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-top: 12px;
  box-shadow: var(--card-shadow);
  transition: box-shadow .18s ease, transform .18s ease;
}

.card:hover { box-shadow: 0 10px 26px rgba(2, 132, 199, .13); }

.card h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--blue-dark);
  border-left: 3px solid var(--pink-soft);
  padding-left: 10px;
}

.hint { color: var(--muted); font-size: 14px; }
.right { margin-left: auto; }

/* --- четыре крупных числа ---------------------------------------------------- */

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }

.tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  text-align: center;
  box-shadow: var(--card-shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}

.tile:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(2, 132, 199, .13); }
.tile b { display: block; font-size: 28px; line-height: 1.1; color: var(--blue-dark); }
.tile span { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }

@media (min-width: 560px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
}

/* --- карта уровней ----------------------------------------------------------- */

.road { display: flex; align-items: flex-start; gap: 2px; margin: 4px 0 14px; }

.step { flex: 1; text-align: center; position: relative; }

.step .dot {
  width: 16px; height: 16px; margin: 0 auto 6px;
  border-radius: 50%;
  background: #F1F5F9;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}

.step.done .dot { background: var(--blue); box-shadow: 0 0 0 1px var(--blue); }

.step.now .dot {
  width: 24px; height: 24px; margin-top: -4px;
  background: var(--pink);
  box-shadow: 0 0 0 4px var(--pink-soft);
}

/* линия между точками */
.step::before {
  content: '';
  position: absolute;
  top: 8px; left: -50%; width: 100%; height: 2px;
  background: var(--line);
  z-index: -1;
}

.step:first-child::before { display: none; }
.step.done::before, .step.now::before { background: #7DD3FC; }
.step small { font-size: 11px; color: var(--muted); display: block; }
.step.now small { color: var(--ink); font-weight: 600; }

.bar-line { height: 10px; background: #F1F5F9; border-radius: 6px; overflow: hidden; }
.bar-line i { display: block; height: 100%; background: linear-gradient(90deg, #7DD3FC, var(--blue)); border-radius: 6px; }

/* --- столбики часов ---------------------------------------------------------- */

.bars { display: flex; align-items: flex-end; gap: 6px; height: 130px; }
.bars .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; text-align: center; }

.bars .col i {
  display: block;
  background: linear-gradient(180deg, #7DD3FC, var(--blue));
  border-radius: 6px 6px 0 0;
  min-height: 2px;
  transition: filter .15s ease;
}

.bars .col:hover i { filter: brightness(1.08); }
.bars .col b { font-size: 12px; color: var(--blue-dark); font-weight: 600; }
.bars .col small { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* --- кривая мини-тестов ------------------------------------------------------- */

.curve { position: relative; height: 120px; margin-bottom: 8px; }
.curve svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.curve-dot {
  position: absolute;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--pink);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--pink-soft);
}

/* --- посещаемость значками --------------------------------------------------- */

.marks { display: flex; gap: 6px; flex-wrap: wrap; }

.marks span {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px;
  font-weight: 700; font-size: 14px;
}

/* --- списки ------------------------------------------------------------------ */

.rows { display: flex; flex-direction: column; }

.row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 6px;
  border-bottom: 1px solid #F1F5F9;
  transition: background .13s ease;
}

.row:last-child { border-bottom: 0; }
.row:hover { background: #F0F9FF; }
.row .when { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* --- кнопки и поля ----------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 16px;
  border: 0; border-radius: 12px;
  background: var(--blue); color: #fff;
  font-size: 15px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: transform .13s ease, filter .13s ease;
}

.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-quiet { background: #F1F5F9; color: #475569; }
.btn-pink { background: var(--pink); }
.btn-wide { width: 100%; }

input[type=text], input[type=email], input[type=password], input[type=tel], textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

input:focus, textarea:focus { outline: 2px solid #BAE6FD; border-color: #7DD3FC; }
textarea { min-height: 84px; resize: vertical; }
.note { color: var(--muted); font-size: 13px; margin-top: 8px; }

.flash {
  background: #DCFCE7; color: #15803D;
  border-radius: 12px; padding: 10px 14px; margin-top: 12px; font-size: 14px;
}

/* --- карточки слов ----------------------------------------------------------- */

.flash-card {
  background: #fff; border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--card-shadow);
  padding: 34px 20px; text-align: center; margin-top: 12px;
  cursor: pointer; user-select: none;
}

.flash-card .heb { font-size: 42px; font-weight: 700; direction: rtl; }
.flash-card .tr { color: var(--muted); margin-top: 6px; font-size: 15px; }
.flash-card .ru { font-size: 22px; color: var(--blue-dark); margin-top: 14px; }
.flash-card .turn { color: var(--muted); font-size: 13px; margin-top: 14px; }
.deck-buttons { display: flex; gap: 10px; margin-top: 12px; }
.deck-buttons .btn { flex: 1; }

/* --- тест -------------------------------------------------------------------- */

.question { margin-bottom: 18px; }
.question p { font-weight: 600; margin: 0 0 8px; }
.answer { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; cursor: pointer; transition: all .13s ease; }
.answer:hover { border-color: #7DD3FC; background: #F0F9FF; }
.answer input { margin-right: 8px; }

/* --- страничка «Мой иврит» и бумаги ------------------------------------------ */

.share-card { text-align: center; padding: 26px 18px; }
.share-card .big { font-size: 44px; font-weight: 700; color: var(--blue-dark); line-height: 1.1; }
.share-card .who { font-size: 20px; font-weight: 600; margin-bottom: 4px; }

.paper {
  background: #fff; max-width: 700px; margin: 24px auto; padding: 40px;
  border: 1px solid var(--line); border-radius: 16px;
}

.paper h1 { font-size: 22px; margin: 0 0 4px; }
.paper .lead { color: var(--muted); margin: 0 0 24px; }
.paper table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.paper td { padding: 9px 0; border-bottom: 1px solid #F1F5F9; }
.paper td:last-child { text-align: right; font-weight: 600; }
.paper .sign { margin-top: 30px; color: var(--muted); font-size: 13px; }

@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .paper { border: 0; box-shadow: none; margin: 0; padding: 0; max-width: none; }
}


/* --- Публичная часть: витрина школы и правовые страницы ---------------------
   Тот же язык, что и в кабинете: пастель, скруглённые карточки, подъём
   под курсором. Открывается с телефона, поэтому одна колонка. */

.site-top {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 5;
}

.site-top-row { display: flex; align-items: center; gap: 10px; }

.site-logo {
  font-size: 19px;
  font-weight: 700;
  color: var(--blue-dark);
  text-decoration: none;
  letter-spacing: .2px;
}

.hero { padding: 26px 0 6px; text-align: center; }

.hero h1 {
  font-size: 30px;
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--ink);
}

.hero-lead { color: var(--muted); margin: 0 auto 20px; max-width: 520px; }

.price-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  padding: 22px 18px;
  transition: box-shadow .15s ease, transform .15s ease;
}

.price-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(2, 132, 199, .13); }
.price-num { font-size: 38px; font-weight: 700; color: var(--blue-dark); line-height: 1.1; }
.price-num span { font-size: 17px; font-weight: 400; color: var(--muted); }
.price-note { color: var(--muted); margin: 6px 0 16px; }
.price-small { color: var(--muted); font-size: 13px; margin-top: 10px; }

.feature { padding: 10px 0; border-bottom: 1px solid #F1F5F9; }
.feature:last-child { border-bottom: 0; }
.feature b { display: block; margin-bottom: 2px; }
.feature span { color: var(--muted); font-size: 15px; }

.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 8px; }

.contacts-card .row { justify-content: space-between; }
.contacts-card .row span:first-child { color: var(--muted); }

/* правовые страницы: длинный текст, поэтому строка уже и воздуха больше */

.doc h1 { font-size: 24px; margin: 0 0 4px; }
.doc-lead { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.doc h2 { font-size: 16px; margin: 22px 0 6px; color: var(--blue-dark); }
.doc p, .doc li { line-height: 1.6; }
.doc ul { padding-left: 20px; margin: 6px 0; }
.doc li { margin-bottom: 5px; }
.doc-note { margin-top: 26px; color: var(--muted); font-size: 14px; }

/* подвал с контактами и документами — его ищет проверяющий из allpay */

.site-foot {
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding: 22px 0 34px;
  color: var(--muted);
  font-size: 14px;
}

.site-foot-cols { display: flex; flex-wrap: wrap; gap: 22px; }
.site-foot-cols > div { flex: 1 1 200px; }
.site-foot b { display: block; color: var(--ink); margin-bottom: 6px; }
.site-foot a { color: var(--blue-dark); text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.site-langs { margin-top: 4px; }

/* Логотип в шапке кабинета — ссылка на главную страницу школы */
.top-row .brand {
  font-size: 16px;
  font-weight: 600;
  color: var(--blue-dark);
  text-decoration: none;
  margin-right: 4px;
}

/* --- пройденные темы: плашки с обложками ---------------------------------- */

.topic-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.topic-tile {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--card-shadow);
  transition: transform .13s ease, box-shadow .13s ease;
}

.topic-tile:active { transform: scale(.98); }

.topic-pic {
  display: block;
  height: 110px;
  background: linear-gradient(140deg, var(--blue-soft), var(--pink-soft));
}

.topic-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }

.topic-body { display: block; padding: 10px 12px 12px; }
.topic-name { display: block; font-size: 16px; font-weight: 600; }
.topic-sub { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

/* --- два формата: телефон и компьютер -------------------------------------
   Кабинет рисовался под телефон — одна колонка, крупные кнопки. На большом
   экране такая колонка висит посреди пустоты, поэтому там карточки
   раскладываются в два столбца. Ничего не прячем: меняется только раскладка. */

@media (min-width: 860px) {
  .wrap { max-width: 980px; }

  /* главная страница: карточки в два столбца, широкие блоки во всю ширину */
  .page-main main.wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
  }

  .page-main main.wrap > * { margin-bottom: 0; }

  /* «Учёба сейчас», плитки с цифрами и карта уровней читаются во всю ширину */
  .page-main main.wrap > .card:first-of-type,
  .page-main main.wrap > .tiles { grid-column: 1 / -1; }

  .tiles { grid-template-columns: repeat(4, 1fr); }

  /* колода слов и мини-тест остаются одной колонкой по центру */
  .page-words main.wrap, .page-test main.wrap { max-width: 620px; }
}

/* На узком экране имя ученика длинное: даём строке шапки перенос,
   иначе оно наезжает на плашку уровня и кнопку выхода. */
@media (max-width: 480px) {
  .top-row { flex-wrap: wrap; gap: 6px 8px; }
  .top-name { font-size: 16px; }
  .top-row .exit { font-size: 13px; }

  /* вкладки не переносим на вторую строку, а прокручиваем вбок */
  .tabs { overflow-x: auto; }
  .tabs a { white-space: nowrap; }
}

/* --- пять способов учить слова -------------------------------------------
   Как в Квизлете: карточки, заучивание, письмо, поиск пар и тест. Слова
   одни и те же, меняется только способ спросить. */

.modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.mode {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: transform .13s ease, box-shadow .13s ease, border-color .13s ease;
}

.mode:hover { transform: translateY(-2px); box-shadow: var(--card-shadow); }
.mode.now { border-color: var(--pink); background: var(--pink-soft); }
.mode b { font-size: 15px; }
.mode span { font-size: 12px; color: var(--muted); }

.word-pic {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--pink);
  margin-bottom: 8px;
}

.ask-card { text-align: center; }
.ask-card .heb { font-size: 34px; }
.ask-card .tr { color: var(--blue-dark); font-style: italic; }

.write-field {
  width: 100%;
  height: 44px;
  margin-top: 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 17px;
  text-align: center;
}

.verdict { margin-top: 12px; font-size: 18px; font-weight: 600; }
.verdict.right { color: #15803D; }
.verdict.wrong { color: #9D174D; }

.options { display: grid; gap: 8px; margin-bottom: 16px; }

.option {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: transform .13s ease, box-shadow .13s ease;
}

.option:hover { transform: translateY(-1px); box-shadow: var(--card-shadow); }
.option.right { background: #DCFCE7; border-color: #86EFAC; }
.option.wrong { background: var(--pink-soft); border-color: var(--pink); }

.pairs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.pair {
  min-height: 64px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: transform .13s ease, background .13s ease;
}

.pair.heb-tile { font-size: 20px; direction: rtl; }
.pair.chosen { background: var(--blue-soft); border-color: #7DD3FC; }
.pair.gone { visibility: hidden; }
.pair:hover { transform: translateY(-2px); }
