/* auth.css — вынесен из auth-history.css */
/* styles/auth-history.css — split from styles.css (structural only) */

/* --- Auth / History panels (URL routing + persistence) --- */
.panel-screen {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 0.35rem 1rem 2.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-screen .subtitle,
.history-screen .subtitle {
  text-align: center;
  margin: 0;
}

.auth-form,
.auth-actions,
.history-actions,
.daily-result-actions,
.result-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* full-width auth/history/daily: morph + силуэтный ореол (btn-shell-stretch), не прямоугольный halo */
.auth-actions .btn-shell-stretch,
.history-actions .btn-shell-stretch,
.daily-result-actions .btn-shell-stretch,
.result-actions .btn-shell-stretch {
  display: flex;
  width: 100%;
  overflow: visible;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.auth-field-label {
  font-size: 0.85rem;
  opacity: 0.82;
}

.auth-input-row {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
}

.auth-input-row .auth-input {
  flex: 1 1 auto;
  min-width: 0;
}

.auth-input {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--cyan) 35%, transparent);
  background: color-mix(in srgb, var(--bg-soft) 78%, transparent);
  color: inherit;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font: inherit;
}

.auth-input:focus {
  outline: 2px solid color-mix(in srgb, var(--cyan) 55%, transparent);
  outline-offset: 1px;
}

.auth-login-check-btn {
  appearance: none;
  flex: 0 0 auto;
  width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--cyan) 40%, transparent);
  background: color-mix(in srgb, var(--bg-soft) 82%, transparent);
  color: color-mix(in srgb, var(--cyan) 88%, #fff 12%);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 160ms ease;
}

.auth-password-toggle-btn {
  appearance: none;
  flex: 0 0 auto;
  width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--cyan) 40%, transparent);
  background: color-mix(in srgb, var(--bg-soft) 82%, transparent);
  color: color-mix(in srgb, var(--cyan) 88%, #fff 12%);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 160ms ease;
}

.auth-login-check-btn:hover,
.auth-login-check-btn:focus-visible,
.auth-password-toggle-btn:hover,
.auth-password-toggle-btn:focus-visible {
  border-color: color-mix(in srgb, var(--cyan) 70%, transparent);
  background: color-mix(in srgb, var(--cyan) 16%, var(--bg-soft));
  outline: none;
}

.auth-login-check-btn:active,
.auth-password-toggle-btn:active {
  transform: translateY(1px);
}

.auth-login-check-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.auth-login-check-icon,
.auth-password-toggle-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.auth-password-toggle-btn[aria-pressed="true"] {
  color: color-mix(in srgb, var(--cyan) 70%, #fff 30%);
  border-color: color-mix(in srgb, var(--cyan) 58%, transparent);
}

.auth-checklist {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0.35rem 0.55rem;
  display: grid;
  gap: 0.2rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-soft) 55%, transparent);
  border: 1px solid color-mix(in srgb, var(--cyan) 16%, transparent);
}

/* display:grid иначе перебивает [hidden] — чеклист виден до ввода */
.auth-checklist[hidden] {
  display: none !important;
}

.auth-checklist-item {
  position: relative;
  padding-left: 1.15rem;
  font-size: 0.8rem;
  line-height: 1.35;
  opacity: 0.88;
}

.auth-checklist-item::before {
  content: "○";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 0.78rem;
}

.auth-checklist-item.is-ok {
  color: color-mix(in srgb, #8dffb5 78%, #fff 22%);
}

.auth-checklist-item.is-ok::before {
  content: "✓";
}

.auth-checklist-item.is-bad {
  color: color-mix(in srgb, #ffb0bc 72%, #fff 28%);
}

.auth-checklist-item.is-bad::before {
  content: "×";
}

.auth-login-status {
  margin: 0.1rem 0 0;
  font-size: 0.84rem;
  line-height: 1.35;
}

.auth-login-status.is-ok {
  color: color-mix(in srgb, #8dffb5 78%, #fff 22%);
}

.auth-login-status.is-bad {
  color: #ff8f9f;
}

.auth-login-status.is-pending {
  opacity: 0.78;
}

.auth-error {
  color: #ff8f9f;
  margin: 0;
  font-size: 0.92rem;
}

.auth-session-note {
  opacity: 0.8;
  margin: 0;
}

/* Auth brand: «Чертог» | ворон | «Ворона»; крупная типографика. */
.app-shell[data-stage="auth-login"],
.app-shell[data-stage="auth-register"] {
  padding-top: calc(28px + env(safe-area-inset-top, 0px));
}

.app-shell[data-stage="auth-login"] > .top-bar.top-bar-auth-brand,
.app-shell[data-stage="auth-register"] > .top-bar.top-bar-auth-brand {
  position: relative;
  display: block;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-height: clamp(210px, 32vw, 300px);
  margin: 0 0 0.65rem;
  padding: 18px 0 10px;
  box-sizing: border-box;
  overflow: visible;
}

.app-shell[data-stage="auth-login"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth,
.app-shell[data-stage="auth-register"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth {
  --raven-w: clamp(220px, 32vw, 340px);
  --raven-h: clamp(145px, 21vw, 220px);
  --brand-gap: clamp(8px, 1.6vw, 24px);
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  grid-column: 1 / -1;
  justify-self: stretch;
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}

.app-shell[data-stage="auth-login"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth > .top-bar-auth-raven-stack,
.app-shell[data-stage="auth-register"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth > .top-bar-auth-raven-stack {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  z-index: 3;
  pointer-events: none;
}

.app-shell[data-stage="auth-login"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth .top-bar-raven,
.app-shell[data-stage="auth-register"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth .top-bar-raven {
  position: relative;
  left: auto;
  top: auto;
  width: var(--raven-w);
  height: var(--raven-h);
  margin: 0;
  transform: none;
  pointer-events: auto;
}

.app-shell[data-stage="auth-login"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth > .top-bar-title-wrap:first-child,
.app-shell[data-stage="auth-register"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth > .top-bar-title-wrap:first-child {
  position: absolute;
  top: 50%;
  right: calc(50% + (var(--raven-w) / 2) + var(--brand-gap));
  left: auto;
  transform: translateY(-50%);
  display: grid;
  width: max-content;
  max-width: min(40vw, 360px);
  padding: 8px 10px 14px;
  justify-items: end;
  box-sizing: border-box;
  overflow: visible;
}

.app-shell[data-stage="auth-login"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth > .top-bar-title-wrap:last-of-type,
.app-shell[data-stage="auth-register"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth > .top-bar-title-wrap:last-of-type {
  position: absolute;
  top: 50%;
  left: calc(50% + (var(--raven-w) / 2) + var(--brand-gap));
  right: auto;
  transform: translateY(-50%);
  display: grid;
  width: max-content;
  max-width: min(40vw, 360px);
  padding: 8px 10px 14px;
  justify-items: start;
  box-sizing: border-box;
  overflow: visible;
}

.app-shell[data-stage="auth-login"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth .top-bar-app-title,
.app-shell[data-stage="auth-login"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth .top-bar-path-title,
.app-shell[data-stage="auth-register"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth .top-bar-app-title,
.app-shell[data-stage="auth-register"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth .top-bar-path-title {
  max-width: 100%;
  font-size: clamp(2.4rem, 6.5vw, 4.4rem);
  white-space: nowrap;
  overflow: visible;
  animation: modeTitleLevitate 5.8s ease-in-out infinite;
  line-height: 1.05;
  text-shadow:
    0 0 10px rgba(210, 180, 255, 0.55),
    0 0 22px rgba(150, 210, 255, 0.4),
    0 0 36px rgba(174, 132, 255, 0.32),
    0 6px 18px rgba(8, 6, 24, 0.45);
}

.app-shell[data-stage="auth-login"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth .top-bar-app-title,
.app-shell[data-stage="auth-register"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth .top-bar-app-title {
  text-align: right;
  justify-self: end;
}

.app-shell[data-stage="auth-login"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth .top-bar-path-title,
.app-shell[data-stage="auth-register"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth .top-bar-path-title {
  text-align: left;
  justify-self: start;
}

.app-shell[data-stage="auth-login"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth .top-bar-title-wrap::before,
.app-shell[data-stage="auth-register"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth .top-bar-title-wrap::before {
  left: 6%;
  right: 6%;
  bottom: 4px;
  height: 28px;
  filter: blur(14px);
  opacity: 0.78;
  pointer-events: none;
}

.app-shell[data-stage="auth-login"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth .top-bar-title-sparks,
.app-shell[data-stage="auth-register"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth .top-bar-title-sparks {
  position: absolute;
  inset: auto 4% 2px 4%;
  height: 34px;
  overflow: visible;
  z-index: 2;
  pointer-events: none;
}

@media (max-width: 760px) {
  .app-shell[data-stage="auth-login"] > .top-bar.top-bar-auth-brand,
  .app-shell[data-stage="auth-register"] > .top-bar.top-bar-auth-brand {
    min-height: calc(28px + 210px);
    padding: 14px 0 8px;
  }

  .app-shell[data-stage="auth-login"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth,
  .app-shell[data-stage="auth-register"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth {
    --raven-w: clamp(180px, 46vw, 240px);
    --raven-h: clamp(118px, 30vw, 158px);
    --brand-gap: clamp(4px, 1.4vw, 12px);
    --brand-side: max(8px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  }

  .app-shell[data-stage="auth-login"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth > .top-bar-title-wrap:first-child,
  .app-shell[data-stage="auth-login"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth > .top-bar-title-wrap:last-of-type,
  .app-shell[data-stage="auth-register"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth > .top-bar-title-wrap:first-child,
  .app-shell[data-stage="auth-register"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth > .top-bar-title-wrap:last-of-type {
    max-width: calc(50% - (var(--raven-w) / 2) - var(--brand-gap) - var(--brand-side));
    padding: 4px 2px 10px;
  }

  .app-shell[data-stage="auth-login"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth .top-bar-app-title,
  .app-shell[data-stage="auth-login"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth .top-bar-path-title,
  .app-shell[data-stage="auth-register"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth .top-bar-app-title,
  .app-shell[data-stage="auth-register"] > .top-bar.top-bar-auth-brand > .top-bar-brand-auth .top-bar-path-title {
    font-size: clamp(1.55rem, 8.2vw, 2.35rem);
  }
}

