/*
 * auth.css — стили страницы авторизации.
 *
 * Использует те же дизайн-токены, что и common.css:
 *   #0a0e14  background / surface
 *   #0f141a  surface-container-low
 *   #70b1ff  primary (action)
 *   #52ebae  secondary (positive / success)
 *   #ff7162  tertiary (negative / error)
 *   #a8abb3  on-surface-variant
 *   #44484f  outline-variant
 *   Inter    font
 *
 * Новые классы специфичны только для страницы входа и не конфликтуют
 * с остальными страницами приложения.
 */

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #0a0e14;
  color: #f1f3fc;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ── Фоновый радиальный градиент (тот же, что в stitch5) ─────────────── */
.auth-bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%,
      rgba(112, 177, 255, 0.04) 0%,
      transparent 65%);
  z-index: 0;
}

/* ── Движущийся scanline ──────────────────────────────────────────────── */
.auth-scanline {
  position: fixed;
  top: -100px;
  left: 0;
  width: 100%;
  height: 100px;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(112, 177, 255, 0.03) 50%,
    transparent 100%
  );
  animation: scanlineMove 7s linear infinite;
  z-index: 1;
  opacity: 0.35;
}

@keyframes scanlineMove {
  from { transform: translateY(0); }
  to   { transform: translateY(calc(100vh + 100px)); }
}

/* ── Центровка страницы ───────────────────────────────────────────────── */
.auth-main {
  position: relative;
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2;
}

/* ── Контейнер формы ──────────────────────────────────────────────────── */
.auth-container {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Анимация выхода при успехе ───────────────────────────────────────── */
.auth-exit {
  animation: authExit 0.7s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

@keyframes authExit {
  0%   { opacity: 1; transform: translateY(0); filter: brightness(1); }
  40%  { opacity: 1; transform: translateY(-4px); filter: brightness(1.15); }
  100% { opacity: 0; transform: translateY(-20px); filter: brightness(0.5); }
}

/* ── Строка статуса ───────────────────────────────────────────────────── */
.auth-statusbar {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fadeIn 0.4s ease 0.1s forwards;
}

.auth-status-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #70b1ff;
  white-space: nowrap;
  flex-shrink: 0;
}

.auth-status--ready {
  color: #70b1ff;
}

.auth-status--success {
  color: #52ebae !important;
}

.auth-divider {
  flex-grow: 1;
  height: 1px;
  background: #20262f;
}

.auth-status-right {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #44484f;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Boot-лог ─────────────────────────────────────────────────────────── */
.auth-boot {
  padding: 20px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  font-family: 'Inter', monospace;
  letter-spacing: 0.04em;
  color: #44484f;
}

.boot-line {
  display: flex;
  align-items: baseline;
  gap: 0;
  opacity: 1;
  line-height: 1.6;
}

.boot-line.hidden {
  display: none;
}

.boot-line.fade-in {
  animation: fadeIn 0.25s ease forwards;
}

.boot-key { color: #a8abb3; }
.boot-dots { color: #44484f; }
.boot-ok   { color: #52ebae; font-weight: 700; }
.boot-ok.hidden { display: none; }

/* ── Форма (скрытая до конца boot) ───────────────────────────────────── */
.auth-form-wrap {
  padding: 8px 0 0;
}

.auth-form-wrap.hidden {
  display: none;
}

.auth-form-wrap.form-enter {
  animation: formEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes formEnter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Строка ввода (стиль терминала) ───────────────────────────────────── */
.auth-prompt-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.auth-prompt-label {
  font-size: clamp(15px, 2.2vw, 20px);
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #f1f3fc;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}

.auth-input-wrap {
  position: relative;
  flex-grow: 1;
  display: flex;
  align-items: center;
}

.auth-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  font-family: inherit;
  font-size: clamp(15px, 2.2vw, 20px);
  font-weight: 700;
  color: #70b1ff;
  caret-color: transparent;   /* скрываем родной курсор */
  letter-spacing: 0.08em;
}

/* Псевдокурсор: absolute, всегда слева */
.auth-cursor {
  display: none;            /* управляется JS */
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 9px;
  height: 1.1em;
  background: #70b1ff;
  pointer-events: none;
  flex-shrink: 0;
}

.auth-cursor.blink {
  animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Курсор в boot-log — убран, строка оставлена для совместимости */

/* Встряска поля при ошибке */
.shake {
  animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-6px); }
  30% { transform: translateX(6px); }
  45% { transform: translateX(-5px); }
  60% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
  90% { transform: translateX(3px); }
}

/* ── Сообщение об ошибке / успехе ────────────────────────────────────── */
.auth-message {
  margin-top: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: 4px;
  animation: fadeIn 0.2s ease forwards;
}

.auth-message.hidden { display: none; }

.auth-message--error {
  color: #ff7162;
  background: rgba(255, 113, 98, 0.08);
  border-left: 2px solid #ff7162;
}

.auth-message--locked {
  color: #a8abb3;
  background: rgba(68, 72, 79, 0.15);
  border-left: 2px solid #44484f;
}

.auth-message--success {
  color: #52ebae;
  background: rgba(82, 235, 174, 0.08);
  border-left: 2px solid #52ebae;
}

/* ── Мета-строка (AES-256 / SHELL) ───────────────────────────────────── */
.auth-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 20px;
  color: #44484f;
}

.auth-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.auth-meta-badge {
  font-size: 13px;
  line-height: 1;
}

/* ── Декоративный нижний лог ─────────────────────────────────────────── */
.auth-log {
  margin-top: 8px;
  opacity: 0.08;
  pointer-events: none;
  user-select: none;
  font-size: 10px;
  font-family: 'Inter', monospace;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: #a8abb3;
}

/* ── Переиспользуемая анимация ──────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
