/* Экраны. Размеры и цвета — из макета (390×844); всё, что не влезает в макет, тянется по высоте. */

/* ===================== Вход по коду ===================== */

.login {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: calc(var(--sat) + 48px) 28px 20px;
  overflow-y: auto;
}

.login__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
}

.login__logo {
  width: 76px;
  height: 76px;
  border-radius: 20px;
}

.login__title {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
}

.login__sub {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.login__sub b {
  color: var(--text-2);
  font-weight: 700;
}

.digits {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-bottom: 10px;
}

.digit {
  width: 44px;
  height: 54px;
  border-radius: 12px;
  background: var(--card);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  transition: border-color 0.12s ease;
}

.digit.is-active {
  border-color: var(--accent);
}

.digit.is-empty {
  background: transparent;
  border-style: dashed;
  color: var(--faint-2);
}

.digit.is-active.is-empty {
  border-style: solid;
}

.digits.is-error .digit {
  border-color: var(--red);
  animation: shake 0.35s ease;
}

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

/* Настоящее поле ввода лежит поверх ячеек: тап по ним вызывает цифровую клавиатуру */
.code-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 16px;
}

.login__hint {
  margin-bottom: 28px;
  text-align: center;
  font-size: 12px;
  color: var(--faint);
  min-height: 16px;
}

.login__hint.is-error {
  color: var(--red);
  font-weight: 600;
  line-height: 1.4;
}

.login__how {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 14px 0;
  padding: 14px 16px;
}

.login__how b {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
}

.login__how span {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.login__foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 18px;
  margin-top: auto;
  font-size: 11.5px;
  color: var(--faint);
  text-align: center;
}

/* Низкий экран — обычно это открытая клавиатура: убираем логотип и сжимаем отступы, чтобы поле ввода,
   подсказка/ошибка и кнопка «Войти» помещались над клавиатурой без прокрутки */
@media (max-height: 480px) {
  .login {
    padding-top: calc(var(--sat) + 14px);
  }

  .login__logo {
    display: none;
  }

  .login__head {
    margin-bottom: 16px;
  }

  .login__hint {
    margin-bottom: 14px;
  }
}

/* ===================== Загрузка при первом запуске ===================== */

.boot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px;
  text-align: center;
}

.boot__blocksi {
  width: 170px;
  animation: bob 2.4s ease-in-out infinite;
}

@keyframes bob {
  50% {
    transform: translateY(-8px);
  }
}

.boot__title {
  font-size: 17px;
  font-weight: 800;
}

.boot__text {
  max-width: 280px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.boot__bar {
  width: 200px;
}

/* ===================== Выбор канала уведомлений ===================== */

.choice {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: calc(var(--sat) + 28px) 20px 20px;
  overflow-y: auto;
}

.choice__blocksi {
  align-self: center;
  width: 108px;
  margin-bottom: 8px;
}

.choice__title {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
}

.choice__sub {
  margin: 8px 0 22px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.choice__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--card);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.option.is-active {
  border-color: var(--accent);
  background: rgba(255, 138, 61, 0.07);
}

.option__icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
}

.option.is-active .option__icon {
  background: var(--accent-soft);
  color: var(--accent);
}

.option__body b {
  display: block;
  font-size: 14.5px;
  font-weight: 800;
}

.option__body span {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--muted);
}

.option__radio {
  margin-left: auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--dot);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.option.is-active .option__radio {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}

.choice__note {
  margin: 18px 4px 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--faint);
  text-align: center;
}

.choice__foot {
  margin-top: auto;
  padding-top: 20px;
}

/* ===================== Карта модуля ===================== */

.map {
  padding: 0;
}

.map__header {
  flex-shrink: 0;
  padding: calc(var(--sat) + 18px) 20px 8px;
}

.map__toprow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.map__logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.map__kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--accent);
  text-transform: uppercase;
}

.map__title {
  margin-top: 2px;
  font-size: 22px;
  font-weight: 800;
}

.map__desc {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.map__dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 4px 0 2px;
  flex-shrink: 0;
}

.map__dots i {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--dot);
  transition: width 0.2s ease, background 0.2s ease;
}

.map__dots i.is-active {
  width: 18px;
  background: var(--accent);
}

.map__area {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.map__stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 390px;
  height: 560px;
  transform-origin: top left;
}

.map__path {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.node {
  all: unset;
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
  cursor: pointer;
}

.node__plate {
  height: 141px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.node__plate img {
  width: 110px;
  height: auto;
  display: block;
  -webkit-user-drag: none;
}

.node__num {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.node--dim {
  opacity: 0.6;
}

.node--dim .node__num {
  color: var(--dim);
  font-weight: 700;
}

.node--current .node__plate {
  animation: bob 2.6s ease-in-out infinite;
}

.node:active .node__plate {
  filter: brightness(1.12);
}

.map__hint {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--dim);
  opacity: 0.6;
  cursor: pointer;
}

.map__hint--up {
  flex-shrink: 0;
  padding-top: 4px;
}

.map__hint--down {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  flex-direction: column;
  font-size: 10.5px;
  font-weight: 700;
}

.map__quote {
  flex-shrink: 0;
  padding: 4px 30px 8px;
  text-align: center;
  font-size: 12px;
  font-style: italic;
  color: var(--faint);
}

/* ===================== Список модулей ===================== */

.modules__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mod {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border-radius: 16px;
  background: var(--card);
  border: 1.5px solid var(--border);
  cursor: pointer;
}

.mod.is-current {
  border-color: var(--accent);
}

.mod.is-locked {
  opacity: 0.55;
}

.mod__body {
  flex: 1;
  min-width: 0;
}

.mod__title {
  margin-top: 2px;
  font-size: 16px;
  font-weight: 800;
}

.mod__desc {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--muted);
}

.mod__progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}

.mod__badge {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.mod__badge.is-done {
  background: var(--green);
  color: var(--bg);
}
