:root {
  --font-sans: "Inter", "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  --color-background: radial-gradient(circle at top left, #233dff, #141824 55%, #0a0b11 100%);
  --color-card: rgba(12, 15, 30, 0.86);
  --color-card-border: rgba(255, 255, 255, 0.12);
  --color-text: #f5f7ff;
  --color-subtle: rgba(245, 247, 255, 0.75);
  --color-accent: #7c9bff;
  --color-accent-strong: #4c6dff;
  --color-error: #ff6f6f;
  --color-success: #7affc8;
  --shadow-elevated: 0 30px 70px rgba(8, 12, 35, 0.45);
  --radius-lg: 1.5rem;
  --radius-md: 0.9rem;
  --spacing-xl: clamp(3rem, 5vw + 1rem, 6rem);
  --spacing-lg: clamp(1.5rem, 3vw + 0.5rem, 3rem);
  --spacing-md: 1.25rem;
  --spacing-sm: 0.85rem;
  --spacing-xs: 0.6rem;
  color-scheme: dark;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-background);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

body::before {
  background: radial-gradient(circle at 20% 20%, rgba(124, 155, 255, 0.45), transparent 60%),
    radial-gradient(circle at 80% 10%, rgba(196, 115, 255, 0.4), transparent 65%);
}

body::after {
  background: linear-gradient(120deg, rgba(22, 25, 45, 0.9), rgba(8, 9, 18, 0.95));
  mix-blend-mode: multiply;
}

.page-background,
.page-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.page-background {
  background: repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 2px,
      transparent 2px,
      transparent 24px
    ),
    linear-gradient(140deg, rgba(88, 130, 255, 0.12), rgba(255, 255, 255, 0));
  z-index: -3;
}

.page-overlay {
  backdrop-filter: blur(70px);
  z-index: -1;
}

.page-header,
.page-footer {
  width: min(1200px, 92vw);
  margin: 0 auto;
  padding: var(--spacing-lg) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  position: relative;
  z-index: 2;
}

.page-header {
  padding-top: clamp(1.5rem, 3vw, 3.5rem);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.brand__logo {
  width: clamp(48px, 5vw, 64px);
  height: clamp(48px, 5vw, 64px);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 20px 40px rgba(12, 14, 28, 0.35);
  background: rgba(7, 8, 16, 0.6);
}

.brand__text {
  display: flex;
  flex-direction: column;
  font-weight: 500;
}

.brand__eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-subtle);
}

.brand__title {
  font-size: clamp(1rem, 2vw + 0.5rem, 1.5rem);
  color: var(--color-text);
}

.support-link {
  color: var(--color-subtle);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.support-link:hover,
.support-link:focus-visible {
  color: #ffffff;
  text-decoration: underline;
}

.page-main {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl) 0;
}

.login-shell {
  width: min(1200px, 92vw);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 3vw, 3.5rem);
  align-items: stretch;
  position: relative;
  z-index: 2;
}

.login-shell__intro,
.login-shell__form {
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 4vw, 3rem);
  box-shadow: var(--shadow-elevated);
}

.login-shell__intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--spacing-lg);
  background: linear-gradient(135deg, rgba(21, 27, 48, 0.9), rgba(13, 17, 34, 0.75));
}

.login-shell__intro h1 {
  font-size: clamp(2.4rem, 4vw + 1rem, 3.4rem);
  line-height: 1.1;
}

.intro-lede {
  font-size: 1.05rem;
  color: var(--color-subtle);
  line-height: 1.6;
}

.benefits {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.benefits li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--spacing-sm);
  align-items: start;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.benefit-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.benefits h2 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.benefits p {
  font-size: 0.95rem;
  color: var(--color-subtle);
  line-height: 1.5;
}

.login-shell__form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  backdrop-filter: blur(18px);
}

.stepper {
  list-style: none;
  display: flex;
  gap: var(--spacing-md);
  padding: 0;
  margin: 0;
}

.stepper__item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  position: relative;
  color: rgba(245, 247, 255, 0.6);
  font-size: 0.9rem;
}

.stepper__item::after {
  content: "";
  position: absolute;
  top: 50%;
  right: calc(var(--spacing-sm) * -1);
  width: var(--spacing-md);
  height: 2px;
  background: rgba(245, 247, 255, 0.2);
  transform: translateY(-50%);
}

.stepper__item:last-child::after {
  display: none;
}

.stepper__badge {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(245, 247, 255, 0.15);
  border: 1px solid rgba(245, 247, 255, 0.25);
  font-weight: 600;
  color: inherit;
}

.stepper__item.is-active {
  color: #ffffff;
}

.stepper__item.is-active .stepper__badge {
  background: linear-gradient(135deg, #7c9bff, #9ed2ff);
  color: #040512;
  border-color: transparent;
}

.stepper__item.is-complete {
  color: rgba(124, 155, 255, 0.85);
}

.stepper__item.is-complete .stepper__badge {
  background: rgba(124, 155, 255, 0.25);
  color: #ffffff;
  border-color: rgba(124, 155, 255, 0.4);
}

.stepper__item.is-complete::after {
  background: linear-gradient(135deg, rgba(124, 155, 255, 0.6), rgba(158, 210, 255, 0.6));
}

form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.step-panel {
  display: none;
  flex-direction: column;
  gap: var(--spacing-md);
}

.step-panel.is-active {
  display: flex;
}

.step-panel__header h3 {
  font-size: clamp(1.2rem, 1vw + 1rem, 1.5rem);
  margin-bottom: 0.4rem;
}

.step-panel__header p {
  color: var(--color-subtle);
  font-size: 0.95rem;
  line-height: 1.5;
}

.form-heading h2 {
  font-size: clamp(1.6rem, 2vw + 0.75rem, 2rem);
}

.form-heading p {
  color: var(--color-subtle);
  font-size: 0.98rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.field label {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.field input {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 10, 20, 0.85);
  color: var(--color-text);
  font-size: 1rem;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(124, 155, 255, 0.35);
}

.code-input {
  display: flex;
  align-items: center;
  background: rgba(8, 10, 20, 0.85);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.code-prefix {
  padding: 0.85rem 1rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--color-subtle);
}

.code-input input {
  flex: 1;
  border: none;
  background: transparent;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.field-hint {
  font-size: 0.85rem;
  color: rgba(245, 247, 255, 0.6);
}

.error-message {
  min-height: 1.1rem;
  font-size: 0.85rem;
  color: var(--color-error);
}

.field.has-error input,
.field.has-error .code-input {
  border-color: rgba(255, 111, 111, 0.8);
}

.field.has-error input:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 111, 111, 0.35);
}

.primary-btn {
  border: none;
  border-radius: var(--radius-md);
  padding: 0.95rem 1.2rem;
  font-weight: 600;
  font-size: 1.02rem;
  color: #040512;
  background: linear-gradient(135deg, #7c9bff, #9ed2ff);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.primary-btn:hover:not(:disabled),
.primary-btn:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 15px 30px rgba(124, 155, 255, 0.35);
  filter: brightness(1.05);
}

.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.status {
  min-height: 1.2rem;
  font-size: 0.95rem;
  color: var(--color-subtle);
}

.status--success {
  color: var(--color-success);
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.secondary-btn {
  border: 1px solid rgba(245, 247, 255, 0.22);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.2rem;
  font-weight: 500;
  font-size: 0.95rem;
  background: rgba(8, 10, 20, 0.65);
  color: var(--color-text);
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease;
}

.secondary-btn:hover,
.secondary-btn:focus-visible {
  border-color: rgba(124, 155, 255, 0.7);
  background: rgba(20, 25, 45, 0.8);
}

.terms-scroll,
.instructions-scroll {
  max-height: 260px;
  overflow-y: auto;
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  background: rgba(8, 10, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--color-subtle);
  line-height: 1.55;
}

.terms-scroll ul,
.instructions-scroll ul,
.instructions-scroll ol {
  margin-left: 1.25rem;
}

.terms-scroll li,
.instructions-scroll li {
  margin-bottom: 0.6rem;
}

.instructions-scroll li ul {
  margin-top: 0.4rem;
}

.instructions-scroll li strong {
  color: #ffffff;
}

.instructions-scroll a {
  color: #ffffff;
  text-decoration: underline;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.95rem;
  color: var(--color-subtle);
}

.checkbox input {
  width: 18px;
  height: 18px;
  accent-color: #7c9bff;
}

.step-note {
  font-size: 0.95rem;
  color: var(--color-subtle);
  line-height: 1.6;
}

.help-card {
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-subtle);
  font-size: 0.95rem;
  line-height: 1.5;
}

.help-card a {
  color: #ffffff;
  text-decoration: underline;
}

.page-footer {
  font-size: 0.85rem;
  color: rgba(235, 238, 255, 0.6);
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: var(--spacing-sm);
}

.footer-links a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: #ffffff;
  text-decoration: underline;
}

@media (max-width: 960px) {
  .page-header,
  .page-footer,
  .login-shell {
    width: min(640px, 90vw);
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-shell__intro {
    order: 1;
  }

  .login-shell__form {
    order: 2;
  }

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

  .stepper__item {
    width: 100%;
    padding-bottom: 0.25rem;
  }

  .stepper__item::after {
    display: none;
  }
}

@media (max-width: 600px) {
  .page-header,
  .page-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand__title {
    font-size: 1.25rem;
  }

  .login-shell__intro,
  .login-shell__form {
    padding: clamp(1.6rem, 5vw, 2.2rem);
  }

  .benefits li {
    grid-template-columns: 1fr;
  }

  .code-input {
    flex-direction: row;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions .primary-btn,
  .actions .secondary-btn {
    width: 100%;
    text-align: center;
  }
}
