/*
 * Модалки «Вход» / «Регистрация» в духе IQ GAME CONCEPT (Figma: node 1265:532, 1265:566).
 * Токены согласованы с city.css / hero__callout.
 */
[x-cloak] {
  display: none !important;
}

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(58, 117, 221, 0.35);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.auth-modal {
  --auth-accent: #2956a6;
  --auth-text: #434040;
  --auth-muted: #6b6b6b;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  position: relative;
  border-radius: 40px;
  padding: 36px 36px 40px;
  color: var(--auth-text);
  font-family: Manrope, system-ui, sans-serif;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18), 0 4px 134px rgba(41, 86, 166, 0.12);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

/* полоса-акцент как в концепте */
.auth-modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 36px;
  right: 36px;
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, #3a75dd 0%, #05cee8 50%, #2956a6 100%);
}

.auth-modal--register {
  max-width: 520px;
}

.auth-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
  padding-top: 8px;
}

.auth-modal__title {
  margin: 0;
  font-family: Onest, system-ui, sans-serif;
  font-weight: 900;
  font-size: clamp(26px, 4vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--auth-accent);
}

.auth-modal__subtitle {
  margin: 10px 0 22px;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--auth-muted);
  font-weight: 600;
}

.auth-modal__close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: rgba(58, 117, 221, 0.12);
  color: var(--auth-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.12s;
}

.auth-modal__close:hover {
  background: rgba(58, 117, 221, 0.22);
  transform: scale(1.04);
}

.auth-modal__close svg {
  display: block;
  width: 22px;
  height: 22px;
}

.auth-modal__notice {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.4;
}

.auth-modal__notice--ok {
  background: rgba(46, 160, 67, 0.12);
  border: 1px solid rgba(46, 160, 67, 0.35);
  color: #1b5e20;
}

.auth-modal__error {
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(200, 60, 60, 0.25);
  color: #8f1d1d;
  font-size: 0.9rem;
  font-weight: 700;
}

.auth-modal__grid2 {
  display: grid;
  gap: 14px;
}

@media (min-width: 480px) {
  .auth-modal__grid2--split {
    grid-template-columns: 1fr 1fr;
  }
}

.auth-modal__field {
  margin-bottom: 14px;
}

.auth-modal__field label {
  display: block;
  margin-bottom: 8px;
  font-family: Onest, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--auth-muted);
}

.auth-modal__field input[type="text"],
.auth-modal__field input[type="email"],
.auth-modal__field input[type="password"],
.auth-modal__field input[type="tel"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  font-size: 1rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-modal__field input:focus {
  outline: none;
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 4px rgba(41, 86, 166, 0.12);
}

.auth-modal__check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--auth-text);
  cursor: pointer;
}

.auth-modal__check input {
  width: 20px;
  height: 20px;
  accent-color: var(--auth-accent);
}

.auth-modal__submit {
  width: 100%;
  margin-top: 12px;
  padding: 16px 24px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(136.87deg, #3a75dd 24.29%, #05cee8 56.79%, #2956a6 93.63%);
  color: #fff;
  font-family: Onest, system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(41, 86, 166, 0.38);
  transition: transform 0.12s, box-shadow 0.12s;
}

.auth-modal__submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(41, 86, 166, 0.45);
}

.auth-modal__meta {
  margin: -2px 0 14px;
}

.auth-modal__footer {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--auth-muted);
}

.auth-modal__switch {
  background: none;
  border: none;
  padding: 0;
  margin-left: 4px;
  font: inherit;
  font-family: Onest, system-ui, sans-serif;
  font-weight: 900;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--auth-accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.auth-modal__link {
  color: var(--auth-accent);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-page-wrap {
  min-height: calc(100vh - 220px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: linear-gradient(180deg, #f6f9ff 0%, #eef5ff 100%);
}

.auth-modal--reset {
  max-width: 520px;
}

.auth-modal__debug {
  margin: 14px 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #1f3563;
}

.auth-modal__debug a {
  word-break: break-all;
}

.auth-reset__card {
  max-width: 860px;
  margin: 0 auto;
}

.auth-reset__subtitle {
  margin: 10px 0 0;
  font-family: Manrope, system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.45;
  color: #6b6b6b;
  font-weight: 600;
}

.auth-reset__form {
  max-width: 560px;
}

.auth-reset__footer {
  margin: 18px 0 0;
}

@media (max-width: 480px) {
  .auth-modal {
    padding: 28px 22px 32px;
    border-radius: 28px;
  }

  .auth-modal::before {
    left: 22px;
    right: 22px;
  }
}
