/* ──────────────────────────────────────────────────────────────
   Экран входа и регистрации.
   ────────────────────────────────────────────────────────────── */

.auth {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

/* Обои на весь экран, а не только на левую половину. */
.auth::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: var(--pattern-ink);
  -webkit-mask-image: url("../assets/bg-shapes.svg");
  mask-image: url("../assets/bg-shapes.svg");
  -webkit-mask-size: 380px 380px;
  mask-size: 380px 380px;
  opacity: .7;
}

/* ── левая половина: бренд ───────────────────────────────────── */
.auth__hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px clamp(28px, 5vw, 64px);
  padding-top: calc(40px + var(--safe-t));
  overflow: hidden;
  z-index: 1;
  background: radial-gradient(120% 120% at 0% 0%, rgba(29, 32, 41, .86) 0%, rgba(16, 19, 25, .8) 55%, rgba(11, 13, 18, .62) 100%);
  border-right: 1px solid var(--line);
}
[data-theme="light"] .auth__hero {
  background: radial-gradient(120% 120% at 0% 0%, rgba(251, 244, 233, .86) 0%, rgba(240, 232, 220, .82) 55%, rgba(231, 221, 205, .72) 100%);
}

.auth__hero > * { position: relative; z-index: 1; }

.auth__brand {
  display: flex;
  align-items: center;
}
.auth__brand .brand { font-size: 1.6rem; }

.auth__pitch {
  max-width: 30ch;
  margin-top: auto;
  margin-bottom: auto;
}
.auth__pitch h1 {
  font-size: clamp(1.9rem, 3.2vw, 2.9rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -.03em;
}
.auth__pitch h1 em {
  font-style: normal;
  color: var(--accent);
}
.auth__pitch p {
  margin-top: 14px;
  font-size: 1.02em;
  line-height: 1.55;
  color: var(--text-2);
  max-width: 34ch;
}

.auth__points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}
.auth__point {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: .82em;
  color: var(--text-2);
}
.auth__point svg { width: 14px; height: 14px; color: var(--accent); flex: none; }

.auth__legal {
  font-size: .76em;
  color: var(--text-3);
  line-height: 1.5;
  max-width: 46ch;
}
.auth__legal a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }

/* ── правая половина: форма ──────────────────────────────────── */
.auth__side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px clamp(20px, 4vw, 48px);
  padding-bottom: calc(32px + var(--safe-b));
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

.auth__card { width: min(392px, 100%); }

.auth__title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.025em;
}
.auth__subtitle {
  margin-top: 6px;
  font-size: .92em;
  color: var(--text-2);
  line-height: 1.5;
}

.auth__switcher {
  display: flex;
  gap: 2px;
  margin: 22px 0 18px;
  padding: 3px;
  border-radius: var(--r-sm);
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.auth__switcher button {
  flex: 1;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: .88em;
  font-weight: 650;
  color: var(--text-2);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.auth__switcher button[aria-selected="true"] {
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-1);
}

.auth__form { display: flex; flex-direction: column; gap: 14px; }

.auth__submit { min-height: 46px; margin-top: 4px; }
.auth__submit .spinner { border-top-color: var(--accent-ink); border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }

.auth__alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--danger-dim);
  color: var(--danger);
  font-size: .86em;
  line-height: 1.45;
}
.auth__alert svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.auth__alert--info { background: var(--accent-dim); color: var(--accent); }

.auth__foot {
  margin-top: 18px;
  font-size: .8em;
  color: var(--text-3);
  text-align: center;
  line-height: 1.5;
}

.auth__server {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: .76em;
  color: var(--text-3);
  text-align: center;
}
.auth__server button {
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* мобильная версия: только форма, бренд сверху */
@media (max-width: 980px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth__hero { display: none; }
  .auth__side { padding: 24px 20px calc(28px + var(--safe-b)); align-items: flex-start; }
  .auth__card { margin-top: auto; margin-bottom: auto; }
  .auth__mobile-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 26px;
  }
  .auth__mobile-brand .brand { font-size: 1.7rem; }
}

@media (min-width: 981px) {
  .auth__mobile-brand { display: none; }
}
