.auth-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 7, 12, 0.76);
  backdrop-filter: blur(12px);
}

.auth-overlay.open {
  display: flex;
}

.auth-modal {
  position: relative;
  width: min(100%, 460px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 34px;
  overflow: hidden;
  background:
    radial-gradient(circle at 0% 0%, rgba(56, 217, 169, 0.16), transparent 36%),
    radial-gradient(circle at 100% 0%, rgba(79, 110, 247, 0.18), transparent 38%),
    var(--surface);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
  animation: authFadeUp .22s ease;
}

@keyframes authFadeUp {
  from { transform: translateY(14px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.auth-modal__close {
  position: absolute;
  top: 16px;
  right: 18px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.auth-modal__head {
  margin-bottom: 22px;
  padding-right: 22px;
}

.auth-modal__kicker {
  margin: 0 0 8px;
  color: var(--accent2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.auth-modal h2 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.auth-modal__head p:not(.auth-modal__kicker) {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 20px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.auth-switch__item {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: color .18s, background .18s, box-shadow .18s;
}

.auth-switch__item.is-active {
  color: #06120e;
  background: linear-gradient(135deg, var(--accent2), #b7ffe9);
  box-shadow: 0 12px 26px rgba(56, 217, 169, 0.2);
}

.auth-form {
  display: none;
}

.auth-form.is-active {
  display: grid;
  gap: 15px;
}

.auth-field {
  display: grid;
  gap: 7px;
}

.auth-field span,
.auth-check {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-field input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 15px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

.auth-field input:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 4px rgba(56, 217, 169, 0.1);
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 2px;
}

.auth-row a,
.auth-check a {
  color: var(--accent2);
  text-decoration: none;
}

.auth-check {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  line-height: 1.45;
}

.auth-check input {
  margin-top: 3px;
  accent-color: var(--accent2);
}

.auth-check--legal {
  margin-top: 2px;
}

.auth-submit {
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  border: 0;
  border-radius: 13px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 28px rgba(79, 110, 247, 0.34);
  transition: transform .16s, opacity .16s, box-shadow .16s;
}

.auth-submit:hover {
  opacity: .9;
  transform: translateY(-1px);
  box-shadow: 0 0 38px rgba(79, 110, 247, 0.44);
}

@media (max-width: 540px) {
  .auth-modal {
    padding: 28px 20px;
  }

  .auth-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

.auth-form__message {
  min-height: 20px;
  margin: 0;
  color: #ef4444;
  font-size: 13px;
  line-height: 1.45;
}

.auth-form__message.is-success {
  color: #10b981;
}

.auth-submit:disabled {
  cursor: wait;
  opacity: .72;
}
