/* CRY SPACE — ввод 6-значного кода из письма (регистрация, смена пароля). Релиз 5.4.
   Подключается только на страницах reg_code.tpl и reset_code.tpl. Переменные --hp-* — из cry-home-prime.css. */

html[data-home-prime] .cry-otp-panel { text-align: left; }
html[data-home-prime] .cry-otp-panel h1 { margin-bottom: 14px; }
html[data-home-prime] .cry-otp-badge {
  width: 58px; height: 58px; margin: 0 0 16px; border-radius: 18px; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, rgba(91, 230, 255, .28), rgba(160, 123, 255, .14) 70%);
  border: 1px solid rgba(91, 230, 255, .35); box-shadow: 0 0 28px -6px rgba(91, 230, 255, .55), inset 0 1px 0 rgba(255, 255, 255, .12);
  color: var(--hp-cyan);
}
html[data-home-prime] .cry-otp-badge svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Сообщения над формой */
html[data-home-prime] .cry-otp-msg { margin: 0 0 16px; padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
html[data-home-prime] .cry-otp-msg-ok { background: rgba(69, 240, 177, .08); border: 1px solid rgba(69, 240, 177, .38); color: #c9fbe8; }
html[data-home-prime] .cry-otp-msg-err { background: rgba(255, 107, 136, .08); border: 1px solid rgba(255, 107, 136, .42); color: #ffd2db; }
html[data-home-prime] .cry-otp-to { margin: 0; color: var(--hp-soft); font-size: 14.5px; overflow-wrap: anywhere; }
html[data-home-prime] .cry-otp-to b { color: var(--hp-ink); }

/* Шесть ячеек */
html[data-home-prime] .cry-otp { display: grid; gap: 10px; margin: 4px 0 2px; }
html[data-home-prime] .cry-otp-label { font: 700 12px/1.2 var(--hp-font); letter-spacing: .12em; text-transform: uppercase; color: var(--hp-muted); }
html[data-home-prime] .cry-otp-cells {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 14px repeat(3, minmax(0, 1fr));
  gap: 8px; align-items: center; max-width: 420px;
}
html[data-home-prime] .cry-otp-dash { display: block; height: 3px; border-radius: 3px; background: var(--hp-line-2); }
html[data-home-prime] .cry-otp-cells input.cry-otp-cell {
  width: 100%; min-width: 0; height: auto; aspect-ratio: 4 / 5; min-height: 0; max-height: 72px; padding: 0; margin: 0;
  border-radius: 14px; border: 1px solid var(--hp-line-2);
  background: linear-gradient(180deg, rgba(14, 22, 50, .9), rgba(3, 6, 16, .78));
  color: var(--hp-ink); caret-color: var(--hp-cyan); text-align: center;
  font: 800 clamp(22px, 6vw, 32px)/1 var(--hp-display); letter-spacing: 0; font-variant-numeric: tabular-nums;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .04);
  transition: border-color .2s, box-shadow .25s, background .25s, transform .2s var(--hp-ease);
  -webkit-appearance: none; appearance: none;
}
html[data-home-prime] .cry-otp-cells input.cry-otp-cell:focus {
  outline: none; border-color: rgba(91, 230, 255, .85); transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(20, 34, 72, .95), rgba(6, 12, 30, .85));
  box-shadow: 0 0 0 4px rgba(91, 230, 255, .14), 0 10px 26px -10px rgba(91, 230, 255, .6), inset 0 2px 10px rgba(0, 0, 0, .5);
}
html[data-home-prime] .cry-otp-cells input.cry-otp-cell.is-filled {
  border-color: rgba(160, 123, 255, .7);
  background: linear-gradient(180deg, rgba(40, 34, 92, .9), rgba(10, 10, 34, .82));
  text-shadow: 0 0 14px rgba(91, 230, 255, .55);
}
html[data-home-prime] .cry-otp.is-complete input.cry-otp-cell { border-color: rgba(69, 240, 177, .75); box-shadow: 0 0 18px -6px rgba(69, 240, 177, .7), inset 0 2px 10px rgba(0, 0, 0, .5); }
html[data-home-prime] .cry-otp.cry-otp-has-error input.cry-otp-cell { border-color: rgba(255, 107, 136, .6); }
html[data-home-prime] .cry-otp.cry-otp-has-error .cry-otp-cells { animation: cry-otp-shake .45s ease 1; }
@keyframes cry-otp-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* Повторная отправка и подсказки */
html[data-home-prime] .cry-otp-resend { margin: 14px 0 0; display: block; }
html[data-home-prime] .cry-otp-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--hp-line-2); background: rgba(20, 28, 60, .45); color: var(--hp-cyan);
  font: 700 14px/1 var(--hp-font); cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
html[data-home-prime] .cry-otp-link:hover:not(:disabled) { background: rgba(91, 230, 255, .1); border-color: rgba(91, 230, 255, .5); color: #fff; }
html[data-home-prime] .cry-otp-link:disabled { color: var(--hp-dim); cursor: default; }
html[data-home-prime] .cry-otp-help { margin: 14px 0 10px; font-size: 13px; line-height: 1.55; color: var(--hp-muted); }
html[data-home-prime] .cry-otp-panel .ui-forgot { display: inline-block; margin-top: 4px; }
html[data-home-prime] .ui-auth-panel form .ui-forgot { display: block; text-align: center; }

@media (max-width: 420px) {
  html[data-home-prime] .cry-otp-cells { gap: 6px; grid-template-columns: repeat(3, minmax(0, 1fr)) 8px repeat(3, minmax(0, 1fr)); }
  html[data-home-prime] .cry-otp-cells input.cry-otp-cell { border-radius: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-home-prime] .cry-otp.cry-otp-has-error .cry-otp-cells { animation: none; }
  html[data-home-prime] .cry-otp-cells input.cry-otp-cell { transition: none; }
}
