/*
 * Register your adoption (/adoption).
 *
 * Builds on the theme's checkout styles: the wrapper also carries
 * .durrell-checkout, so inputs, labels, errors, the notice and the button
 * look exactly as they do at checkout. Only what is new lives here.
 * Doubled classes outrank the theme's single-class rules whatever order the
 * two stylesheets load in.
 */

.durrell-checkout.durrell-register {
  max-width: 760px;
}

.durrell-register .durrell-register__form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.durrell-register .durrell-panel__title { margin-bottom: 6px; }

.durrell-register h2.durrell-panel__title { margin: 36px 0 18px; }

/* ------------------------------------------------------------- animals */
.durrell-register .durrell-register__animals {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.durrell-register .durrell-register__animals legend {
  padding: 0;
}

.durrell-register__hint {
  margin: 0 0 18px;
  font-size: 15px;
  color: var(--wp--preset--color--ink-muted);
}

/* Two across at every width, so today's four animals sit 2 by 2 with big
   photos (Milo, 2026-11-06). A fifth animal starts a third row. */
.durrell-register__grid {
  display: grid;
  /* minmax(0, …), not plain 1fr: a long name like "Orangutan" would
     otherwise widen its own column and make that card's photo bigger. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 640px) {
  .durrell-register__grid { gap: 10px; }
  /* Narrower panel padding gives the photos room on small phones. */
  .durrell-register .durrell-panel { padding: 20px; }
}

.durrell-register__animal {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 8px 12px;
  background: var(--wp--preset--color--cream-soft);
  border: 2px solid var(--wp--preset--color--border-warm);
  border-radius: 16px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}

.durrell-register__animal:hover {
  border-color: var(--durrell-animal);
}

.durrell-register__animal:has(input:checked) {
  border-color: var(--durrell-animal);
  background: var(--wp--preset--color--white);
  box-shadow: 0 0 0 2px var(--durrell-animal);
}

.durrell-register__animal:has(input:focus-visible) {
  outline: 3px solid var(--wp--preset--color--ink);
  outline-offset: 3px;
}

.durrell-register__photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3; /* cropped to fit: the photos come in landscape and portrait */
  object-fit: cover;
  border-radius: 10px;
  background: var(--durrell-animal);
}

/* Names sit on one baseline whether or not there's a qualifier above. */
.durrell-register__name {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 52px; /* room for a qualifier that wraps, like "Western Lowland" */
  padding-inline: 4px;
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.2;
  color: var(--wp--preset--color--ink);
  overflow-wrap: anywhere;
}

.durrell-register__qualifier {
  font-family: var(--wp--preset--font-family--body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--wp--preset--color--ink-muted);
}

/* The real checkbox, restyled as a round tick in the photo's corner. It stays
   a native input, so keyboards and screen readers treat it as a checkbox. */
.durrell-register__animal input[type="checkbox"] {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
  width: 28px;
  height: 28px;
  margin: 0;
  appearance: none;
  background: var(--wp--preset--color--white);
  border: 2px solid var(--wp--preset--color--border-warm);
  border-radius: 50%;
  cursor: pointer;
}

.durrell-register__animal input[type="checkbox"]:checked {
  background: var(--durrell-animal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.6 4.4 4.4L19 7.4'/%3E%3C/svg%3E") center / 18px no-repeat;
  border-color: var(--wp--preset--color--white);
}

.durrell-register__animals.has-error .durrell-register__animal:not(:has(input:checked)) {
  border-color: var(--wp--custom--link--default);
}

.durrell-register__animals .durrell-field__error { margin-top: 12px; }

/* ------------------------------------------------------------- details */
.durrell-register__privacy {
  margin: 4px 0 24px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--wp--preset--color--ink-muted);
}

/* -------------------------------------------------------------- thanks */
.durrell-register .durrell-register__thanks {
  text-align: center;
  padding-block: 48px;
}

.durrell-register__thanks .durrell-checkout__lede { margin-inline: auto; }

.durrell-register__tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--durrell-species);
  color: var(--wp--preset--color--white);
}

.durrell-register__home {
  display: inline-block;
  margin-top: 12px;
  padding: 14px 28px;
  border-radius: var(--wp--custom--radius--pill);
  background: var(--durrell-species);
  color: var(--wp--preset--color--white);
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 600;
  text-decoration: none;
}

/* --------------------------------------------------------- reCAPTCHA */
/* Google's floating badge is hidden; its terms then require this line,
   which the form prints under the button. */
.grecaptcha-badge { visibility: hidden; }

.durrell-register__recaptcha {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  color: var(--wp--preset--color--ink-muted);
}

.durrell-register__recaptcha a { color: inherit; }
