/* Adoption application staging page — intentionally local to /public/adopt/. */
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/assets/fonts/fredoka-variable-latin.woff2') format('woff2');
}

.adoption-stage,
.adoption-review,
.adoption-error-banner,
.adoption-toast {
  --form-blue: #4660a9;
  --form-blue-dark: #234299;
  --form-orange: #e07919;
  --form-green: #a7ad6f;
  --form-ink: #17213b;
  --form-muted: #5c6475;
  --form-soft: #eef1f8;
  --form-error: #d71920;
  --form-heading-font: 'Fredoka', 'Roboto', sans-serif;
}

.adoption-stage {
  background: linear-gradient(180deg, #eef1f8 0, #fff 420px);
  color: var(--form-ink);
  padding: 0 0 clamp(4rem, 8vw, 7rem); /* no top/side padding — hero + blue lede are full-bleed; side padding moved to shell */
}

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

.adoption-stage__shell { width: min(100%, 1080px); margin: 0 auto; padding: clamp(1.75rem, 4vw, 3rem) 1rem 0; }
.adoption-stage__intro { max-width: 820px; margin: 0 auto clamp(1.75rem, 4vw, 3rem); text-align: center; }
.adoption-stage__eyebrow { color: var(--form-orange); font-size: .9rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.adoption-stage__intro h1 { color: var(--form-blue); font-family: var(--form-heading-font); font-size: clamp(2.25rem, 6vw, 4.25rem); font-weight: 600; line-height: 1.06; margin: .4rem 0 .9rem; }
.adoption-stage__intro p { color: var(--form-muted); font-size: clamp(1rem, .88rem + .5vw, 1.25rem); line-height: 1.7; margin: 0 auto; }

/* ── Hero photo + blue lede row (redesign draft) ─────────────────────────── */
.adoption-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.adoption-hero {
  position: relative;
  min-height: clamp(240px, 32vw, 480px);
  padding-bottom: clamp(40px, 5vw, 70px); /* keep the dog/cat above the blue wave */
  background-color: #fff;
  background-image: url('/assets/images/adoption-application-hero.webp');
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: auto 68%; /* whole subject always visible; image blends on the white bg,
                                leaving a white band at the top for the title at every width */
}
.adoption-hero__badge {
  position: absolute; z-index: 1; top: clamp(.85rem, 3.5vw, 2.25rem);
  left: 50%; transform: translateX(-50%);
  width: 100%; padding: 0 1rem; text-align: center;
}
.adoption-hero__eyebrow {
  display: block; color: var(--form-orange); font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase;
  font-size: clamp(.66rem, .55rem + .35vw, .9rem);
}
.adoption-hero__title {
  display: block; margin-top: .12rem; color: var(--form-blue);
  font-family: var(--form-heading-font); font-weight: 600; line-height: 1.04;
  font-size: clamp(1.55rem, 1rem + 3vw, 3rem);
}
.adoption-hero__wave { position: absolute; left: 0; bottom: -1px; width: 100%; line-height: 0; }
.adoption-hero__wave svg { display: block; width: 100%; height: clamp(40px, 5vw, 70px); }

.adoption-lede {
  position: relative;
  overflow: hidden;
  background: var(--form-blue);
  padding: clamp(2rem, 5vw, 3.25rem) 1rem clamp(4rem, 8vw, 6rem);
}
.adoption-lede__wave { position: absolute; left: 0; bottom: -1px; width: 100%; line-height: 0; }
.adoption-lede__wave svg { display: block; width: 100%; height: clamp(40px, 5vw, 70px); }
.adoption-lede__inner {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
.adoption-lede__required {
  color: #ffc06b;
  font-family: var(--form-heading-font);
  font-size: clamp(1.15rem, 1rem + .8vw, 1.6rem);
  font-weight: 525;
  line-height: 1.35;
  margin: 0 0 .9rem;
}
.adoption-lede__body {
  color: #e7edfb;
  font-size: clamp(1rem, .9rem + .35vw, 1.15rem);
  line-height: 1.65;
  margin: 0;
}
.adoption-lede__dog {
  width: clamp(150px, 20vw, 230px);
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid #fff;
  box-shadow: 0 14px 34px rgba(0,0,0,.28);
}
/* off-blue (#5d6fae) paw SVGs — subtle tone-on-tone decoration on the blue row */
.adoption-lede__paw { position: absolute; z-index: 0; width: clamp(90px, 12vw, 185px); opacity: .55; }
.adoption-lede__paw--l { top: -14px; left: clamp(-32px, 1vw, 30px); transform: rotate(-18deg); }
.adoption-lede__paw--r { bottom: 34px; right: clamp(-32px, 1vw, 30px); transform: rotate(24deg); }

@media (max-width: 720px) {
  .adoption-lede__inner { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .adoption-lede__paw { display: none; }
}

/* Resume (autosave) banner */
.adoption-resume { background: #fff; border: 1px solid #cfe0d3; border-left: 6px solid #2e8b57; border-radius: 14px; box-shadow: 0 10px 30px rgba(34,54,108,.1); margin: 0 auto clamp(1.25rem, 3vw, 2rem); max-width: 900px; padding: clamp(1rem, 3vw, 1.5rem); }
.adoption-resume[hidden] { display: none; }
.adoption-resume__inner { align-items: center; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }
.adoption-resume__text { color: var(--form-ink); font-size: 1rem; font-weight: 600; line-height: 1.5; margin: 0; }
.adoption-resume__actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.adoption-resume__actions .adoption-button { min-height: 46px; padding: .6rem 1.2rem; }

.adoption-progress__prefill-note { color: #2e8b57; font-size: 13px; font-weight: 600; line-height: 1.4; margin: 0 auto .5rem; max-width: 760px; text-align: center; }
.adoption-progress__prefill-note[hidden] { display: none; }
/* Opaque strip so form content never rides visibly under the sticky bar + hint. */
.adoption-progress-sticky { position: sticky; top: 131px; z-index: 20; text-align: center; background: #fff; padding: 1rem 0 .55rem; margin-bottom: 1.25rem; box-shadow: 0 12px 14px -10px rgba(34,54,108,.18); }
.adoption-progress { background: #fff; border: 1px solid #dce2ef; border-radius: 999px; box-shadow: 0 8px 30px rgba(70,96,169,.1); margin: 0 auto .5rem; max-width: 760px; overflow: hidden; position: relative; }
.adoption-progress__bar { background: #02c357; box-shadow: inset -2px 0 0 #02a548; height: 100%; inset: 0 auto 0 0; position: absolute; transform-origin: left; transition: width .2s ease; width: 0; }
.adoption-progress__text { color: #000; display: block; font-size: .85rem; font-weight: 700; padding: .75rem 1rem; position: relative; text-align: center; z-index: 1; }
.adoption-autosave-hint { color: var(--form-muted); display: inline-block; background: #fff; border: 1px solid #dce2ef; border-radius: 999px; box-shadow: 0 6px 20px rgba(70,96,169,.08); font-size: 12.5px; line-height: 1.4; margin: 0 auto; max-width: min(760px, 92vw); padding: .3rem .95rem; text-align: center; }
.adoption-autosave-hint__time { white-space: nowrap; font-weight: 600; color: var(--form-ink); }

.adoption-form { display: grid; gap: 1.5rem; }
.adoption-section { background: #fff; border: 1px solid #dce2ef; border-radius: 18px; box-shadow: 0 12px 34px rgba(34,54,108,.09); margin: 0; padding: clamp(1.25rem, 4vw, 2.5rem); }
.adoption-section[hidden], .adoption-field[hidden], .adoption-stage__thank-you[hidden] { display: none; }
.adoption-section__heading { align-items: flex-start; display: flex; gap: 1rem; margin-bottom: 1.65rem; }
.adoption-section__number { align-items: center; background: var(--form-blue); border-radius: 50%; color: #fff; display: inline-flex; flex: 0 0 2.35rem; font-weight: 700; height: 2.35rem; justify-content: center; }
.adoption-section__heading h2 { color: var(--form-blue); font-family: var(--form-heading-font); font-size: clamp(1.45rem, 3vw, 2rem); font-weight: 600; line-height: 1.2; margin: 0; }
.adoption-section__heading p { color: var(--form-muted); font-size: .95rem; line-height: 1.55; margin: .35rem 0 0; }
.adoption-section--dog { border-top: 6px solid var(--form-green); }
.adoption-section--agreement { border-top: 6px solid var(--form-orange); }

.adoption-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.adoption-field { min-width: 0; }
.adoption-field:is(fieldset) { border: 0; margin: 0; padding: 0; }
.adoption-field--full { grid-column: 1 / -1; }
.adoption-field :where(label:not(.adoption-choice), legend) { color: #111; display: block; font-size: 1rem; font-weight: 700; line-height: 1.4; margin: 0 0 .5rem; }
.adoption-field--required > label::after,
.adoption-field--required > legend::after { color: var(--form-error); content: ' *'; }
.adoption-help { color: var(--form-muted); display: block; font-size: .88rem; line-height: 1.5; margin-top: .45rem; }

.adoption-field input[type='text'],
.adoption-field input[type='email'],
.adoption-field input[type='tel'],
.adoption-field input[type='date'],
.adoption-field select,
.adoption-field textarea {
  background: #fff;
  border: 3px solid var(--form-blue);
  border-radius: 9px;
  color: #111;
  font: inherit;
  font-size: 1rem;
  max-width: 100%;
  min-height: 50px;
  min-width: 0;
  padding: .7rem .85rem;
  width: 100%;
}
.adoption-field input[type='date'] { display: block; inline-size: 100%; max-inline-size: 100%; min-inline-size: 0; }
@supports (-webkit-touch-callout: none) {
  .adoption-field input[type='date'] { -webkit-appearance: none; appearance: none; inline-size: -webkit-fill-available; text-align: center; width: -webkit-fill-available; }
}
.adoption-field textarea { min-height: 125px; resize: vertical; }
.adoption-field input:focus,
.adoption-field select:focus,
.adoption-field textarea:focus,
.signature-pad:focus-within { border-color: var(--form-orange); box-shadow: 0 0 0 4px rgba(224,121,25,.18); outline: 0; }
.adoption-field :is(input, select, textarea).field-error,
.adoption-choice-group.field-error,
.signature-pad.field-error { border-color: var(--form-error); box-shadow: 0 0 0 4px rgba(215,25,32,.22); }

.adoption-choice-group { border: 1px solid #d5dbea; border-radius: 10px; display: grid; gap: .65rem; padding: .9rem 1rem; }
.adoption-choice-group--inline { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
.adoption-choice-group--lifestyle { column-gap: 2rem; grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1rem; }
.adoption-choice { align-items: center; color: #1e2432; cursor: pointer; display: flex; font-size: 1rem; font-weight: 500; gap: .65rem; line-height: 1.4; margin: 0; }
.adoption-choice input { accent-color: var(--form-blue); flex: 0 0 auto; height: 1.2rem; margin: 0; width: 1.2rem; }

.adoption-error-banner { background: #f0000b; box-shadow: 0 5px 18px rgba(60,0,4,.28); color: #fff; inset: 0 0 auto; opacity: 1; padding: .75rem clamp(.75rem, 3vw, 2rem); position: fixed; transition: opacity .3s ease; z-index: 1300; }
.adoption-error-banner[hidden] { display: none; }
.adoption-error-banner.is-fading { opacity: 0; pointer-events: none; }
.adoption-error-banner__inner { align-items: center; display: flex; gap: 1rem; justify-content: space-between; margin: 0 auto; max-width: 1180px; }
.adoption-error-banner p { align-items: center; display: flex; font-size: clamp(1rem, 1.8vw, 1.35rem); font-weight: 600; gap: .75rem; line-height: 1.35; margin: 0; }
.adoption-error-banner__status { align-items: center; background: #fff; border-radius: 50%; color: var(--form-ink); display: inline-flex; flex: 0 0 2.4rem; font-size: 1.25rem; font-weight: 700; height: 2.4rem; justify-content: center; }
.adoption-error-banner__action { background: #fff; border: 0; border-radius: 8px; color: var(--form-ink); cursor: pointer; flex: 0 0 auto; font: inherit; font-size: 1rem; font-weight: 700; min-height: 46px; padding: .65rem 1.25rem; }
.adoption-error-banner.is-success { background: #bdf5c9; color: var(--form-ink); }
.adoption-error-banner.is-success .adoption-error-banner__status { background: #00bd55; color: #fff; }
.adoption-error-banner.is-success .adoption-error-banner__action { background: #00bd55; color: #fff; }

/* Autosave toast */
.adoption-toast { white-space: pre-line; text-align: center; background: var(--form-ink); border-radius: 10px; bottom: 1.25rem; box-shadow: 0 10px 30px rgba(0,0,0,.28); color: #fff; font-size: .92rem; font-weight: 600; left: 50%; opacity: 0; padding: .8rem 1.2rem; position: fixed; transform: translateX(-50%) translateY(12px); transition: opacity .3s ease, transform .3s ease; z-index: 1250; }
.adoption-toast[hidden] { display: none; }
.adoption-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.adoption-toast.is-small { font-size: .8rem; font-weight: 500; padding: .45rem .85rem; }

.pet-list { display: grid; gap: 1rem; }
.pet-row { background: var(--form-soft); border: 1px solid #d8deeb; border-radius: 12px; display: grid; gap: .85rem; grid-template-columns: 1.1fr 1.2fr .8fr 1.2fr auto; padding: 1rem; }
.pet-row label { font-size: .82rem; margin-bottom: .3rem; }
.pet-row input, .pet-row select { border-width: 2px; min-height: 44px; padding: .55rem .65rem; }
.pet-remove { align-self: end; background: transparent; border: 0; color: var(--form-error); cursor: pointer; font: inherit; font-weight: 700; min-height: 44px; padding: .4rem; }
.pet-add { background: #fff; border: 2px solid var(--form-blue); border-radius: 999px; color: var(--form-blue); cursor: pointer; font: inherit; font-weight: 700; margin-top: 1rem; padding: .7rem 1.2rem; }

.agreement-copy { background: var(--form-soft); border-left: 5px solid var(--form-blue); border-radius: 10px; color: #30384a; font-size: .95rem; line-height: 1.7; padding: 1rem 1.2rem; }
.agreement-copy p { margin: 0; }

.signature-pad { background: #fff; border: 3px solid var(--form-blue); border-radius: 9px; overflow: hidden; }
.signature-pad canvas { cursor: crosshair; display: block; height: 210px; touch-action: none; width: 100%; }
.signature-pad__actions { align-items: center; background: var(--form-soft); border-top: 1px solid #d8deeb; display: flex; justify-content: space-between; padding: .55rem .8rem; }
.signature-pad__actions span { color: var(--form-muted); font-size: .84rem; }
.signature-clear { background: transparent; border: 0; color: var(--form-blue); cursor: pointer; font: inherit; font-size: .9rem; font-weight: 700; }

.adoption-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }
.adoption-actions p { color: var(--form-muted); flex: 1 1 320px; font-size: .9rem; line-height: 1.5; margin: 0; }
.adoption-button { align-items: center; background: var(--form-blue-dark); border: 0; border-radius: 999px; color: #fff; cursor: pointer; display: inline-flex; font: inherit; font-size: 1rem; font-weight: 700; gap: .55rem; justify-content: center; min-height: 52px; padding: .8rem 1.5rem; transition: background .3s ease, box-shadow .3s ease; }
.adoption-button:hover { background: #1a337a; box-shadow: 0 0 0 2px rgba(224,121,25,.4), 0 0 16px 4px rgba(224,121,25,.45); }
.adoption-button:focus-visible, .pet-add:focus-visible, .pet-remove:focus-visible, .signature-clear:focus-visible, .adoption-error-banner__action:focus-visible { outline: 3px solid var(--form-orange); outline-offset: 3px; }
.adoption-button--secondary { background: #fff; border: 2px solid var(--form-blue); color: var(--form-blue); }
.adoption-button--secondary:hover { background: var(--form-soft); }
.adoption-button[disabled] { cursor: wait; opacity: .7; }

.adoption-review { align-items: center; background: rgba(12,22,47,.76); display: none; inset: 0; justify-content: center; padding: 1rem; position: fixed; z-index: 1200; }
.adoption-review.open { display: flex; }
.adoption-review__card { background: #fff; border-radius: 18px; box-shadow: 0 24px 80px rgba(0,0,0,.3); max-height: min(90vh, 90dvh); max-width: 820px; overflow-y: auto; padding: clamp(1.25rem, 4vw, 2.25rem); width: 100%; }
.adoption-review__card h2 { color: var(--form-blue); font-family: var(--form-heading-font); font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 600; margin: 0 0 .4rem; }
.adoption-review__note { color: var(--form-muted); line-height: 1.6; margin: 0 0 1.25rem; }
.adoption-review__rows { border-top: 1px solid #dce2ef; margin: 0; }
.adoption-review__row { border-bottom: 1px solid #dce2ef; display: grid; gap: 1rem; grid-template-columns: minmax(140px, .8fr) 2fr; padding: .8rem 0; }
.adoption-review__row dt { color: var(--form-muted); font-size: .9rem; font-weight: 700; }
.adoption-review__row dd { color: #111; margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.adoption-review__actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: flex-end; margin-top: 1.5rem; }

.adoption-stage__thank-you { background: #fff; border: 1px solid #dce2ef; border-radius: 20px; box-shadow: 0 14px 42px rgba(34,54,108,.12); margin: 0 auto; max-width: 780px; padding: clamp(2rem, 6vw, 4rem); text-align: center; }
.adoption-stage__thank-icon { align-items: center; background: var(--form-green); border-radius: 50%; color: #fff; display: inline-flex; font-size: 2rem; height: 72px; justify-content: center; width: 72px; }
.adoption-stage__thank-you h2 { color: var(--form-blue); font-family: var(--form-heading-font); font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 600; margin: 1rem 0 .7rem; }
.adoption-stage__thank-you p { color: var(--form-muted); font-size: clamp(1rem, .9rem + .4vw, 1.18rem); line-height: 1.7; margin: 0 auto 1.4rem; max-width: 620px; }
.adoption-submit-frame { border: 0; height: 1px; left: -9999px; position: absolute; width: 1px; }
.jf-honeypot { height: 1px; left: -9999px; opacity: 0; position: absolute; width: 1px; }

@media (max-width: 900px) {
  .pet-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pet-remove { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 700px) {
  .adoption-stage__shell { padding-left: .75rem; padding-right: .75rem; }
  .adoption-grid { grid-template-columns: 1fr; }
  .adoption-field--full { grid-column: auto; }
  .adoption-section { border-radius: 14px; }
  .adoption-actions { align-items: stretch; flex-direction: column; }
  .adoption-actions p { flex-basis: auto; }
  .adoption-button { width: 100%; }
  .adoption-resume__inner { flex-direction: column; align-items: stretch; }
  .adoption-resume__actions .adoption-button { width: 100%; }
  .adoption-review__actions { flex-direction: column-reverse; }
  .adoption-review__row { gap: .25rem; grid-template-columns: 1fr; }
  .adoption-error-banner__inner { align-items: stretch; flex-direction: column; gap: .65rem; }
  .adoption-error-banner p { font-size: 1rem; }
  .adoption-error-banner__action { width: 100%; }
}

@media (max-width: 480px) {
  .adoption-progress-sticky { top: 72px; padding-top: .75rem; }
  .adoption-section__heading { gap: .7rem; }
  .adoption-section__number { flex-basis: 2rem; height: 2rem; }
  .adoption-choice-group--inline { grid-template-columns: 1fr; }
  .adoption-choice-group--lifestyle { grid-template-columns: 1fr; }
  .pet-row { grid-template-columns: 1fr; }
  .pet-remove { grid-column: auto; }
  .signature-pad canvas { height: 175px; }
}

@media (prefers-reduced-motion: reduce) {
  .adoption-error-banner { transition: none; }
  .adoption-progress__bar { transition: none; }
  .adoption-toast { transition: opacity .01s; }
}

/* Center the resume banner once it wraps (tablet and below). */
@media (max-width: 1000px) {
  .adoption-resume__inner { justify-content: center; text-align: center; }
  .adoption-resume__actions { justify-content: center; }
}

/* No orphans: balance SHORT text (headings, notes, labels) so a single word never
   drops to its own line; pretty LONG prose (fixes only the last-line orphan). */
.adoption-resume__text,
.adoption-progress__prefill-note,
.adoption-autosave-hint,
.adoption-stage__intro h1,
.adoption-stage__intro p,
.adoption-section__heading h2,
.adoption-section__heading p,
.adoption-field :where(label:not(.adoption-choice), legend),
.adoption-help,
.adoption-note,
.adoption-review__note,
.adoption-stage__thank-you h2,
.adoption-stage__thank-you p,
.adoption-error-banner p,
.adoption-hero__title,
.adoption-lede__required { text-wrap: balance; }
.adoption-lede__body { text-wrap: pretty; }
