/* ============================================================================
   KERNOL public enquiry page (pe-*)

   The agency's public quotation form: the page a pet owner lands on from the
   agency's own website. One card, one column, questions revealed one step at a
   time as the previous is answered. The structure, rhythm, widths and pacing
   follow the reference enquiry form this was ported from; the colours are the
   brand's, through kernol.css tokens — nothing here names a literal the rest
   of the product does not.

   Scoped to body.pe-page (layouts/agency_public). Namespaced .pe-* throughout.
   ============================================================================ */

/* On the page's own body, not :root — same reason as portal.css: this surface is
   white-label and keeps the pre-rebrand palette, which kernol.css pins on
   `body.pe-page`. An alias declared at :root would resolve against the Orppio
   values instead of the frozen ones. */
body.pe-page {
  --pe-ink:        #1a3363;                     /* the reference form's navy: titles, labels, marks */
  --pe-body:       var(--kernol-grey-800);
  --pe-muted:      var(--kernol-grey-600);
  --pe-faint:      var(--kernol-grey-500);
  --pe-line:       var(--kernol-grey-300);
  --pe-line-soft:  var(--kernol-grey-200);
  --pe-soft:       #f4f7fb;                     /* the reference form's soft blue ground */
  --pe-sunken:     var(--kernol-grey-100);
  --pe-card:       #FFFFFF;
  --pe-accent:     var(--kernol-tan-400);       /* the warm signature: selection, CTA */
  --pe-accent-dark:var(--kernol-tan-700);
  --pe-accent-soft:var(--kernol-tan-50);
  --pe-accent-ring:rgba(226, 113, 58, .32);
  --pe-focus:      var(--kernol-blue-600);
  --pe-focus-ring: rgba(37, 99, 235, .18);
  --pe-ok:         var(--kernol-teal-600);
  --pe-ok-soft:    var(--kernol-teal-50);
  --pe-danger:     var(--kernol-red-600);
  --pe-danger-soft:var(--kernol-red-50);
  --pe-danger-line:var(--kernol-red-200);
  --pe-footer-bg:  var(--kernol-chrome-900);
  --pe-footer-ink: #C9D4E8;
  --pe-footer-mute:#8FA0BF;
  --pe-radius:     14px;
  --pe-shadow:     0 10px 30px rgba(11, 20, 38, .10);
  --pe-font:       -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* ── Page ─────────────────────────────────────────────────────────────── */
.pe-page { margin: 0; font-family: var(--pe-font); color: var(--pe-body); background: #fff; line-height: 1.6; -webkit-font-smoothing: antialiased; }
.pe-page *, .pe-page *::before, .pe-page *::after { box-sizing: border-box; }
/* Zero specificity on the reset, so every .pe-* rule below wins over it. */
.pe-page :where(h1, h2, h3, h4, p, ul, dl, dd, fieldset, legend, label) { margin: 0; }
.pe-page :where(fieldset) { border: 0; padding: 0; min-width: 0; }
.pe-page :where(legend) { padding: 0; }
.pe-page a { color: var(--pe-ink); }
.pe-page img { max-width: 100%; display: block; }
.pe-page :focus-visible { outline: 3px solid var(--pe-focus-ring); outline-offset: 1px; border-radius: 8px; }
.pe-hidden { display: none !important; }
.pe-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.pe-container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.pe-center { text-align: center; }

/* ── Header ───────────────────────────────────────────────────────────── */
.pe-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--pe-line-soft); }
.pe-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; padding-bottom: 8px; max-width: 1440px; }
.pe-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.pe-brand__logo { height: 44px; width: auto; flex: 0 0 auto; border-radius: 8px; }
.pe-brand__mark { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px; background: var(--pe-ink); color: #fff; font-weight: 800; font-size: 1.25rem; display: flex; align-items: center; justify-content: center; }
.pe-brand__text { display: flex; flex-direction: column; min-width: 0; }
.pe-brand__name { font-weight: 800; color: var(--pe-ink); font-size: 1.14rem; letter-spacing: .2px; line-height: 1.2; }
.pe-brand__tagline { font-size: .78rem; color: var(--pe-muted); letter-spacing: .02em; line-height: 1.35; }
.pe-header__actions { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.pe-header__link { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; font-weight: 700; color: var(--pe-ink); text-decoration: none; white-space: nowrap; padding: 10px 6px; }
.pe-header__link:hover { color: var(--pe-accent-dark); text-decoration: underline; }
.pe-header__link .pe-ic { width: 16px; height: 16px; }

/* ── Sections & titles ────────────────────────────────────────────────── */
.pe-section { padding: 60px 0; }
.pe-section--form { padding-top: 44px; }
.pe-section--soft { background: var(--pe-soft); }
.pe-title { font-size: clamp(1.5rem, 3vw, 2.1rem); color: var(--pe-ink); font-weight: 800; text-align: center; margin-bottom: 10px; line-height: 1.2; }
.pe-title--sm { font-size: clamp(1.25rem, 2.4vw, 1.6rem); margin-bottom: 28px; }
.pe-title--left { text-align: left; }
.pe-sub { text-align: center; color: var(--pe-muted); max-width: 46em; margin: 0 auto 40px !important; white-space: pre-line; }
.pe-lede { color: var(--pe-muted); font-size: .97rem; }
.pe-note { font-size: .88rem; color: var(--pe-muted); }
.pe-note strong, .pe-lede strong { color: var(--pe-ink); }

/* ── The card ─────────────────────────────────────────────────────────── */
.pe-card { max-width: 720px; margin: 0 auto; background: var(--pe-card); border: 1px solid var(--pe-line); border-radius: var(--pe-radius); box-shadow: var(--pe-shadow); padding: 34px clamp(18px, 4vw, 40px) 40px; }
.pe-card--narrow { max-width: 640px; }
.pe-form-note { text-align: center; color: var(--pe-muted); font-size: .9rem; margin-bottom: 26px; }
.pe-req-mark { color: var(--pe-accent); }
.pe-trap { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* ── Fields ───────────────────────────────────────────────────────────── */
.pe-legend, .pe-label { display: block; font-weight: 700; color: var(--pe-ink); font-size: .95rem; margin-bottom: 8px; }
.pe-label { font-weight: 600; font-size: .9rem; color: var(--pe-ink); margin-bottom: 6px; }
.is-req::after { content: " *"; color: var(--pe-accent); }
.pe-optional { font-weight: 400; color: var(--pe-muted); font-size: .85em; }
.pe-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pe-field { margin-bottom: 16px; min-width: 0; }
.pe-hint { font-size: .8rem; color: var(--pe-muted); margin-top: 4px; }
.pe-input, .pe-select, .pe-textarea { width: 100%; padding: 12px 14px; font-size: 1rem; color: var(--pe-body); border: 1.5px solid var(--pe-line); border-radius: 10px; background: #fff; font-family: inherit; line-height: 1.4; transition: border-color .15s; -webkit-appearance: none; appearance: none; }
.pe-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23636E80' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; cursor: pointer; }
.pe-input:focus, .pe-select:focus, .pe-textarea:focus { outline: none; border-color: var(--pe-ink); box-shadow: 0 0 0 3px rgba(11, 20, 38, .12); }
.pe-input[aria-invalid="true"], .pe-select[aria-invalid="true"], .pe-textarea[aria-invalid="true"] { border-color: var(--pe-danger); }
.pe-input:disabled, .pe-select:disabled { background-color: var(--pe-sunken); color: var(--pe-muted); cursor: not-allowed; }
.pe-textarea { resize: vertical; min-height: 5.5em; }
.pe-field__error { font-size: .82rem; color: var(--pe-danger); margin-top: 5px; font-weight: 600; }

/* Weight with its unit: one control, two inputs. */
.pe-weight { display: grid; grid-template-columns: 1fr 92px; gap: 8px; }
.pe-weight__unit { padding-left: 12px; }

/* ── Direction cards ──────────────────────────────────────────────────── */
.pe-direction-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.pe-direction input, .pe-other-route input, .pe-choice input, .pe-travel input, .pe-contact input { position: absolute; opacity: 0; pointer-events: none; }
.pe-direction label { display: block; height: 100%; cursor: pointer; text-align: center; border: 2px solid var(--pe-line); border-radius: 12px; padding: 14px 10px; font-size: .92rem; transition: border-color .15s, background .15s; }
.pe-direction label b { display: block; color: var(--pe-ink); margin-top: 6px; }
.pe-direction label small { display: block; color: var(--pe-muted); margin-top: 4px; line-height: 1.4; }
.pe-direction__icon { display: flex; justify-content: center; color: var(--pe-ink); }
.pe-direction__icon svg { width: 26px; height: 26px; }
.pe-direction input:checked + label { border-color: var(--pe-accent); background: var(--pe-accent-soft); }
.pe-direction input:checked + label .pe-direction__icon { color: var(--pe-accent); }
.pe-direction input:focus-visible + label, .pe-other-route input:focus-visible + label, .pe-choice input:focus-visible + label, .pe-travel input:focus-visible + label, .pe-contact input:focus-visible + label { outline: 3px solid var(--pe-accent-ring); }
/* The quieter third choice: a sentence, not a card. */
.pe-other-route { text-align: center; margin-bottom: 6px; }
.pe-other-route label { display: inline-block; cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--pe-muted); text-decoration: underline; text-underline-offset: 3px; padding: 6px 10px; border-radius: 999px; }
.pe-other-route label:hover { color: var(--pe-ink); }
.pe-other-route input:checked + label { color: var(--pe-accent-dark); background: var(--pe-accent-soft); text-decoration: none; }

/* ── Route: From ✈ To ─────────────────────────────────────────────────── */
.pe-route { display: flex; flex-direction: column; gap: 4px; }
.pe-route__plane { display: flex; justify-content: center; color: var(--pe-accent); margin: -2px 0 6px; }
.pe-route__plane svg { width: 20px; height: 20px; transform: rotate(135deg); }
.pe-leg { border: 1px dashed var(--pe-line); border-radius: 12px; padding: 14px 16px 2px; background: var(--pe-soft); }
.pe-leg__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pe-leg__marker { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 1px solid var(--pe-line); color: var(--pe-ink); display: inline-flex; align-items: center; justify-content: center; }
.pe-leg__marker svg { width: 15px; height: 15px; }
.pe-leg__title { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--pe-muted); }
.pe-leg__country-fixed { margin-bottom: 14px; }
.pe-fixed-country { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; background: #fff; border: 1.5px solid var(--pe-line-soft); font-weight: 700; color: var(--pe-ink); }
.pe-flag { width: 22px; height: auto; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }

/* ── Combobox (country, city, airport, breed) ─────────────────────────── */
.pe-combobox { position: relative; }
.pe-combobox:focus-within { z-index: 30; }
.pe-combobox__input--select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23636E80' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.pe-combobox__list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; background: #fff; border: 1.5px solid var(--pe-line); border-radius: 10px; box-shadow: var(--pe-shadow); list-style: none; margin: 0; padding: 6px; max-height: 260px; overflow-y: auto; }
.pe-combobox__list li { padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: .92rem; color: var(--pe-body); display: flex; flex-direction: column; gap: 1px; }
.pe-combobox__list li small { color: var(--pe-muted); font-size: .8rem; }
.pe-combobox__list li:hover, .pe-combobox__list li.is-active { background: var(--pe-soft); color: var(--pe-ink); }
.pe-combobox__list li.is-empty { color: var(--pe-muted); cursor: default; }

/* ── Choice rows: flexibility, pet count ──────────────────────────────── */
.pe-choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pe-choice label { display: inline-flex; align-items: center; justify-content: center; min-height: 49px; padding: 10px 16px; border: 1.5px solid var(--pe-line); border-radius: 10px; background: #fff; font-size: .95rem; font-weight: 600; color: var(--pe-body); cursor: pointer; transition: border-color .15s, background .15s; }
.pe-choice input:checked + label { border-color: var(--pe-accent); background: var(--pe-accent-soft); color: var(--pe-accent-dark); }
.pe-choice--pill label { min-width: 49px; padding: 10px 0; font-weight: 700; }

/* ── Travel option cards ──────────────────────────────────────────────── */
.pe-travel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pe-travel label { display: block; height: 100%; cursor: pointer; border: 2px solid var(--pe-line); border-radius: 12px; padding: 12px 14px 12px 38px; position: relative; font-size: .9rem; transition: border-color .15s, background .15s; }
.pe-travel label::before { content: ""; position: absolute; left: 12px; top: 14px; width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--pe-line); background: #fff; }
.pe-travel label::after { content: ""; position: absolute; left: 18px; top: 17px; width: 6px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); opacity: 0; }
.pe-travel label b { display: block; color: var(--pe-ink); }
.pe-travel label small { display: block; color: var(--pe-muted); margin-top: 3px; line-height: 1.4; }
.pe-travel input:checked + label { border-color: var(--pe-accent); background: var(--pe-accent-soft); }
.pe-travel input:checked + label::before { background: var(--pe-accent); border-color: var(--pe-accent); }
.pe-travel input:checked + label::after { opacity: 1; }
.pe-travel__note { margin-top: 10px; }

/* ── Pets ─────────────────────────────────────────────────────────────── */
.pe-pet { border: 1px dashed var(--pe-line); border-radius: 12px; padding: 18px 16px 6px; margin: 16px 0; background: var(--pe-soft); animation: pe-step-in .35s ease; }
.pe-pet__title { color: var(--pe-ink); margin-bottom: 12px; font-size: .98rem; font-weight: 700; }

/* ── Contact method chips ─────────────────────────────────────────────── */
.pe-contact-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.pe-contact label { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 9px 16px 9px 12px; border: 2px solid var(--pe-line); border-radius: 999px; background: #fff; font-weight: 700; font-size: .93rem; color: var(--pe-body); cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.pe-contact__icon { width: 20px; height: 20px; flex: 0 0 auto; color: var(--chip, var(--pe-ink)); }
.pe-contact input:checked + label { border-color: var(--chip, var(--pe-ink)); background: color-mix(in srgb, var(--chip, var(--pe-ink)) 12%, #fff); color: var(--pe-ink); }
.pe-contact--whatsapp { --chip: #25D366; }
.pe-contact--line { --chip: #06C755; }
.pe-contact--wechat { --chip: #07C160; }
.pe-contact--email { --chip: var(--kernol-blue-600); }
.pe-contact--phone { --chip: var(--kernol-navy-700); }
.pe-contact-detail { animation: pe-step-in .3s ease; }

/* ── Progressive steps ────────────────────────────────────────────────── */
.pe-step { margin: 0 0 8px; scroll-margin-top: 84px; }
.pe-step.pe-step--hidden { display: none; }
/* No fill-mode: a filled transform would leave each step a stacking context, painting
   later steps over an open list. */
.pe-step.pe-step--in { animation: pe-step-in .4s ease; }
@keyframes pe-step-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.pe-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 4px; background: var(--pe-line-soft); overflow: hidden; }
.pe-progress span { display: block; height: 100%; width: 0; background: var(--pe-accent); transition: width .35s ease; }

/* ── Errors, submit ───────────────────────────────────────────────────── */
.pe-form-error { display: none; background: var(--pe-danger-soft); color: var(--kernol-red-700); border: 1px solid var(--pe-danger-line); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: .92rem; }
.pe-form-error.is-visible { display: block; }
.pe-form-error__title { font-weight: 700; }
.pe-form-error ul { margin: 4px 0 0; padding-left: 1.2em; }
.pe-btn { display: inline-block; border: 0; cursor: pointer; text-decoration: none; font-weight: 700; border-radius: 999px; transition: background .15s ease, transform .15s ease; text-align: center; font-family: inherit; }
.pe-btn--primary { background: var(--pe-accent); color: #fff; padding: 14px 30px; font-size: 1.05rem; }
.pe-btn--primary:hover { background: var(--kernol-tan-600); }
.pe-submit { width: 100%; padding: 16px; font-size: 1.15rem; margin-top: 6px; }
.pe-submit[disabled], .pe-submit[aria-busy="true"] { opacity: .6; cursor: wait; transform: none; }
.pe-privacy-note { text-align: center; font-size: .8rem; color: var(--pe-muted); margin-top: 12px; }

/* ── Trust strip: what happens next ───────────────────────────────────── */
.pe-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 980px; margin: 0 auto; }
.pe-step-card { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-start; background: #fff; border: 1px solid var(--pe-line); border-radius: var(--pe-radius); padding: 18px; }
.pe-step-card__num { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; background: var(--step-c, var(--pe-accent)); color: #fff; font-weight: 800; font-size: 1.05rem; display: flex; align-items: center; justify-content: center; }
.pe-step-card:nth-child(1) { --step-c: var(--pe-accent); }
.pe-step-card:nth-child(2) { --step-c: var(--kernol-blue-600); }
.pe-step-card:nth-child(3) { --step-c: var(--kernol-teal-600); }
.pe-step-card h3 { color: var(--pe-ink); font-size: 1rem; align-self: center; }
.pe-step-card p { flex-basis: 100%; color: var(--pe-muted); font-size: .9rem; line-height: 1.5; }

/* ── Receipt (the sent page) ──────────────────────────────────────────── */
.pe-receipt > * + * { margin-top: 16px; }
.pe-receipt .pe-title { margin-bottom: 0; }
.pe-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--pe-muted); }
.pe-eyebrow--ok { color: var(--pe-ok); }
.pe-tick { width: 18px; height: 18px; fill: currentColor; }
.pe-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--pe-soft); border: 1px solid var(--pe-line-soft); }
.pe-facts dt { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--pe-muted); }
.pe-facts dd { margin-top: 2px; font-size: .97rem; font-weight: 600; color: var(--pe-ink); }
.pe-ref { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; }

/* ── Footer ───────────────────────────────────────────────────────────── */
.pe-footer { background: var(--pe-footer-bg); color: var(--pe-footer-mute); padding: 42px 0 28px; font-size: .88rem; }
.pe-footer a { color: var(--pe-footer-ink); text-decoration: none; }
.pe-footer a:hover { text-decoration: underline; }
.pe-footer__cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; margin-bottom: 30px; }
.pe-footer__name { color: #fff; font-size: 1.05rem; font-weight: 800; }
.pe-footer__brand p { margin: 10px 0 14px; line-height: 1.6; max-width: 30em; }
.pe-footer__col h4 { color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; margin: 0 0 12px; }
.pe-footer__col a, .pe-footer__col span { display: block; margin-bottom: 9px; font-size: .87rem; }
.pe-footer__base { border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 20px; display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; }
/* The one Orppio mark on the agency's own page. It sits in the base row beside
   their copyright, in the footer's quietest ink and at its smallest size: this
   page is the agency's shopfront and nothing here may compete with their name. */
.pe-poweredby { font-size: .78rem; color: var(--pe-footer-mute); }
.pe-poweredby a { color: var(--pe-footer-ink); text-decoration: underline; text-underline-offset: 2px; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .pe-steps { grid-template-columns: 1fr; gap: 12px; max-width: 560px; }
  .pe-footer__cols { grid-template-columns: 1fr 1fr; }
  .pe-travel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .pe-container { padding: 0 10px; }
  .pe-section { padding: 40px 0; }
  .pe-section--form { padding-top: 28px; }
  .pe-sub { margin-bottom: 30px; }
  .pe-header__inner { padding: 8px 10px; }
  .pe-header__actions { display: none; }
  .pe-brand__logo, .pe-brand__mark { height: 40px; width: 40px; }
  .pe-brand__tagline { font-size: .66rem; line-height: 1.3; }
  .pe-card { padding: 26px 16px 30px; }
  .pe-direction-grid { grid-template-columns: 1fr; }
  .pe-direction label { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; }
  .pe-direction label b { margin-top: 0; }
  .pe-direction label small { display: none; }
  .pe-form-row { grid-template-columns: 1fr; gap: 0; }
  .pe-leg { padding: 12px 12px 2px; }
  .pe-pet { padding: 16px 14px 4px; }
  .pe-choice label { min-height: 44px; padding: 9px 14px; }
  .pe-contact label { min-height: 44px; }
  .pe-facts { grid-template-columns: 1fr; }
  .pe-footer__cols { grid-template-columns: 1fr; gap: 24px; }
}
