:root {
  --bg-dark: #030d2a;
  --bg-mid: #061a50;
  --badge-text: #0b2e6b;
  --panel-border: rgba(141, 173, 255, 0.25);
  --text: #f4f8ff;
  --muted: #9db4e6;
  --primary: #2d74ff;
  --ok: #7ce26f;
  --danger: #ff7c9b;
  --radius-xl: 24px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Inter, "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 12%, rgba(45, 116, 255, 0.3), transparent 28%),
    radial-gradient(circle at 84% 84%, rgba(18, 174, 255, 0.22), transparent 34%),
    linear-gradient(180deg, var(--bg-mid) 0%, var(--bg-dark) 70%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(104, 146, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(104, 146, 255, 0.18) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 85%);
}

.registration-shell,
.login-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 52px;
  position: relative;
  z-index: 1;
}

.registration-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
}

.brand-lockup {
  display: grid;
  gap: 6px;
}

.brand-logo {
  width: auto;
  height: 30px;
  object-fit: contain;
}

.login-logo {
  margin-bottom: 10px;
}

.header-tag {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
}

.registration-header h1,
.login-panel h1 {
  margin: 4px 0 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.session-badge {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(156, 190, 255, 0.4);
  background: rgba(5, 24, 68, 0.8);
  color: #d8e6ff;
  font-size: 0.84rem;
  font-weight: 600;
}

.wizard-card,
.login-panel {
  background: linear-gradient(180deg, rgba(6, 28, 84, 0.9) 0%, rgba(3, 14, 46, 0.95) 100%);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.4);
}

.wizard-card {
  max-width: 620px;
  margin: 0 auto;
  overflow: hidden;
  animation: rise 380ms ease both;
}

.wizard-topbar {
  text-align: center;
  background: rgba(2, 10, 34, 0.95);
  border-bottom: 1px solid rgba(144, 172, 242, 0.2);
  color: #e0ecff;
  font-size: 0.73rem;
  letter-spacing: 0.04em;
  padding: 8px 16px;
}

.wizard-form {
  padding: 22px 26px 26px;
  display: grid;
  gap: 12px;
}

.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.step-title {
  margin: 0;
  font-size: 2rem;
  line-height: 1.2;
  color: #edf4ff;
}

.step-badge {
  color: var(--badge-text);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  min-height: 28px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

.step-pane {
  display: none;
  gap: 10px;
}

.step-pane.is-active {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 10px;
}

.modality-row,
.step-pane.is-active .field:first-child,
.step-pane.is-active .field textarea,
.step-pane.is-active .review-box {
  grid-column: 1 / -1;
}

.modality-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  flex-direction: column;
}

.modality-title {
  color: #d7e6ff;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.modality-options {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2px;
  flex-direction: column;
  flex-wrap: nowrap;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: #cce0ff;
  font-size: 0.82rem;
  border-radius: 10px;
  padding: 4px 8px;
  white-space: nowrap;
}

.radio-option:hover {
  background: rgba(45, 116, 255, 0.14);
}

.radio-option input {
  accent-color: #2d74ff;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: #b7cbf3;
  font-size: 0.8rem;
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid rgba(147, 180, 248, 0.35);
  border-radius: var(--radius-md);
  min-height: 38px;
  padding: 9px 12px;
  background: rgba(2, 14, 46, 0.75);
  color: #f2f7ff;
  font: inherit;
  transition: border-color 170ms ease, box-shadow 170ms ease;
}

.field textarea {
  min-height: 136px;
  resize: vertical;
}

.field-hint {
  color: #8ea7d9;
  font-size: 0.72rem;
  line-height: 1.35;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(88, 141, 255, 0.95);
  box-shadow: 0 0 0 3px rgba(45, 116, 255, 0.22);
}

.review-box {
  border: 1px dashed rgba(126, 171, 255, 0.42);
  border-radius: var(--radius-md);
  padding: 12px;
  background: rgba(0, 10, 30, 0.55);
}

.review-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.review-box p + p {
  margin-top: 8px;
}

.terms-block {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(126, 171, 255, 0.35);
  border-radius: var(--radius-md);
  padding: 14px;
  background: rgba(0, 10, 30, 0.45);
}

.terms-block h3 {
  margin: 0;
  font-size: 1rem;
  color: #edf4ff;
}

.terms-subtitle {
  margin: 0;
  color: #bdd0f6;
  font-size: 0.86rem;
  line-height: 1.35;
}

.terms-block p {
  margin: 0;
  color: #d8e6ff;
  font-size: 0.82rem;
  line-height: 1.45;
}

.terms-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #e8f0ff;
  font-size: 0.86rem;
}

.terms-check input {
  margin-top: 2px;
  accent-color: #2d74ff;
}

.form-message {
  min-height: 20px;
  margin: 0;
  font-size: 0.83rem;
  font-weight: 700;
}

.form-message.is-success {
  color: var(--ok);
}

.form-message.is-error {
  color: var(--danger);
}

.wizard-footer {
  display: grid;
  gap: 10px;
}

.wizard-footer.is-dual {
  grid-template-columns: 1fr 1fr;
}

.wizard-footer .button {
  width: 100%;
}

.button {
  border: 1px solid transparent;
  border-radius: 999px;
  min-height: 36px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 170ms ease, opacity 170ms ease, background-color 170ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.button.primary {
  background: linear-gradient(135deg, var(--primary) 0%, #0f57de 100%);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(45, 116, 255, 0.34);
}

.button.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.9);
  color: #ffffff;
}

.button.subtle {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(168, 192, 245, 0.3);
  color: #edf4ff;
}

#next-button {
  min-width: 148px;
}

.success-view {
  padding: 34px 24px 30px;
  text-align: center;
  display: grid;
  gap: 12px;
}

.success-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  object-fit: contain;
  display: block;
}

.success-view h2 {
  margin: 0;
  font-size: 1.2rem;
}

.success-view p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(430px, 100%);
  padding: 24px;
}

.eyebrow {
  margin: 0;
  color: #9cbaf3;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.hero-text {
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 12px;
}

.full-width {
  width: 100%;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 1200px) {
  .wizard-card {
    max-width: 700px;
  }
}

@media (max-width: 760px) {
  .wizard-card {
    max-width: 520px;
  }

  .wizard-form {
    padding: 18px 20px 22px;
  }

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

@media (max-width: 640px) {
  .registration-shell,
  .login-shell {
    width: min(100% - 18px, 100%);
    padding-top: 16px;
  }

  .registration-header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .brand-logo {
    height: 26px;
  }

  .header-actions {
    width: 100%;
  }

  .button {
    flex: 1;
  }

  .wizard-footer .button.primary {
    flex: 2;
  }
}
