/* ============================================================
   Weatmood — окно авторизации: шаги, код из 6 ячеек, соглашение.
   Добавляется поверх базовых стилей, ничего не ломает.
   ============================================================ */

/* --- Шаги внутри карточки --- */
.auth__step {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.auth__step.is-hidden {
  display: none;
}

.auth__headline {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.02em;
  text-align: center;
  color: var(--text);
}

.auth__sub {
  margin: -6px 0 4px;
  font-size: 13.5px;
  line-height: 1.5;
  text-align: center;
  color: var(--text-dim);
}

.auth__sub b {
  color: var(--text);
  font-weight: 600;
}

/* --- Кнопки-провайдеры --- */
.auth__provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}

.auth__provider:hover {
  background: #262625;
  border-color: rgba(255, 255, 255, .16);
}

.auth__provider:active {
  transform: translateY(1px);
}

.auth__provider--mail:hover svg {
  color: var(--text);
}

.auth__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-faint);
  font-size: 12.5px;
  margin: 2px 0;
}

.auth__divider::before,
.auth__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* --- Кнопка «назад» --- */
.auth__back {
  position: absolute;
  top: -4px;
  left: -2px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.auth__back:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.auth__back svg {
  width: 19px;
  height: 19px;
}

/* ============================================================
   Код из 6 прямоугольных ячеек
   ============================================================ */
.code-input {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 9px;
  margin: 6px 0 2px;
}

.code-input__cell {
  width: 100%;
  aspect-ratio: 1 / 1.25;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  color: var(--text);
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  outline: none;
  transition: border-color .18s ease, background .3s ease, color .3s ease,
              box-shadow .3s ease, transform .1s ease;
}

.code-input__cell:focus {
  border-color: rgba(255, 255, 255, .42);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .07);
}

/* Заполненная ячейка */
.code-input__cell.is-filled {
  border-color: rgba(255, 255, 255, .28);
}

/* --- УСПЕХ: плавное зелёное свечение --- */
.code-input.is-success .code-input__cell {
  border-color: rgba(52, 199, 123, .85);
  background: rgba(52, 199, 123, .13);
  color: #6ee7a8;
  box-shadow: 0 0 0 3px rgba(52, 199, 123, .12), 0 0 18px rgba(52, 199, 123, .22);
}

/* --- ОШИБКА: красное + тряска --- */
.code-input.is-error .code-input__cell {
  border-color: rgba(255, 86, 86, .9);
  background: rgba(255, 86, 86, .12);
  color: #ff8f8f;
  box-shadow: 0 0 0 3px rgba(255, 86, 86, .12);
}

.code-input.is-error {
  animation: codeShake .42s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes codeShake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

/* Мягкое «дыхание» успеха перед переходом */
.code-input.is-success .code-input__cell {
  animation: codeGlow .5s ease both;
}

@keyframes codeGlow {
  from { transform: scale(1); }
  50%  { transform: scale(1.06); }
  to   { transform: scale(1); }
}

/* --- Повторная отправка --- */
.auth__resend {
  margin: 2px 0 0;
  font-size: 13px;
  text-align: center;
  color: var(--text-faint);
}

.auth__resend b {
  color: var(--text-dim);
  font-weight: 600;
}

.auth__resend.is-ready {
  color: var(--text-dim);
}

.auth__resend .auth__link {
  font-size: 13px;
}

/* ============================================================
   Соглашение
   ============================================================ */
.terms__box {
  max-height: 190px;
  overflow-y: auto;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .16) transparent;
}

.terms__box::-webkit-scrollbar { width: 5px; }
.terms__box::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .16);
  border-radius: 5px;
}

.terms__box h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.terms__box p {
  margin: 0 0 8px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-dim);
}

.terms__box p:last-child { margin-bottom: 0; }

.terms__box b { color: var(--text); font-weight: 600; }

.terms__check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.terms__check input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: #34c77b;
  cursor: pointer;
}

.btn-primary:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* --- Светлая тема --- */
html[data-theme="light"] .auth__provider {
  background: #fff;
}

html[data-theme="light"] .auth__provider:hover {
  background: #f4f4f6;
}

html[data-theme="light"] .code-input__cell {
  background: #fff;
}

html[data-theme="light"] .terms__box {
  background: #fff;
}
