@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --bg: #f4f7fc;
  --bg-gradient-a: #dbeafe;
  --bg-gradient-b: #dcfce7;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --line: #dbe3ef;
  --primary: #2563eb;
  --primary-press: #1d4ed8;
  --primary-ink: #ffffff;
  --accent: #16a34a;
  --accent-soft: #dcfce7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --muted-bg: #f8fafc;
  --focus-ring: rgba(37, 99, 235, 0.28);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 0%, var(--bg-gradient-a) 0%, transparent 40%),
    radial-gradient(circle at 100% 0%, var(--bg-gradient-b) 0%, transparent 35%),
    var(--bg);
}

.shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 14px;
}

.card {
  width: min(920px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow:
    0 1px 1px rgba(15, 23, 42, 0.03),
    0 18px 40px rgba(15, 23, 42, 0.12);
}

.hero {
  margin-bottom: 24px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #f8fbff 0%, #f6fff9 100%);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--primary-ink);
  background: linear-gradient(145deg, var(--primary) 0%, #3b82f6 100%);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.brand-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 11px;
}

.brand-subtitle {
  margin: 2px 0 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

h1 {
  margin: 12px 0 0 0;
  font-size: clamp(1.65rem, 4vw, 2.2rem);
  line-height: 1.15;
}

.lead {
  margin: 10px 0 0 0;
  color: var(--muted);
}

.step {
  animation: fadein 180ms ease-out;
}

h2 {
  margin: 0 0 8px 0;
  font-size: 1.2rem;
}

.step-lead {
  margin: 0 0 14px 0;
  color: var(--muted);
}

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

.selected-type {
  margin: 0 0 12px 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.selector-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.selector-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  text-align: left;
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.selector-card:hover {
  border-color: #9db3d6;
  transform: translateY(-1px);
}

.selector-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.selector-title {
  font-weight: 700;
}

.selector-desc {
  color: var(--muted);
  font-size: 0.95rem;
}

.block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin: 14px 0;
  background: #fff;
}

.block legend {
  padding: 0 6px;
  font-weight: 700;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

input,
select {
  width: 100%;
  border: 1px solid #9db3d6;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
  color: var(--ink);
  background: #ffffff;
}

input.field-invalid,
select.field-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.2);
}

.field-error {
  display: block;
  min-height: 18px;
  font-size: 0.82rem;
  line-height: 1.2;
  color: var(--danger);
}

#registration_code {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 700;
  text-align: center;
}

input:focus,
select:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--primary);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.policy {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--muted-bg);
}

.policy summary {
  cursor: pointer;
  font-weight: 600;
}

.policy-body {
  margin-top: 10px;
  color: #334155;
  max-height: 240px;
  overflow: auto;
  padding-right: 6px;
}

.checkbox {
  margin-top: 14px;
  margin-bottom: 0;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}

.checkbox input {
  width: auto;
  margin-top: 3px;
}

.submit {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 700;
  font-size: 16px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 120ms ease, transform 120ms ease;
}

.submit:hover:enabled {
  background: var(--primary-press);
  transform: translateY(-1px);
}

.submit:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.actions {
  margin-top: 10px;
}

.ghost {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.ghost:hover {
  border-color: #9db3d6;
}

.status {
  min-height: 24px;
  margin: 12px 0 0 0;
  font-weight: 600;
  border-radius: 10px;
  padding: 0;
}

.status.error {
  color: var(--danger);
  background: var(--danger-soft);
  padding: 8px 10px;
}

.status.ok {
  color: var(--ok);
  background: var(--ok-soft);
  padding: 8px 10px;
}

.muted {
  color: var(--muted);
}

@keyframes fadein {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

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

@media (max-width: 720px) {
  .card {
    padding: 16px;
    border-radius: 12px;
  }

  .selector-cards,
  .grid {
    grid-template-columns: 1fr;
  }

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

  .ghost {
    width: 100%;
  }
}
