/* SignalDigest login — A Signal / B Card / C Rail / D Sheet */

.auth-body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-family);
  background: #07090c;
  color: #e8edf4;
}

.auth-device {
  min-height: 100vh;
}

html[data-device="phone"] .auth-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #12151a;
  padding: 20px 16px 108px;
}

html[data-device="phone"] .auth-device {
  width: 390px;
  height: min(844px, calc(100vh - 132px));
  min-height: 0;
  border-radius: 36px;
  border: 9px solid #252a32;
  overflow: hidden;
  background: #07090c;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.45);
}

html[data-device="phone"] .auth-shell {
  height: 100%;
  min-height: 100%;
  overflow: auto;
}

.auth-stage__mark svg,
.auth-card__mark {
  display: block;
  width: 100%;
  height: 100%;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.auth-field__label {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(214, 224, 234, 0.55);
}

.auth-field__input {
  width: 100%;
  box-sizing: border-box;
  height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: #f3f6fa;
  font: inherit;
  font-size: 1rem;
  outline: none;
}

.auth-field__input:focus-visible {
  border-color: #7eb6ff;
  box-shadow: 0 0 0 4px rgba(126, 182, 255, 0.16);
  background: rgba(126, 182, 255, 0.06);
}

.auth-form__submit {
  margin-top: 6px;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: #7eb6ff;
  color: #071018;
  font-weight: 700;
  box-shadow: none;
}

.auth-form__submit:hover {
  background: #c5d9ff;
  color: #071018;
}

.auth-card__error,
.auth-card__flash {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.86rem;
}

.auth-card__error {
  background: rgba(255, 69, 58, 0.14);
  color: #ff8a80;
}

.auth-stage__pulse-line {
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 920;
  stroke-dashoffset: 920;
  animation: auth-pulse-draw 2.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes auth-pulse-draw {
  to { stroke-dashoffset: 0; }
}

/* -------------------------------------------------------------------------- */
/* A · Сигнал                                                                 */
/* -------------------------------------------------------------------------- */

html[data-auth="signal"] .auth-shell {
  display: grid;
  grid-template-columns: minmax(240px, 1.05fr) minmax(280px, 0.95fr);
  min-height: 100vh;
}

html[data-auth="signal"] .auth-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 40px 44px 72px;
  overflow: hidden;
  background:
    radial-gradient(900px 480px at 80% -20%, rgba(10, 132, 255, 0.2), transparent 50%),
    linear-gradient(180deg, #0c1218 0%, #07090c 100%);
}

html[data-auth="signal"] .auth-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, transparent, #000 28%, #000 72%, transparent);
  pointer-events: none;
}

html[data-auth="signal"] .auth-stage__top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: auto;
}

html[data-auth="signal"] .auth-stage__mark {
  width: 32px;
  height: 32px;
  color: #7eb6ff;
}

html[data-auth="signal"] .auth-stage__kicker {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 620;
  letter-spacing: -0.02em;
  color: #f4f7fb;
}

html[data-auth="signal"] .auth-stage__pulse {
  position: relative;
  width: min(100%, 34rem);
  margin: 0 0 28px -8px;
  color: #7eb6ff;
}

html[data-auth="signal"] .auth-stage__stats {
  position: relative;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

html[data-auth="signal"] .auth-stage__stats strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 620;
  letter-spacing: -0.03em;
  color: #f4f7fb;
}

html[data-auth="signal"] .auth-stage__stats span {
  font-size: 0.72rem;
  color: rgba(214, 224, 234, 0.5);
}

html[data-auth="signal"] .auth-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px clamp(24px, 5vw, 64px) 96px;
  background: #10141a;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-auth="signal"] .auth-card__logo {
  display: none;
}

html[data-auth="signal"] .auth-card__title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 620;
  letter-spacing: -0.035em;
}

html[data-auth="signal"] .auth-card__subtitle {
  margin: 6px 0 0;
  font-size: 0.92rem;
  color: rgba(214, 224, 234, 0.55);
}

html[data-auth="signal"] .auth-card__brand {
  margin-bottom: 28px;
}

html[data-auth="signal"] .auth-form {
  max-width: 24rem;
}

html[data-device="phone"][data-auth="signal"] .auth-shell,
html[data-auth="signal"] .auth-shell {
  min-height: 100%;
}

@media (max-width: 860px) {
  html[data-auth="signal"] .auth-shell {
    grid-template-columns: 1fr;
    min-height: 100vh;
  }
  html[data-auth="signal"] .auth-stage {
    min-height: 0;
    padding: 22px 22px 18px;
  }
  html[data-auth="signal"] .auth-stage__pulse {
    margin: 18px 0 16px;
  }
  html[data-auth="signal"] .auth-card {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 28px 22px 120px;
  }
}

html[data-device="phone"][data-auth="signal"] .auth-shell {
  grid-template-columns: 1fr;
}

html[data-device="phone"][data-auth="signal"] .auth-stage {
  min-height: 0;
  padding: 22px 20px 16px;
}

html[data-device="phone"][data-auth="signal"] .auth-stage__pulse {
  margin: 16px 0 14px;
}

html[data-device="phone"][data-auth="signal"] .auth-card {
  border-left: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 24px 20px 36px;
  flex: 1;
}

/* -------------------------------------------------------------------------- */
/* B · Карточка                                                               */
/* -------------------------------------------------------------------------- */

.auth-bg-chart {
  display: none;
}

html[data-auth="card"] .auth-shell {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 20px;
  background:
    radial-gradient(800px 420px at 50% -10%, rgba(10, 132, 255, 0.18), transparent 58%),
    #07090c;
}

html[data-auth="card"] .auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 78%, transparent);
  pointer-events: none;
}

html[data-auth="card"] .auth-bg-chart {
  display: block;
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

html[data-auth="card"] .auth-bg-chart__svg {
  position: absolute;
  left: 0;
  bottom: 6%;
  width: 200%;
  height: 58%;
  color: #7eb6ff;
  animation: auth-chart-scroll 22s linear infinite;
}

html[data-auth="card"] .auth-bg-chart__line {
  fill: none;
  stroke: #7eb6ff;
  stroke-width: 1.75;
  stroke-linecap: butt;
  stroke-linejoin: miter;
  stroke-miterlimit: 8;
}

html[data-auth="card"] .auth-bg-chart__fill {
  fill: url(#authChartFill);
  stroke: none;
}

html[data-auth="card"] .auth-stage {
  display: none;
}

html[data-auth="card"] .auth-card {
  position: relative;
  z-index: 1;
  width: min(100%, 26rem);
  padding: 32px 28px;
  border-radius: 20px;
  background: rgba(12, 16, 22, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

@keyframes auth-chart-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

html[data-auth="card"] .auth-card__logo {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 12px;
  background: rgba(126, 182, 255, 0.12);
  color: #7eb6ff;
}

html[data-auth="card"] .auth-card__mark {
  width: 26px;
  height: 26px;
}

html[data-auth="card"] .logo__mark-wave,
html[data-auth="card"] .logo__mark-peak,
html[data-auth="card"] .logo__mark-ring {
  stroke: currentColor;
}

html[data-auth="card"] .logo__mark-dot {
  fill: currentColor;
}

html[data-auth="card"] .auth-card__title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 620;
  letter-spacing: -0.03em;
}

html[data-auth="card"] .auth-card__subtitle {
  margin: 6px 0 0;
  color: rgba(214, 224, 234, 0.55);
}

html[data-auth="card"] .auth-card__brand {
  margin-bottom: 24px;
}

html[data-device="phone"][data-auth="card"] .auth-shell {
  min-height: 100%;
  align-content: center;
  padding: 28px 20px;
}

/* -------------------------------------------------------------------------- */
/* C · Рейка                                                                  */
/* -------------------------------------------------------------------------- */

html[data-auth="rail"] .auth-shell {
  display: grid;
  grid-template-columns: 88px 1fr;
  min-height: 100vh;
}

html[data-auth="rail"] .auth-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 22px 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  background: #0c1015;
}

html[data-auth="rail"] .auth-stage__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

html[data-auth="rail"] .auth-stage__mark {
  width: 28px;
  height: 28px;
  color: #7eb6ff;
}

html[data-auth="rail"] .auth-stage__kicker,
html[data-auth="rail"] .auth-stage__pulse {
  display: none;
}

html[data-auth="rail"] .auth-stage__stats {
  margin: auto 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

html[data-auth="rail"] .auth-stage__stats strong {
  display: block;
  font-size: 1rem;
  font-weight: 650;
}

html[data-auth="rail"] .auth-stage__stats span {
  display: block;
  font-size: 0.62rem;
  color: rgba(214, 224, 234, 0.45);
}

html[data-auth="rail"] .auth-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 28rem;
  padding: 48px 40px 96px;
}

html[data-auth="rail"] .auth-card__logo {
  display: none;
}

html[data-auth="rail"] .auth-card__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 620;
  letter-spacing: -0.03em;
}

html[data-auth="rail"] .auth-card__subtitle {
  margin: 6px 0 0;
  color: rgba(214, 224, 234, 0.55);
}

html[data-auth="rail"] .auth-card__brand {
  margin-bottom: 28px;
}

@media (max-width: 860px) {
  html[data-auth="rail"] .auth-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  html[data-auth="rail"] .auth-stage {
    flex-direction: row;
    justify-content: space-between;
    padding: 14px 18px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }
  html[data-auth="rail"] .auth-stage__top {
    flex-direction: row;
  }
  html[data-auth="rail"] .auth-stage__stats {
    margin: 0;
    flex-direction: row;
    gap: 18px;
    text-align: left;
  }
  html[data-auth="rail"] .auth-card {
    padding: 28px 22px 120px;
    max-width: none;
  }
}

html[data-device="phone"][data-auth="rail"] .auth-shell {
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100%;
}

html[data-device="phone"][data-auth="rail"] .auth-stage {
  flex-direction: row;
  justify-content: space-between;
  padding: 14px 16px;
  border-right: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

html[data-device="phone"][data-auth="rail"] .auth-stage__top {
  flex-direction: row;
}

html[data-device="phone"][data-auth="rail"] .auth-stage__stats {
  margin: 0;
  flex-direction: row;
  gap: 16px;
  text-align: left;
}

html[data-device="phone"][data-auth="rail"] .auth-card {
  padding: 24px 20px 32px;
  max-width: none;
}

/* -------------------------------------------------------------------------- */
/* D · Лист — узкая колонка, как на телефоне                                  */
/* -------------------------------------------------------------------------- */

html[data-auth="sheet"] .auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 0 0 96px;
}

html[data-auth="sheet"] .auth-stage {
  padding: 28px 22px 8px;
}

html[data-auth="sheet"] .auth-stage__top {
  display: flex;
  align-items: center;
  gap: 10px;
}

html[data-auth="sheet"] .auth-stage__mark {
  width: 28px;
  height: 28px;
  color: #7eb6ff;
}

html[data-auth="sheet"] .auth-stage__kicker {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 620;
}

html[data-auth="sheet"] .auth-stage__pulse {
  display: none;
}

html[data-auth="sheet"] .auth-stage__stats {
  display: flex;
  gap: 20px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

html[data-auth="sheet"] .auth-stage__stats strong {
  display: block;
  font-size: 1.1rem;
}

html[data-auth="sheet"] .auth-stage__stats span {
  font-size: 0.72rem;
  color: rgba(214, 224, 234, 0.5);
}

html[data-auth="sheet"] .auth-card {
  margin-top: auto;
  padding: 12px 22px 28px;
}

html[data-auth="sheet"] .auth-card__logo,
html[data-auth="sheet"] .auth-card__title {
  display: none;
}

html[data-auth="sheet"] .auth-card__subtitle {
  margin: 0 0 18px;
  font-size: 1.35rem;
  font-weight: 620;
  letter-spacing: -0.03em;
  color: #f4f7fb;
}

html[data-auth="sheet"] .auth-card__brand {
  margin-bottom: 0;
}

html[data-device="phone"][data-auth="sheet"] .auth-shell {
  width: 100%;
  min-height: 100%;
  padding-bottom: 24px;
}

html[data-device="phone"][data-auth="card"] .auth-device,
html[data-device="phone"][data-auth="signal"] .auth-device,
html[data-device="phone"][data-auth="rail"] .auth-device,
html[data-device="phone"][data-auth="sheet"] .auth-device {
  background: #07090c;
}

@media (prefers-reduced-motion: reduce) {
  .auth-stage__pulse-line {
    animation: none;
    stroke-dashoffset: 0;
  }
  html[data-auth="card"] .auth-bg-chart__svg {
    animation: none;
  }
}

