.auth-stage {
  position: relative;
  isolation: isolate;
}

.auth-stage__halo {
  position: absolute;
  border-radius: 999px;
  filter: blur(10px);
  opacity: 0.7;
  pointer-events: none;
}

.auth-stage__halo--a {
  top: -2rem;
  right: 12%;
  width: 14rem;
  height: 14rem;
  background: radial-gradient(circle, rgba(255, 145, 77, 0.28), transparent 72%);
}

.auth-stage__halo--b {
  bottom: -3rem;
  left: 5%;
  width: 16rem;
  height: 16rem;
  background: radial-gradient(circle, rgba(62, 212, 180, 0.24), transparent 72%);
}

.auth-shell {
  position: relative;
  display: grid;
  gap: 1.5rem;
  align-items: stretch;
  min-height: min(100%, 720px);
}

.auth-shell--modal {
  min-height: 0;
  max-width: min(38rem, 100%);
  margin-inline: auto;
}

.auth-shell--modal .auth-side {
  display: none;
}

.auth-card,
.auth-side {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at top right, rgba(255, 169, 77, 0.18), transparent 34%),
    radial-gradient(circle at bottom left, rgba(85, 221, 191, 0.14), transparent 36%),
    linear-gradient(160deg, rgba(16, 22, 34, 0.97), rgba(8, 12, 22, 0.94));
  box-shadow: 0 28px 100px rgba(2, 8, 20, 0.42);
}

.auth-card {
  padding: clamp(1.35rem, 2vw, 2.25rem);
}

.auth-side {
  padding: clamp(1.4rem, 2vw, 2.2rem);
  display: grid;
  gap: 1.1rem;
  align-content: start;
}

.auth-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.auth-kicker {
  margin: 0;
  color: #a4bdd7;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
}

.auth-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #ecf3ff;
  font-size: 0.84rem;
}

.auth-chip--quiet {
  cursor: pointer;
}

.auth-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.3rem;
}

.auth-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(229, 239, 255, 0.8);
  font-size: 0.85rem;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.auth-switch:hover,
.auth-switch:focus-visible,
.auth-switch.is-active {
  transform: translateY(-1px);
  border-color: rgba(255, 171, 87, 0.38);
  background: linear-gradient(135deg, rgba(255, 130, 84, 0.2), rgba(68, 223, 192, 0.16));
  color: #fff8ef;
}

.auth-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.auth-lead {
  margin: 0.95rem 0 1.5rem;
  max-width: 42rem;
  color: rgba(233, 242, 255, 0.78);
  font-size: 1rem;
  line-height: 1.72;
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.auth-form--secondary {
  margin-top: 0.9rem;
}

.auth-field {
  display: grid;
  gap: 0.45rem;
}

.auth-field label {
  color: #dfe9fb;
  font-size: 0.94rem;
  font-weight: 600;
}

.auth-field input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(5, 10, 20, 0.66);
  color: #f6fbff;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.auth-field input:focus {
  border-color: rgba(255, 169, 77, 0.58);
  box-shadow: 0 0 0 4px rgba(255, 169, 77, 0.1);
  background: rgba(7, 12, 22, 0.9);
}

.auth-row {
  display: grid;
  gap: 1rem;
}

.auth-actions {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.2rem;
}

.auth-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 3.3rem;
  padding: 0.95rem 1.2rem;
  border: 0;
  border-radius: 18px;
  color: #1a1210;
  background: linear-gradient(135deg, #ff9a53, #ffe39e 48%, #65e5c9);
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 18px 36px rgba(255, 154, 83, 0.2);
}

.auth-btn:hover,
.auth-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 22px 40px rgba(255, 154, 83, 0.26);
}

.auth-btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  color: #eef4ff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.auth-meta,
.auth-help {
  margin: 0;
  color: rgba(224, 236, 255, 0.72);
  line-height: 1.7;
}

.auth-meta a,
.auth-help a {
  color: #8bf3db;
}

.auth-meta--inline {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.auth-check input {
  accent-color: #ffb06f;
}

.auth-points,
.auth-stat-grid {
  display: grid;
  gap: 0.85rem;
}

.auth-stat {
  padding: 1rem 1.05rem;
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-stat strong,
.auth-point strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #ffffff;
}

.auth-stat span {
  color: rgba(225, 237, 255, 0.74);
  line-height: 1.6;
}

.auth-point {
  padding: 1rem 1.05rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(225, 237, 255, 0.74);
  line-height: 1.65;
}

.auth-code {
  letter-spacing: 0.22em;
}

.auth-flash-stack {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 0.8rem;
  margin: 0 0 1rem;
}

.auth-inline-flash {
  margin: 0;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(9, 15, 26, 0.92);
  color: #eef4ff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.26);
}

.auth-inline-flash.alert-success {
  border-color: rgba(95, 227, 193, 0.34);
}

.auth-inline-flash.alert-warning {
  border-color: rgba(255, 201, 89, 0.35);
}

.auth-inline-flash.alert-danger {
  border-color: rgba(255, 113, 113, 0.35);
}

.auth-modal__dialog {
  max-width: min(760px, calc(100vw - 1.25rem));
  margin: 0.9rem auto;
}

.auth-modal__content {
  position: relative;
  border: 0;
  border-radius: 28px;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

.auth-modal__body {
  padding: 0;
}

.auth-modal .modal-backdrop {
  background: rgba(4, 8, 16, 0.78);
}

.auth-modal__close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
  border: 0;
  border-radius: 999px;
  background: rgba(7, 13, 23, 0.72);
  color: #eef4ff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.auth-modal__loading,
.auth-modal__error {
  min-height: 14rem;
  display: grid;
  place-items: center;
  gap: 0.8rem;
  padding: 2.4rem;
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(12, 18, 31, 0.96), rgba(8, 12, 23, 0.94));
  color: #eef4ff;
  text-align: center;
}

.auth-shell--modal .auth-card {
  padding: clamp(1.1rem, 2vw, 1.55rem);
  border-radius: 26px;
}

.auth-shell--modal .auth-topline {
  margin-bottom: 0.8rem;
}

.auth-shell--modal .auth-switches {
  margin-bottom: 1rem;
}

.auth-shell--modal .auth-title {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 1.03;
}

.auth-shell--modal .auth-lead {
  margin: 0.75rem 0 1.1rem;
  font-size: 0.96rem;
  line-height: 1.58;
}

.auth-shell--modal .auth-form {
  gap: 0.85rem;
}

.auth-shell--modal .auth-field input {
  min-height: 3rem;
  border-radius: 16px;
}

.auth-shell--modal .auth-btn {
  min-height: 3.05rem;
  border-radius: 16px;
}

.auth-shell--modal .auth-meta--inline {
  margin-top: 0.85rem;
}

.auth-modal__loading-dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff9a53, #65e5c9);
  box-shadow: 0 0 0 0 rgba(101, 229, 201, 0.35);
  animation: auth-pulse 1.2s ease-in-out infinite;
}

@keyframes auth-pulse {
  0% {
    transform: scale(0.88);
    box-shadow: 0 0 0 0 rgba(101, 229, 201, 0.35);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 18px rgba(101, 229, 201, 0);
  }
  100% {
    transform: scale(0.88);
    box-shadow: 0 0 0 0 rgba(101, 229, 201, 0);
  }
}

@media (min-width: 980px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1.16fr) minmax(300px, 0.84fr);
  }

  .auth-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 979.98px) {
  .auth-modal__dialog {
    max-width: calc(100vw - 1rem);
    margin: 0.5rem auto;
  }

  .auth-card,
  .auth-side {
    border-radius: 26px;
  }

  .auth-modal__close {
    top: 0.9rem;
    right: 0.9rem;
  }
}
