:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --background: #0b0d14;
  --surface: #171820;
  --surface-strong: #20222d;
  --border: #343746;
  --text: #f4f6ff;
  --muted: #adb3c7;
  --blue: #47b8ff;
  --blue-strong: #3168dc;
  --violet: #873cff;
  --success: #42d79b;
  --danger: #ff7d8b;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at 18% 12%, rgba(49, 104, 220, 0.2), transparent 32rem),
    radial-gradient(circle at 82% 88%, rgba(135, 60, 255, 0.13), transparent 28rem),
    var(--background);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.auth-card {
  width: min(100%, 520px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: rgba(23, 24, 32, 0.96);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 26px 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(135deg, #102d63, #153f83 60%, #312064);
}

.brand-mark {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
}

.mark-ring {
  position: absolute;
  inset: 3px 11px 3px 3px;
  border: 7px solid var(--blue);
  border-right-color: var(--violet);
  border-radius: 50%;
  transform: rotate(-24deg);
  box-shadow: 0 0 18px rgba(71, 184, 255, 0.45);
}

.mark-line {
  position: absolute;
  width: 34px;
  height: 8px;
  right: 0;
  top: 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--violet));
  transform: rotate(48deg);
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.brand-tagline {
  margin-top: 4px;
  color: #d4ddff;
  font-size: 0.82rem;
}

.view {
  padding: 38px 34px 34px;
}

.hidden {
  display: none !important;
}

.center-view {
  text-align: center;
}

.eyebrow {
  margin-bottom: 8px;
  color: #9bb8ff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.lead,
.center-view > p {
  margin: 14px 0 28px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.65;
}

label {
  display: block;
  margin: 22px 0 8px;
  color: #dce0ee;
  font-size: 0.88rem;
  font-weight: 650;
}

.password-field {
  position: relative;
}

.password-field input {
  width: 100%;
  min-height: 56px;
  padding: 0 78px 0 16px;
  border: 1px solid #4a4d60;
  border-radius: 13px;
  outline: none;
  background: #111219;
  color: var(--text);
  caret-color: var(--blue);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.password-field input:focus {
  border-color: #73bfff;
  box-shadow: 0 0 0 4px rgba(71, 184, 255, 0.14);
}

.visibility-button {
  position: absolute;
  top: 50%;
  right: 11px;
  min-width: 55px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: #a9c1ff;
  font-size: 0.82rem;
  font-weight: 750;
  transform: translateY(-50%);
}

.requirements {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 14px;
  margin: 18px 0 0;
  padding: 0;
  color: #9198ad;
  font-size: 0.78rem;
  list-style: none;
}

.requirements li::before {
  content: "○";
  margin-right: 7px;
}

.requirements li.valid {
  color: var(--success);
}

.requirements li.valid::before {
  content: "✓";
}

.message {
  margin-top: 20px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 125, 139, 0.45);
  border-radius: 11px;
  background: rgba(255, 125, 139, 0.09);
  color: #ffc3ca;
  font-size: 0.86rem;
  line-height: 1.45;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 54px;
  margin-top: 25px;
  border-radius: 13px;
  font-weight: 800;
  transition: transform 150ms ease, filter 150ms ease, opacity 150ms ease;
}

.primary-button {
  border: 0;
  background: linear-gradient(100deg, #2877e8, #674de8);
  color: white;
  box-shadow: 0 12px 32px rgba(45, 95, 211, 0.25);
}

.secondary-button {
  border: 1px solid #4a4d60;
  background: var(--surface-strong);
  color: var(--text);
}

.primary-button:hover:not(:disabled),
.secondary-button:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.spinner {
  width: 46px;
  height: 46px;
  margin: 2px auto 22px;
  border: 4px solid #2a2d39;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.status-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border: 1px solid #4a4d60;
  border-radius: 18px;
  background: var(--surface-strong);
  color: #b9c8ff;
  font-size: 1.7rem;
  font-weight: 900;
}

.status-icon.success {
  border-color: rgba(66, 215, 155, 0.45);
  background: rgba(66, 215, 155, 0.1);
  color: var(--success);
}

.status-icon.error {
  border-color: rgba(255, 125, 139, 0.45);
  background: rgba(255, 125, 139, 0.1);
  color: var(--danger);
}

footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 18px 20px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: #777e92;
  font-size: 0.72rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 520px) {
  .page-shell {
    padding: 0;
  }

  .auth-card {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .brand {
    padding: 23px 22px;
  }

  .view {
    padding: 34px 22px 30px;
  }

  .requirements {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
