/* ============================================================
   Auth
   ============================================================ */
.auth-shell {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - 5.25rem);
  padding: 2.5rem 1.5rem 3.5rem;
}

.auth-card {
  position: relative;
  width: min(100%, 28rem);
  padding: 1.45rem 1.4rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 5%, transparent), transparent 7rem),
    color-mix(in srgb, var(--slate) 92%, transparent);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.auth-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.auth-head-logo {
  width: 3.6rem;
  height: 2.1rem;
  flex: none;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.auth-kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--snow-35);
}

.auth-head h1 {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.auth-switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 1.25rem;
  padding: 0.22rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: color-mix(in srgb, var(--void) 72%, transparent);
}

.auth-glider {
  position: absolute;
  top: 0.22rem;
  bottom: 0.22rem;
  left: 0.22rem;
  width: calc(50% - 0.33rem);
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 0.4rem;
  background: color-mix(in srgb, var(--accent) 16%, var(--slate));
  transition: left 0.2s var(--ease);
}

.auth-switch[data-tab="register"] .auth-glider {
  left: calc(50% + 0.11rem);
}

.auth-switch button {
  position: relative;
  z-index: 1;
  min-height: 2.35rem;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--snow-55);
  font-size: 13px;
  font-weight: 650;
  transition: color 0.15s, transform 0.12s;
}

.auth-switch button[aria-selected="true"] {
  color: var(--snow);
}

.auth-switch button:active {
  transform: scale(0.97);
}

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

.auth-form[hidden] {
  display: none;
}

.auth-field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--snow-35);
}

.auth-field-label span {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.auth-field-control {
  position: relative;
}

.auth-input {
  width: 100%;
  min-height: 2.85rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--void) 78%, transparent);
  color: var(--snow);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.auth-input::placeholder {
  color: var(--snow-25);
}

.auth-input:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
  background: color-mix(in srgb, var(--void) 92%, transparent);
}

.auth-input[aria-invalid="true"] {
  border-color: var(--danger);
}

.auth-field-control:has(.auth-reveal) .auth-input {
  padding-right: 2.6rem;
}

.auth-reveal {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  transform: translateY(-50%);
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--snow-35);
}

.auth-reveal:hover {
  color: var(--snow-80);
  background: rgba(255, 255, 255, 0.04);
}

.auth-reveal svg {
  width: 1rem;
  height: 1rem;
}

.auth-captcha {
  padding: 0.8rem 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: color-mix(in srgb, var(--slate) 65%, transparent);
}

.auth-captcha-title {
  margin-bottom: 0.55rem;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--snow-35);
}

.auth-captcha-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.35rem;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
  user-select: none;
}

.auth-captcha-check {
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  flex: none;
  border: 2px solid #6d6d6d;
  border-radius: 3px;
  background: #f4f4f4;
  color: #fff;
  transition: background-color 0.2s, border-color 0.2s;
}

.auth-captcha-check svg {
  width: 0.9rem;
  height: 0.9rem;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.15s, transform 0.2s var(--ease);
}

.auth-captcha-box.is-checked .auth-captcha-check {
  background: #2f9e44;
  border-color: #2f9e44;
}

.auth-captcha-box.is-checked .auth-captcha-check svg {
  opacity: 1;
  transform: none;
}

.auth-captcha-label {
  flex: 1;
  font-size: 14px;
  color: var(--snow-80);
}

.auth-captcha-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  color: var(--snow-35);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-captcha-badge svg {
  width: 1.35rem;
  height: 1.35rem;
  color: var(--accent);
}

.auth-error {
  display: none;
  padding: 0.55rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--danger) 42%, transparent);
  border-radius: 0.4rem;
  background: color-mix(in srgb, var(--danger) 9%, transparent);
  color: #ffb3b3;
  font-size: 12px;
  line-height: 1.45;
}

.auth-error.is-visible {
  display: block;
  animation: shake 0.3s ease;
}

@keyframes shake {
  20%, 60% {
    transform: translateX(-3px);
  }
  40%, 80% {
    transform: translateX(3px);
  }
}

.auth-submit {
  --btn-h: 2.85rem;
  margin-top: 0.1rem;
  border-radius: 0.55rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #ffffff), var(--accent));
  color: #03121e;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 20%, transparent);
}

.auth-submit[disabled] {
  background: #33404d;
  color: #9aa9b6;
  box-shadow: none;
}

.auth-submit.is-loading .auth-submit-label {
  opacity: 0.4;
}

.auth-spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.auth-submit.is-loading .auth-spinner {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-alt {
  --btn-h: 2.7rem;
  border-radius: 0.55rem;
  border-color: var(--line);
  background: transparent;
  color: var(--snow-80);
  font-size: 13px;
}

.auth-alt:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
}

.auth-alt svg {
  width: 1rem;
  height: 1rem;
}

.auth-note {
  margin-top: 0.1rem;
  color: var(--snow-35);
  font-size: 12px;
  line-height: 1.5;
}

.auth-caption {
  margin-top: 2rem;
  text-align: center;
  color: var(--snow-35);
  font-size: 11.5px;
  line-height: 1.6;
}

.auth-caption .mono {
  font-size: 10px;
  letter-spacing: 0.14em;
}

.auth-caption .auth-demo-link {
  display: inline-block;
  margin-top: 0.65rem;
  color: var(--snow-55);
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  transition: color 0.2s, border-color 0.2s;
}

.auth-caption .auth-demo-link:hover {
  color: var(--snow);
  border-color: var(--snow-35);
}

.auth-footnote {
  margin-top: 0.9rem;
  color: var(--snow-25);
  font-size: 11px;
  text-align: center;
}

@media (max-width: 640px) {
  .auth-shell {
    justify-content: flex-start;
    padding: 1rem 1.1rem 1.5rem;
  }
  .auth-card {
    padding: 1.15rem;
  }
  .auth-caption {
    margin-top: 1.4rem;
  }
}
