/* Shared look for the registration form + admin page.
   Tokens, fonts and control styles mirror the NIDA landing (src/styles/*). */

@font-face {
  font-family: 'Sora';
  src: url('fonts/Sora.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Sans Georgian';
  src: url('fonts/NotoSansGeorgian.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+10A0-10FF, U+1C90-1CBF, U+2D00-2D2F;
}

:root {
  --primary-blue: #1154e2;
  --deep-navy: #0b348e;
  --accent-teal: #09688b;
  --accent-indigo: #4c41c8;

  --button-hover: #0e46be;
  --button-active: #0b348e;

  --wash-sky: #d9e4fc;
  --wash-teal: #d6f1fa;
  --wash-slate: #e8ebf3;
  --wash-indigo: #e3e1fa;

  --neutral-01: #ffffff;
  --neutral-02: #f4f6fa;
  --neutral-03: #596378;
  --neutral-04: #121b2b;
  --neutral-05: #d6dbe6;
  --border: #e1e6ef;
  --error: #fb6668;
  --danger: #ba303c;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-3xl: 32px;
  --radius-pill: 9999px;

  --page-inline-padding: clamp(20px, 5vw, 72px);
  --font-family-sora: 'Sora', 'Noto Sans Georgian', sans-serif;

  --fs-display: clamp(24px, min(2.5vw + 24px, 8vw + 6px), 56px);
  --fs-h1: clamp(20px, min(1.5vw + 22px, 6vw + 4px), 40px);
  --fs-h2: clamp(18px, min(0.5vw + 22px, 5vw + 4px), 28px);
  --fs-h4: clamp(17px, min(0.25vw + 17px, 2.5vw + 8px), 20px);
  --fs-lead: clamp(16px, min(0.37vw + 15.5px, 2.5vw + 7px), 20px);
  --fs-base: clamp(13px, 2.5vw + 6px, 16px);
  --fs-small: clamp(13px, 1.25vw + 9px, 14px);
  --fs-caption: clamp(12px, 1.25vw + 8px, 13px);
  --fs-xs: clamp(11px, 1.25vw + 7px, 12px);
  --fs-brand: clamp(20px, 5vw + 4px, 24px);

  /* Mtavruli headings run ~1.4× wider than Latin, same as html:lang(ka) in the app */
  --heading-scale: 0.92;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  font-family: var(--font-family-sora);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--neutral-04);
  background: var(--neutral-02);
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: var(--primary-blue);
}

/* ─── Page frame ─────────────────────────────────────────────────────────── */

.page {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 24px var(--page-inline-padding) 48px;
  /* clip, not hidden: a hidden box can still be scrolled sideways by focus()
     or scrollIntoView() when a wide table sits inside it */
  overflow: clip;
}

/* Soft blue blobs behind the card, like the app's page backdrop */
.page::before,
.page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.page::before {
  width: 520px;
  height: 520px;
  top: -200px;
  right: -120px;
  background: var(--wash-sky);
}

.page::after {
  width: 420px;
  height: 420px;
  bottom: -180px;
  left: -140px;
  background: var(--wash-indigo);
}

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.logo {
  display: inline-flex;
  flex-shrink: 0;
}

.logo img {
  display: block;
  width: 160px;
  height: 40px;
}

@media (width < 600px) {
  .logo img {
    width: 136px;
    height: 34px;
  }
}

.main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.main-narrow {
  max-width: 640px;
  padding-top: 24px;
}

.main-wide {
  max-width: 1280px;
  padding-top: 16px;
}

.intro {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.eyebrow {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.35;
  color: var(--primary-blue);
}

.page-title {
  margin: 0;
  font-size: calc(var(--fs-h1) * var(--heading-scale));
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--neutral-04);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.page-lead {
  margin: 0;
  color: var(--neutral-03);
  text-wrap: pretty;
}

/* ─── Card ───────────────────────────────────────────────────────────────── */

.card {
  background: var(--neutral-01);
  border-radius: var(--radius-3xl);
  box-shadow: 0 24px 64px rgba(18, 27, 43, 0.06);
  padding: 40px;
}

@media (width < 500px) {
  .card {
    padding: 24px;
    border-radius: var(--radius-2xl);
  }
}

/* ─── Form ───────────────────────────────────────────────────────────────── */

.form-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (width < 500px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field-label {
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.4;
  color: var(--neutral-04);
}

.form-field-label-hint {
  font-weight: 400;
  font-size: var(--fs-caption);
  color: var(--neutral-03);
}

.form-field :where(input, textarea, select) {
  font-family: var(--font-family-sora);
  /* 16px minimum: iOS Safari zooms the page into any focused control set smaller */
  font-size: 16px;
  line-height: 1.5;
  width: 100%;
  padding: 14px 20px;
  background: var(--neutral-01);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  color: var(--neutral-04);
  outline: none;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.form-field :where(input, textarea, select)::placeholder {
  color: var(--neutral-03);
}

.form-field :where(input, textarea, select):focus-visible {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px var(--wash-sky);
}

.form-field textarea {
  resize: none;
  min-height: 120px;
}

.form-field input[type='number'] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.form-field input[type='number']::-webkit-outer-spin-button,
.form-field input[type='number']::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.form-field.has-error :where(input, textarea, select) {
  border-color: var(--error);
}

.form-field.has-error :where(input, textarea, select):focus-visible {
  box-shadow: 0 0 0 3px rgba(251, 102, 104, 0.2);
}

.form-field-hint,
.form-field-error {
  font-size: var(--fs-caption);
  line-height: 1.4;
  min-height: 1.4em;
}

.form-field-hint {
  color: var(--neutral-03);
}

.form-field-error {
  font-weight: 500;
  color: var(--error);
}

.form-field-error:empty {
  display: none;
}

.form-field.has-error .form-field-hint {
  display: none;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

@media (width < 500px) {
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

.form-status {
  margin: 0;
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.4;
}

.form-status:empty {
  display: none;
}

.form-status.is-success {
  color: var(--accent-teal);
}

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

/* Full-card success state after a submit */
.success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 16px 0;
}

.success-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--wash-teal);
  color: var(--accent-teal);
}

.success-icon svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.success-title {
  margin: 0;
  font-size: calc(var(--fs-h2) * var(--heading-scale));
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.success-text {
  margin: 0;
  color: var(--neutral-03);
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 48px;
  border: 1.5px solid transparent;
  border-radius: 80px;
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
  text-align: center;
  transition: 200ms ease-in-out;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  padding: 0 8px 0 20px;
  background: var(--primary-blue);
  color: var(--neutral-02);
}

.btn-primary:hover:not(:disabled) {
  background: var(--button-hover);
}

.btn-primary:active:not(:disabled) {
  background: var(--button-active);
}

.btn-primary .btn-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 8px;
  background: var(--neutral-02);
  color: var(--primary-blue);
}

.btn-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.btn-secondary {
  padding-inline: 24px;
  background: var(--neutral-02);
  color: var(--neutral-03);
}

.btn-secondary:hover:not(:disabled) {
  color: var(--primary-blue);
}

.btn-secondary:active:not(:disabled) {
  background: var(--wash-slate);
  color: var(--neutral-04);
}

.btn-ghost {
  height: 40px;
  padding-inline: 12px;
  gap: 8px;
  color: var(--neutral-04);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(18, 27, 43, 0.05);
}

.btn-sm {
  height: 40px;
  font-size: var(--fs-small);
}

.btn.is-loading .btn-icon {
  animation: spin 800ms linear infinite;
}

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

/* ─── Admin ──────────────────────────────────────────────────────────────── */

.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.admin-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search {
  position: relative;
}

.search input {
  font-family: var(--font-family-sora);
  font-size: 16px;
  height: 48px;
  width: min(320px, 70vw);
  padding: 0 20px 0 44px;
  background: var(--neutral-01);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--neutral-04);
  outline: none;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.search input:focus-visible {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px var(--wash-sky);
}

.search svg {
  position: absolute;
  left: 16px;
  top: 50%;
  translate: 0 -50%;
  width: 18px;
  height: 18px;
  stroke: var(--neutral-03);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  pointer-events: none;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat {
  background: var(--neutral-01);
  border-radius: var(--radius-2xl);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: var(--fs-caption);
  color: var(--neutral-03);
}

.stat-value {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--neutral-04);
}

.table-card {
  padding: 0;
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
}

th,
td {
  text-align: left;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--neutral-03);
  background: var(--neutral-02);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(17, 84, 226, 0.03);
}

td.cell-name {
  font-weight: 600;
  white-space: nowrap;
}

td.cell-comment {
  min-width: 220px;
  max-width: 420px;
  color: var(--neutral-03);
  white-space: pre-wrap;
}

td.cell-date {
  white-space: nowrap;
  color: var(--neutral-03);
}

td a {
  color: var(--primary-blue);
  text-decoration: none;
  white-space: nowrap;
}

td a:hover {
  text-decoration: underline;
}

.empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--neutral-03);
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--wash-sky);
  color: var(--primary-blue);
  font-size: var(--fs-caption);
  font-weight: 600;
  white-space: nowrap;
}

.chip-muted {
  background: var(--wash-slate);
  color: var(--neutral-03);
}

/* Login card */
.login {
  max-width: 440px;
  margin: 48px auto 0;
  width: 100%;
}

.login .form-body {
  gap: 20px;
}

.login-title {
  margin: 0 0 24px;
  font-size: calc(var(--fs-h2) * var(--heading-scale));
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.hidden {
  display: none !important;
}

.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ─── Admin: tabs, analytics, details ────────────────────────────────────── */

.topbar {
  gap: 24px;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--neutral-01);
  border-radius: var(--radius-pill);
  margin-right: auto;
}

.tab {
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--neutral-03);
  transition: 150ms ease;
}

.tab:hover {
  color: var(--primary-blue);
}

.tab.is-active {
  background: var(--primary-blue);
  color: var(--neutral-01);
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.notice {
  margin: 0;
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  background: var(--wash-sky);
  color: var(--deep-navy);
  font-size: var(--fs-small);
}

.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  background: var(--neutral-01);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.segmented button {
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--neutral-03);
}

.segmented button.is-active {
  background: var(--wash-sky);
  color: var(--primary-blue);
}

.stats-dense {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stats-dense .stat-value {
  font-size: 26px;
}

.stat-sub {
  font-size: var(--fs-xs);
  color: var(--neutral-03);
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--neutral-05);
  vertical-align: middle;
}

.live-dot.is-on {
  background: #0d9488;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.18);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.grid-2 .card,
.grid-3 .card,
.panel > .card {
  padding: 24px;
  border-radius: var(--radius-2xl);
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.card-head-pad {
  padding: 24px 24px 0;
}

.card-title {
  margin: 0;
  font-size: var(--fs-h4);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.card-sub {
  font-size: var(--fs-caption);
  color: var(--neutral-03);
}

/* Charts */
.legend {
  display: flex;
  gap: 16px;
  font-size: var(--fs-caption);
  color: var(--neutral-03);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.s-visits {
  background: var(--primary-blue);
}

.s-regs {
  background: #0d9488;
}

.chart {
  height: 200px;
}

.plot {
  height: 100%;
  display: flex;
  align-items: stretch;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}

.col {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding-bottom: 20px;
  border-radius: 6px;
}

.col:hover {
  background: rgba(17, 84, 226, 0.04);
}

.bar {
  display: block;
  width: 100%;
  max-width: 24px;
  border-radius: 4px 4px 0 0;
  transition: height 300ms ease;
}

.col-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  color: var(--neutral-03);
  white-space: nowrap;
}

.tooltip {
  position: fixed;
  z-index: 50;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--neutral-04);
  color: var(--neutral-01);
  font-size: var(--fs-caption);
  line-height: 1.5;
  white-space: pre-line;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(18, 27, 43, 0.2);
}

/* Funnel + breakdown rows */
.funnel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.funnel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: var(--fs-small);
}

.funnel-label {
  font-weight: 600;
}

.funnel-value {
  color: var(--neutral-03);
  text-align: right;
}

.funnel-track,
.bd-track,
.mini-bar-track {
  display: block;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--wash-slate);
  overflow: hidden;
}

.funnel-fill,
.bd-fill,
.mini-bar-fill {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--primary-blue);
  transition: width 300ms ease;
}

.breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bd-row,
.mini-bar {
  display: grid;
  grid-template-columns: minmax(80px, 38%) 1fr auto;
  align-items: center;
  gap: 12px;
  font-size: var(--fs-caption);
}

.bd-label,
.mini-bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bd-value,
.mini-bar-value {
  color: var(--neutral-03);
  white-space: nowrap;
}

.mini-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Table extras */
.cell-muted {
  color: var(--neutral-03);
  white-space: nowrap;
}

.cell-sub {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--neutral-03);
}

.cell-more {
  text-align: right;
  white-space: nowrap;
}

.cell-nowrap {
  white-space: nowrap;
}

.expand {
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--primary-blue);
}

.expand:hover {
  background: var(--wash-sky);
}

.chip-good {
  background: #d5f5ef;
  color: #0b6b62;
}

.chip-warn {
  background: #fdecd9;
  color: #9a4a06;
}

.detail-row td {
  padding: 0 20px 20px;
  background: var(--neutral-02);
}

.detail {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--neutral-01);
}

.detail-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.detail-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.detail-title {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--neutral-03);
}

.detail-list {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  font-size: var(--fs-caption);
}

.detail-list dt {
  color: var(--neutral-03);
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-errors {
  margin: 0;
  padding-left: 18px;
  font-size: var(--fs-caption);
  color: var(--danger);
}

.detail-empty {
  margin: 0;
  font-size: var(--fs-caption);
  color: var(--neutral-03);
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  font-size: var(--fs-caption);
}

.tl-item {
  display: grid;
  grid-template-columns: 64px auto 1fr;
  gap: 10px;
  align-items: baseline;
}

.tl-time {
  color: var(--neutral-03);
  font-variant-numeric: tabular-nums;
}

.tl-type {
  font-weight: 600;
}

.tl-detail {
  color: var(--neutral-03);
  overflow-wrap: anywhere;
}

.tl-submit_success .tl-type {
  color: #0b6b62;
}

.tl-validation_error .tl-type,
.tl-submit_error .tl-type {
  color: var(--danger);
}

@media (width < 768px) {
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding-block: 12px;
  }

  .tabs {
    order: 3;
    width: 100%;
    margin-right: 0;
  }

  .tab {
    flex: 1;
  }
}

/* ─── Registration page ──────────────────────────────────────────────────── */

.reg-page {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 var(--page-inline-padding) 56px;
  overflow: clip;
  background: var(--neutral-02);
}

/* Blob-and-grid backdrop, same recipe as the app's hero background:
   three soft radial washes, a hairline grid and a fade into the band. */
.backdrop {
  position: absolute;
  inset: 0;
  height: min(720px, 100%);
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  --a: calc(var(--alpha) * var(--peak));
  background: radial-gradient(
    50% 50%,
    rgb(var(--rgb) / var(--a)) 0%,
    rgb(var(--rgb) / calc(var(--a) * 0.88)) 20%,
    rgb(var(--rgb) / calc(var(--a) * 0.59)) 40%,
    rgb(var(--rgb) / calc(var(--a) * 0.3)) 60%,
    rgb(var(--rgb) / calc(var(--a) * 0.11)) 80%,
    transparent 100%
  );
}

.blob-primary {
  --rgb: 17 84 226;
  --alpha: 0.38;
  --peak: 0.52;
  width: 760px;
  height: 760px;
  top: -220px;
  left: -160px;
}

.blob-indigo {
  --rgb: 76 65 200;
  --alpha: 0.34;
  --peak: 0.44;
  width: 640px;
  height: 640px;
  top: -140px;
  right: -120px;
}

.blob-teal {
  --rgb: 9 104 139;
  --alpha: 0.28;
  --peak: 0.38;
  width: 560px;
  height: 560px;
  bottom: -260px;
  right: 180px;
}

.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(17, 84, 226, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(17, 84, 226, 0.07) 1px, transparent 1px);
  background-size: calc(100% / 15) calc(100% / 7);
}

.fade {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 200px;
  background: linear-gradient(transparent, var(--neutral-02));
}

.reg-topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  height: 88px;
}

.reg-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1120px;
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
  align-items: start;
  gap: 64px;
}

/* Left rail */
.rail {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding-top: 24px;
}

.rail-intro {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rail-title {
  margin: 0;
  font-size: calc(var(--fs-display) * var(--heading-scale));
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.07;
  color: var(--neutral-04);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.rail-lead {
  margin: 0;
  max-width: 38ch;
  font-size: var(--fs-lead);
  letter-spacing: -0.01em;
  line-height: 1.4;
  color: var(--neutral-03);
  text-wrap: pretty;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--neutral-01);
  color: var(--primary-blue);
  font-size: var(--fs-small);
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(18, 27, 43, 0.06);
}

.step-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 6px;
  font-size: var(--fs-base);
  line-height: 1.45;
}

.step-text strong {
  font-weight: 600;
  color: var(--neutral-04);
}

.step-text span {
  font-size: var(--fs-small);
  color: var(--neutral-03);
}

.rail-meta {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--neutral-03);
}

.rail-meta svg {
  width: 16px;
  height: 16px;
  stroke: var(--primary-blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* Card and form */
.reg-card {
  padding: 40px;
}

.reg-card .form-body {
  gap: 20px;
}

.form-row-age {
  grid-template-columns: minmax(120px, 0.45fr) 1fr;
}

.reg-card .form-field-label {
  font-size: var(--fs-small);
}

.reg-card .form-actions {
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}

.reg-card .form-status {
  order: -1;
  flex: 1;
}

.reg-card .form-status:empty {
  display: block;
}

.reg-card .btn-primary {
  margin-left: auto;
}

/* One reveal on load; nothing else moves on its own */
@media (prefers-reduced-motion: no-preference) {
  .rail-intro,
  .steps,
  .rail-meta,
  .reg-card {
    animation: reg-in 600ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .steps {
    animation-delay: 80ms;
  }

  .rail-meta {
    animation-delay: 160ms;
  }

  .reg-card {
    animation-delay: 120ms;
  }
}

@keyframes reg-in {
  from {
    opacity: 0;
    translate: 0 12px;
  }

  to {
    opacity: 1;
    translate: 0 0;
  }
}

@media (width < 960px) {
  .reg-content {
    grid-template-columns: 1fr;
    gap: 32px;
    margin-top: 8px;
  }

  .rail {
    gap: 24px;
    padding-top: 0;
  }

  .steps {
    gap: 12px;
  }

  .rail-meta {
    display: none;
  }
}

@media (width < 600px) {
  .reg-page {
    padding-bottom: 32px;
  }

  .reg-topbar {
    height: 72px;
  }

  .reg-card {
    padding: 24px;
    border-radius: var(--radius-2xl);
  }

  .form-row-age {
    grid-template-columns: 1fr;
  }

  .reg-card .form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .reg-card .btn-primary {
    margin-left: 0;
  }

  .reg-card .form-status:empty {
    display: none;
  }

  .steps {
    display: grid;
    grid-template-columns: 1fr;
  }
}
