/**
 * Auth pages — визуал в стиле лендинга MagicA.
 * Слева плавающая стеклянная карточка, справа иллюстрация на тёплом фоне.
 */

.auth-landing {
  --auth-bg: #f7f4ef;
  --auth-surface: #ffffff;
  --auth-ink: #1c1917;
  --auth-ink-soft: #44403c;
  --auth-muted: #78716c;
  --auth-border: #e9e3d9;
  --auth-primary: #8b5cf6;
  --auth-primary-strong: #7c3aed;
  --auth-primary-soft: #f1ecfe;
  --auth-primary-ring: #c9b8fb;
  --auth-font-sans: "Inter", system-ui, sans-serif;
  --auth-font-display: "Playfair Display", Georgia, serif;

  margin: 0;
  min-height: 100vh;
  color: var(--auth-ink);
  font-family: var(--auth-font-sans);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(ellipse 40% 45% at 12% 8%, rgba(139, 92, 246, 0.16), transparent 62%),
    radial-gradient(ellipse 45% 50% at 78% 12%, rgba(240, 222, 190, 0.62), transparent 65%),
    radial-gradient(ellipse 50% 45% at 68% 88%, rgba(241, 236, 254, 0.75), transparent 62%),
    var(--auth-bg);
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .auth-shell {
    grid-template-columns: minmax(430px, 520px) minmax(0, 1fr);
    align-items: center;
  }
}

/* ── Левая плавающая glass-карточка ── */
.auth-panel {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100dvh;
  padding: 2.5rem 1.25rem;
}

@media (min-width: 960px) {
  .auth-panel {
    min-height: 0;
    padding: 2.5rem 2rem 2.5rem 3.5rem;
  }
}

.auth-panel-inner {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 2.25rem 2.25rem 2rem;
  border-radius: 1.75rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 24px 60px rgba(28, 25, 23, 0.09),
    0 2px 8px rgba(28, 25, 23, 0.04);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
}

.auth-logo {
  margin-bottom: 1.85rem;
  text-align: center;
}

.auth-logo .brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-logo .brand-logo img {
  height: 2.85rem;
  width: auto;
  max-width: none;
}

.auth-logo-sub {
  margin-top: 0.55rem;
  font-size: 0.8rem;
  color: var(--auth-muted);
}

.auth-title {
  margin: 0 0 0.45rem;
  font-family: var(--auth-font-display);
  font-size: 2.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--auth-ink);
}

.auth-sub {
  margin: 0 0 1.6rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--auth-ink-soft);
}

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.9rem;
  font-size: 0.875rem;
  line-height: 1.4;
}

.auth-alert--error {
  background: rgba(254, 242, 242, 0.92);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.auth-alert--success {
  background: rgba(240, 253, 244, 0.92);
  color: #166534;
  border: 1px solid #bbf7d0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}

.auth-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--auth-ink-soft);
}

.auth-field {
  position: relative;
}

.auth-field .auth-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--auth-muted);
}

.auth-field input {
  width: 100%;
  box-sizing: border-box;
  height: 3rem;
  padding: 0 2.75rem 0 2.7rem !important;
  border: 1px solid var(--auth-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--auth-ink);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.auth-field input::placeholder {
  color: #a8a29e;
}

.auth-field input:focus {
  border-color: var(--auth-primary-ring);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.auth-field .auth-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.25rem;
  color: var(--auth-muted);
}

.auth-field .auth-toggle:hover {
  color: var(--auth-ink-soft);
}

.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  height: 3rem;
  margin-top: 0.5rem;
  border: none;
  border-radius: 999px;
  background: var(--auth-primary);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms ease, transform 120ms ease;
}

.auth-submit:hover {
  background: var(--auth-primary-strong);
}

.auth-submit:active {
  transform: scale(0.985);
}

.auth-links {
  margin-top: 1.15rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--auth-muted);
}

.auth-links a {
  color: var(--auth-primary-strong);
  font-weight: 600;
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-help {
  margin-top: 1.85rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--auth-border);
}

.auth-help-title {
  margin: 0 0 0.8rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--auth-muted);
}

.auth-help-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.auth-help-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--auth-border);
  background: rgba(255, 255, 255, 0.85);
  color: var(--auth-ink-soft);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.auth-help-btn:hover {
  border-color: var(--auth-primary-ring);
  background: var(--auth-primary-soft);
  color: var(--auth-primary-strong);
}

.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--auth-muted);
}

/* ── Правая зона: текст + крупная иллюстрация ── */
.auth-visual {
  position: relative;
  display: none;
  min-height: 0;
  padding: 2.5rem 3.5rem;
  overflow: hidden;
}

@media (min-width: 960px) {
  .auth-visual {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
  }
}

.auth-visual-copy {
  position: relative;
  z-index: 2;
  max-width: 30rem;
}

.auth-visual-title {
  margin: 0;
  font-family: var(--auth-font-display);
  font-size: clamp(2rem, 2.9vw, 2.9rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--auth-ink);
}

.auth-visual-text {
  margin: 1rem 0 0;
  max-width: 27rem;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--auth-ink-soft);
}

.auth-visual-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
}

.auth-visual-hero {
  width: auto;
  max-width: min(100%, 720px);
  max-height: 52vh;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 30px 55px rgba(28, 25, 23, 0.1));
}

/* ── Мобильная версия: только карточка на тёплом фоне ── */
@media (max-width: 959px) {
  .auth-panel-inner {
    max-width: 400px;
    padding: 1.75rem 1.4rem 1.6rem;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(233, 227, 217, 0.95);
    box-shadow: 0 18px 44px rgba(28, 25, 23, 0.07);
    backdrop-filter: blur(16px);
  }
}
