.registration-page {
  --register-ink: #352046;
  background: #f5f7f9;
}

.registration-page .site-header {
  position: sticky;
  top: 0;
  flex-wrap: nowrap;
  gap: 12px;
  padding-block: 0;
}

.registration-page .site-header .brand { min-width: 0; }
.registration-page .site-header .brand img { height: 62px; }

.register-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--purple-dark);
  font-size: 15px;
  font-weight: 800;
}

.register-nav-link:hover { text-decoration: underline; }
.registration-page main { padding-top: 0; }

.registration-page .registration-section {
  grid-template-columns: minmax(220px, .68fr) minmax(0, 1.4fr);
  align-items: start;
  gap: 24px 48px;
  max-width: 1260px;
  margin-inline: auto;
  padding: 38px var(--page-gutter) 24px;
  background: none;
}

.registration-page .registration-intro { position: static; max-width: none; text-align: left; }
.registration-intro .register-kicker { margin: 0 0 8px; color: #226f64; font-size: 15px; font-weight: 800; }
.registration-page .registration-intro h1 { font-size: 42px; line-height: 1.08; letter-spacing: 0; }
.registration-page .registration-intro h1 + p { margin: 12px 0 0; font-size: 18px; }

.registration-page #petForm.form-panel {
  width: 100%;
  max-width: none;
  padding: 24px;
  box-shadow: 0 12px 32px #3320470d;
  scroll-margin-top: 80px;
}

.registration-page .stepper-progress {
  padding: 0;
  gap: 0;
  margin-bottom: 22px;
}

.registration-page .stepper-line,
.registration-page .stepper-fill {
  left: calc(100% / 6);
  top: 16px;
}

.registration-page .stepper-line { right: calc(100% / 6); }
.registration-page .stepper-fill { width: calc(var(--step-progress) * 2 / 3); max-width: none; background: #2e887b; }
.registration-page .stepper-item span { box-shadow: none; }
.registration-page .stepper-item.is-active span { background: var(--purple-dark); transform: none; }
.registration-page .stepper-item.is-complete span { background: #2e887b; }

.registration-page :is(.step-heading h2, .registration-result h2) {
  margin: 5px 0 8px;
  color: var(--register-ink);
  font-size: 27px;
  letter-spacing: 0;
  line-height: 1.2;
  scroll-margin-top: 76px;
}

.registration-page :is(.step-heading span, .success-kicker) { letter-spacing: 0; color: var(--magenta-dark); }
.registration-page .form-message:empty { display: none; }
.batch-steps.is-sliding {
  position: relative;
  overflow: clip;
}
.batch-steps.is-sliding > .is-leaving {
  position: absolute;
  inset: 0 0 auto;
}
.registration-page .step-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.registration-page .step-actions .form-submit { margin-top: 0; }
.registration-page .consent input { width: auto; }
.registration-page .registration-result .step-actions { justify-content: flex-start; margin-top: 12px; }
.registration-result p { margin: 0 0 12px; }

.registration-result canvas,
.registration-recovered-card canvas {
  display: block;
  width: 100%;
  height: auto;
  max-width: 700px;
  border-radius: 8px;
}

.registration-chip {
  margin-top: 24px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}

.registration-chip-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
  justify-content: space-between;
}

.registration-chip h3 { margin: 0; font-size: 21px; color: var(--purple-dark); }
.registration-chip-heading strong { color: #226f64; white-space: nowrap; }
.registration-chip p { margin: 8px 0; color: var(--muted); }
.registration-chip ul { margin: 10px 0 14px; padding-inline-start: 20px; color: var(--muted); }
.registration-chip-faq { display: inline-block; color: var(--purple-dark); text-decoration: underline; margin: 8px 0 0 8px; }

.registration-recovery {
  width: min(100% - 2 * var(--page-gutter), 880px);
  margin: 12px auto 64px;
  padding: 14px 0;
  border-block: 1px solid var(--line);
}

.registration-recovery summary { cursor: pointer; color: var(--purple-dark); font-weight: 800; }
.registration-lookup { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.registration-lookup label { flex: 1 1 220px; max-width: 440px; }
.registration-recovered-card { margin-top: 14px; }
.registration-recovered-card button { margin-top: 12px; }

@media (max-width: 760px) {
  .registration-page .registration-section {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 22px;
    gap: 16px;
  }

  .registration-page .registration-intro h1 { font-size: 32px; }
  .registration-page #petForm.form-panel { padding: 16px; }
}

@media (max-width: 460px) {
  .registration-page .form-grid { grid-template-columns: minmax(0, 1fr); }
  .registration-page .step-actions > * { flex: 1 1 auto; white-space: normal; }
}

.registration-page #batchForm {
  max-width: 100%;
  min-width: 0;
  padding: 24px;
  box-shadow: 0 12px 32px #3320470d;
}

#batchForm :is(input, select, textarea, summary) { scroll-margin-top: 84px; }
.batch-preview { margin-top: 18px; max-width: 430px; }
.batch-preview summary { margin-bottom: 10px; color: var(--purple-dark); font-size: 15px; font-weight: 800; cursor: pointer; }
.batch-preview canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #f5edf8;
  box-shadow: 0 0 0 1px #792b9c42, 0 0 16px 3px #932dbd48, 0 10px 24px #4b206f24;
}
.batch-preview-controls:not([hidden]) { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 6px; color: var(--muted); font-size: 14px; }
.batch-preview-controls button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--purple-dark); cursor: pointer; }
.batch-preview-controls button:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }

@media (min-width: 761px) and (min-height: 550px) {
  .registration-page .registration-intro { position: sticky; top: 88px; }
}
.batch-progress {
  --arrow-tip: 12px;
  display: flex;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.batch-progress li {
  flex: 1 1 0;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 58px;
  padding: 7px calc(var(--arrow-tip) + 2px);
  clip-path: polygon(0 0, calc(100% - var(--arrow-tip)) 0, 100% 50%, calc(100% - var(--arrow-tip)) 100%, 0 100%, var(--arrow-tip) 50%);
  background: #eee8f2;
  color: var(--purple-dark);
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.batch-progress li + li { margin-inline-start: calc(3px - var(--arrow-tip)); }
.batch-progress li:first-child { padding-inline-start: 6px; border-radius: 5px 0 0 5px; clip-path: polygon(0 0, calc(100% - var(--arrow-tip)) 0, 100% 50%, calc(100% - var(--arrow-tip)) 100%, 0 100%); }
.batch-progress li:last-child { flex-grow: 1.45; }
.batch-progress [aria-current] { color: #fff; background: var(--purple-dark); }
.batch-progress .is-complete { color: #fff; background: #227366; }
.batch-chip, .batch-birth { min-width: 0; margin: 16px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.batch-chip legend, .batch-birth legend { color: var(--purple-dark); font-weight: 800; }
.batch-chip p { margin: 0 0 8px; font-size: 16px; }
.batch-chip label { grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.batch-chip input { width: auto; min-height: 20px; accent-color: var(--purple); }
.batch-birth > div { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.batch-birth select { padding-inline: 6px; }
.batch-pet { margin-bottom: 8px; border: 1px solid var(--line); border-radius: 8px; }
.batch-pet summary { padding: 12px; color: var(--purple-dark); cursor: pointer; font-weight: 800; overflow-wrap: anywhere; }
.batch-pet-fields { border-top: 1px solid var(--line); padding: 12px; }
.batch-breed { position: relative; min-width: 0; }
.batch-breed label { position: relative; }
.batch-breed label::after { content: ""; position: absolute; inset: auto 15px 18px auto; width: 7px; height: 7px; border: solid var(--purple-dark); border-width: 0 2px 2px 0; transform: rotate(45deg); pointer-events: none; }
.batch-breed input { padding-inline-end: 34px; }
.batch-breed-options:not([hidden]) {
  position: absolute;
  z-index: 5;
  inset: calc(100% + 4px) 0 auto;
  max-height: 210px;
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px #4b206f21;
  color: var(--purple-dark);
  font-size: 16px;
}
.batch-breed-options li { display: flex; align-items: center; min-height: 38px; padding: 6px 10px; border-radius: 4px; cursor: pointer; overflow-wrap: anywhere; }
.batch-breed-options li:is(:hover, [data-active]) { background: #eee5f3; }
.batch-breed-options [aria-selected="true"] { font-weight: 800; }
.batch-pet-notes { margin-top: 20px; }
.batch-dropzone { position: relative; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding: 14px; margin-top: 12px; border: 2px dashed var(--line); border-radius: 8px; background: #faf6fb; cursor: pointer; }
.batch-dropzone:is(:focus-within, .is-dragging) { border-color: var(--magenta-dark); }
.batch-dropzone [type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.batch-dropzone img { width: 60px; height: auto; border-radius: 6px; }
.batch-dropzone small { display: block; color: var(--muted); }
.batch-edit-photo:not([hidden]) { margin-top: 8px; }
.batch-edit-photo[hidden] { display: none; }
.photo-crop {
  box-sizing: border-box;
  width: min(450px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--purple-dark);
  background: #fff;
}
.photo-crop::backdrop { background: rgb(26 16 35 / 70%); }
.photo-crop h2 { margin: 0; font-size: 24px; }
.photo-crop p { margin: 4px 0 12px; color: var(--muted); line-height: 1.35; }
.photo-crop canvas {
  display: block;
  width: min(100%, 300px, 42dvh);
  height: auto;
  margin-inline: auto;
  border-radius: 6px;
  cursor: grab;
  touch-action: none;
}
.photo-crop canvas:active { cursor: grabbing; }
.photo-crop-zoom { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-weight: 700; }
.photo-crop-zoom input { min-width: 0; flex: 1; height: 32px; padding: 0; accent-color: var(--magenta-dark); }
.photo-crop-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.batch-photo-error { font-size: 14px; color: #992755 !important; margin: 6px 0; }
.batch-photo-error:empty { display: none; }
.batch-result + .batch-result { margin-top: 20px; }
.batch-result p { margin: 0 0 6px; overflow-wrap: anywhere; }
.batch-result canvas { display: block; width: 100%; height: auto; }
.batch-result button { margin-top: 8px; }

.social-card {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.social-card h3 { margin: 0 0 12px; color: var(--purple-dark); font-size: 22px; }
.social-card > label[hidden] { display: none; }
.social-card > label { display: grid; gap: 4px; max-inline-size: 430px; }
.social-formats { min-width: 0; margin: 10px 0 12px; padding: 0; border: 0; }
.social-formats legend { color: var(--purple-dark); font-weight: 700; margin-bottom: 5px; }
.social-formats > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: min(100%, 430px);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f1f7;
}
.social-formats label { position: relative; cursor: pointer; }
.social-formats input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.social-formats span {
  display: flex;
  flex-wrap: wrap;
  place-content: center;
  align-items: baseline;
  gap: 0 8px;
  min-height: 48px;
  padding: 4px 7px;
  border-radius: 5px;
  text-align: center;
  color: var(--purple-dark);
}
.social-formats input:checked + span { background: var(--purple-dark); color: #fff; }
.social-formats input:focus-visible + span { outline: 2px solid var(--magenta-dark); outline-offset: 2px; }
.social-formats small { font-size: 13px; font-weight: 600; }
.social-card-stage {
  display: grid;
  place-items: center;
  min-width: 0;
  height: clamp(300px, 54vh, 520px);
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f1f7;
}
.social-card-stage canvas { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }

@media (max-width: 500px) {
  .registration-page #batchForm { padding: 13px; }
  .batch-progress { --arrow-tip: 7px; }
  .batch-progress li { font-size: 12px; }
}
