:root {
  color-scheme: dark;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #080c12;
  color: #eef2ff;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 15%, rgb(99 102 241 / 12%), transparent 35%),
    radial-gradient(circle at 85% 85%, rgb(56 189 248 / 8%), transparent 32%),
    #080c12;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 32px 20px;
}

.auth-card {
  width: min(100%, 430px);
  padding: 36px;
  border: 1px solid #232c3b;
  border-radius: 24px;
  background: rgb(15 21 32 / 96%);
  box-shadow: 0 24px 80px rgb(0 0 0 / 42%);
}

.auth-header {
  margin-bottom: 28px;
  text-align: center;
}

.brand-icon {
  display: block;
  margin: 0 auto 18px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgb(99 102 241 / 18%);
}

.eyebrow {
  margin: 0 0 8px;
  color: #a5b4fc;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

h1 {
  margin: 0;
  font-size: clamp(25px, 5vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.auth-subtitle {
  margin: 10px 0 0;
  color: #8f9baf;
  font-size: 14px;
  line-height: 1.5;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin-bottom: 26px;
  padding: 4px;
  border: 1px solid #202938;
  border-radius: 12px;
  background: #0a0f17;
}

.auth-tab {
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8f9baf;
  font-size: 14px;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease;
}

.auth-tab[aria-selected="true"] {
  background: #202938;
  color: #f4f6fb;
  box-shadow: 0 2px 8px rgb(0 0 0 / 20%);
}

.auth-tab:focus-visible,
.auth-submit:focus-visible,
input:focus-visible {
  outline: 2px solid #818cf8;
  outline-offset: 3px;
}

.form-field {
  margin-bottom: 18px;
}

.form-field label {
  display: block;
  margin-bottom: 8px;
  color: #c6cfdd;
  font-size: 13px;
  font-weight: 600;
}

.form-field input {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #2a3546;
  border-radius: 10px;
  background: #0b111b;
  color: #eef2ff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.form-field input::placeholder {
  color: #5f6c80;
}

.form-field input:hover {
  border-color: #3a475b;
}

.form-field input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgb(129 140 248 / 12%);
}

.form-field input[aria-invalid="true"] {
  border-color: #f87171;
}

.field-error {
  min-height: 16px;
  margin: 6px 0 0;
  color: #fca5a5;
  font-size: 12px;
  line-height: 1.35;
}

.form-status {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid rgb(248 113 113 / 35%);
  border-radius: 10px;
  background: rgb(127 29 29 / 18%);
  color: #fecaca;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.auth-submit {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  padding: 11px 16px;
  border: 0;
  border-radius: 10px;
  background: #6366f1;
  color: #fff;
  font-weight: 700;
  transition: background 160ms ease, opacity 160ms ease;
}

.auth-submit:hover:not(:disabled) {
  background: #7376f2;
}

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

.button-loader {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgb(255 255 255 / 35%);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.auth-submit[data-loading="true"] .button-loader {
  display: block;
}

.auth-footnote {
  margin: 24px 0 0;
  color: #68758a;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

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

@media (max-width: 480px) {
  .auth-shell {
    padding: 16px;
  }

  .auth-card {
    padding: 26px 22px;
    border-radius: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
