/* PetWorld Visitor Kiosk — design system recreated from the 12-screen
   reference. Everything is sized in rem off one fluid root size, so the same
   layout fits 1920×1080 and 1366×768 without scrolling and scales down to
   tablets. */

:root {
  --blue: #1f6fe5;
  --blue-600: #185cc4;
  --blue-50: #eaf2fe;
  --blue-100: #d6e6fd;
  --green: #22a45d;
  --green-600: #1a8a4d;
  --green-50: #e8f6ee;
  --teal-head: #1a8f5a;
  --navy: #0f2747;
  --text: #22364f;
  --muted: #62789a;
  --line: #e1e8f1;
  --line-2: #cfdbe9;
  --bg: #f4f8fc;
  --card: #ffffff;
  --red: #e5484d;
  --red-50: #fdeced;

  --r-sm: 0.5rem;
  --r: 0.75rem;
  --r-lg: 1rem;
  --r-xl: 1.25rem;
  --shadow-sm: 0 1px 2px rgba(16, 42, 80, .06), 0 1px 1px rgba(16, 42, 80, .04);
  --shadow: 0 6px 18px rgba(20, 60, 120, .08), 0 1px 3px rgba(20, 60, 120, .06);
  --shadow-lg: 0 18px 40px rgba(20, 60, 120, .12), 0 3px 8px rgba(20, 60, 120, .06);
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  /* ≈19.5px at 1920×1080, ≈14px at 1366×768, never below 14px. */
  font-size: clamp(14px, 0.62vw + 0.62vh + 1px, 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
.ic { width: 1.25em; height: 1.25em; flex: none; }

/* ------------------------------------------------------------------ logo */

/* Official artwork (assets/img/petworld-logo.png, transparent, 895×212). */
.pw-logo { display: inline-flex; line-height: 0; user-select: none; }
.pw-logo img { height: 2.3rem; width: auto; }
.pw-logo.lg img { height: 3rem; }
.pw-logo.sm img { height: 2.1rem; }
/* Near-square logos (Wah Kong badge) need more height to stay legible. */
.pw-logo img.is-square { height: 3.4rem; }
.pw-logo.sm img.is-square { height: 3.6rem; }

/* Welcome page: PetWorld + Wah Kong side by side. */
.brand-pair { display: flex; align-items: center; gap: 1.1rem; }
.brand-divider { width: 1px; height: 2.8rem; background: var(--line-2); }
.brand-pair .pw-logo.lg img.is-square { height: 3.8rem; border-radius: .25rem; }

.site-img { position: relative; }
.site-badge {
  position: absolute; left: .6rem; top: .6rem;
  display: flex; align-items: center;
  background: rgba(255,255,255,.94); border-radius: .6rem; padding: .35rem .55rem;
  box-shadow: 0 4px 10px rgba(15, 39, 71, .18);
}
.site-img .site-badge img { height: 1.35rem; width: auto; object-fit: contain; }
.site-badge.is-square { padding: .25rem; }
.site-img .site-badge.is-square img { height: 3.4rem; border-radius: .3rem; }

/* ---------------------------------------------------------------- screens */

.kiosk { position: relative; min-height: 100vh; }

.screen {
  display: none;
  min-height: 100vh;
  flex-direction: column;
  background: linear-gradient(180deg, #fff 0%, #f7fafd 100%);
}
.screen.is-active { display: flex; animation: screenIn .38s var(--ease) both; }
.screen.is-active.from-left { animation-name: screenInLeft; }

@keyframes screenIn { from { opacity: 0; transform: translateX(1.5rem); } to { opacity: 1; transform: none; } }
@keyframes screenInLeft { from { opacity: 0; transform: translateX(-1.5rem); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(.75rem); } to { opacity: 1; transform: none; } }

/* ----------------------------------------------------------------- header */

.k-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1.1rem 2rem .6rem;
}
.k-back {
  justify-self: start;
  display: inline-flex; align-items: center; gap: .35rem;
  border: 0; background: none; padding: .5rem .6rem .5rem .2rem;
  font-size: .95rem; font-weight: 600; color: var(--navy);
  border-radius: var(--r-sm);
}
.k-back .ic { width: 1.4rem; height: 1.4rem; border: 1.5px solid var(--line-2); border-radius: 50%; padding: .2rem; background: #fff; }
.k-back:active { transform: scale(.97); }

/* ------------------------------------------------------------------ steps */

.k-steps {
  list-style: none; margin: .4rem auto 0; padding: 0;
  display: flex; align-items: center; justify-content: center; gap: 0;
  width: min(44rem, 92vw);
}
.k-steps li {
  display: flex; align-items: center; gap: .45rem;
  font-size: .78rem; font-weight: 500; color: #9aabc2;
  flex: 1;
}
.k-steps li:last-child { flex: none; }
.k-steps li::after {
  content: ""; flex: 1; height: 1px; background: var(--line-2); margin: 0 .7rem 0 .3rem;
}
.k-steps li:last-child::after { display: none; }
.k-steps .num {
  width: 1.55rem; height: 1.55rem; border-radius: 50%;
  display: grid; place-items: center;
  font-size: .72rem; font-weight: 700;
  border: 1.5px solid var(--line-2); color: #9aabc2; background: #fff;
  transition: background .25s, color .25s, border-color .25s;
}
.k-steps li.is-done .num, .k-steps li.is-current .num { background: var(--blue); border-color: var(--blue); color: #fff; }
.k-steps li.is-done, .k-steps li.is-current { color: var(--blue); font-weight: 600; }
.k-steps li.is-done::after { background: var(--blue-100); }

/* ------------------------------------------------------------------- body */

.k-body {
  flex: 1;
  width: min(60rem, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 7vh;
  display: flex; flex-direction: column; justify-content: center;
}
.k-body.narrow { width: min(46rem, calc(100vw - 2rem)); }
.k-body > * { animation: fadeUp .45s var(--ease) both; }
.k-body > *:nth-child(2) { animation-delay: .05s; }
.k-body > *:nth-child(3) { animation-delay: .1s; }

.k-title { margin-bottom: 1.6rem; }
.k-title.center { text-align: center; }
.k-title h2 { margin: 0; font-size: 1.55rem; font-weight: 700; color: var(--navy); letter-spacing: -.01em; }
.k-title p { margin: .45rem 0 0; font-size: .92rem; color: var(--blue); font-weight: 500; }

.k-foot {
  margin-top: 2.4rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}

.center-col { align-items: center; text-align: center; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 3.2rem; padding: 0 2.2rem;
  border-radius: var(--r);
  border: 1.5px solid transparent;
  font-size: 1rem; font-weight: 600; letter-spacing: .005em;
  transition: background .2s, box-shadow .2s, transform .12s, border-color .2s, color .2s;
  user-select: none;
}
.btn:active:not(:disabled) { transform: scale(.975); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; min-width: 11rem; box-shadow: 0 6px 14px rgba(31, 111, 229, .25); }
.btn-primary:hover:not(:disabled) { background: var(--blue-600); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line-2); min-width: 8rem; border-radius: 999px; }
.btn-ghost:hover { border-color: #b3c4da; }
.btn-outline { background: #fff; color: var(--blue); border-color: var(--blue); }
.btn-outline:hover:not(:disabled) { background: var(--blue-50); }
.btn-block { width: 100%; }
.btn-lg { min-height: 3.5rem; }
.btn-wide { min-width: 14rem; }
.btn-pill { border-radius: 999px; }
.link-btn { border: 0; background: none; color: var(--blue); font-weight: 600; font-size: .9rem; padding: .8rem; }

.btn.is-loading { pointer-events: none; }
.btn.is-loading::before {
  content: ""; width: 1.05rem; height: 1.05rem; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------- inputs */

.input {
  width: 100%; height: 3.1rem;
  padding: 0 1rem;
  background: #fff;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-sm);
  font-size: .98rem; color: var(--navy);
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%2362789a' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center; background-size: 1.1rem;
  padding-right: 2.4rem;
}
.input::placeholder { color: #9fb0c6; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 111, 229, .14); }
.input.is-invalid { border-color: var(--red); box-shadow: 0 0 0 4px rgba(229, 72, 77, .12); }
.input-xl { height: 3.9rem; font-size: 1.3rem; padding: 0 1.3rem; letter-spacing: .02em; border-color: #a9c6f3; border-radius: var(--r); }
.field-msg { min-height: 1.3rem; margin: .5rem 0 0; font-size: .85rem; color: var(--red); font-weight: 500; }
.form-error { min-height: 1.2rem; margin: .8rem 0 0; color: var(--red); font-size: .88rem; font-weight: 500; text-align: center; }

/* ----------------------------------------------------------------- avatar */

.avatar {
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  background: var(--blue-50); color: var(--blue);
  border: 1.5px solid var(--blue-100);
}
.avatar .ic { width: 55%; height: 55%; }
.avatar.lg { width: 4.4rem; height: 4.4rem; background: #fff; color: var(--green); border: 0; box-shadow: var(--shadow-sm); }

/* ============================================================ 01 LANDING */

.s-landing, .s-success { position: relative; overflow: hidden; background: linear-gradient(160deg, #f3f9ff 0%, #eef7f3 55%, #f5fbff 100%); }

.landing-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.blob { position: absolute; border-radius: 50%; filter: blur(2px); }
.blob.b1 { width: 55vw; height: 55vw; left: -18vw; top: -26vw; background: radial-gradient(circle at 60% 60%, #dcecfb 0%, rgba(220,236,251,0) 70%); }
.blob.b2 { width: 50vw; height: 50vw; right: -16vw; bottom: -28vw; background: radial-gradient(circle at 40% 40%, #d9f0e2 0%, rgba(217,240,226,0) 70%); }
.blob.b3 { width: 38vw; height: 22vw; right: 8vw; top: -8vw; background: radial-gradient(ellipse, #e3f0fc 0%, rgba(227,240,252,0) 70%); }

.leaf { position: absolute; width: clamp(9rem, 17vw, 20rem); opacity: .95; }
.leaf-tr { right: -3rem; top: 2.5rem; transform: scaleX(-1) rotate(200deg); width: clamp(8rem, 13vw, 16rem); opacity: .5; }
.leaf-bl { left: 13vw; bottom: -4rem; transform: rotate(8deg); width: clamp(10rem, 19vw, 24rem); }
.leaf-br { right: 12vw; bottom: -4rem; transform: scaleX(-1) rotate(8deg); width: clamp(10rem, 19vw, 24rem); }

.pet { position: absolute; bottom: 0; height: min(60vh, 42rem); width: auto; filter: drop-shadow(0 10px 20px rgba(30, 60, 90, .12)); }
.pet-dog { left: max(-2vw, -2rem); }
.pet-cat { right: max(-2vw, -2rem); height: min(53vh, 37rem); }

.landing-top {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.6rem 2.4rem;
}
.admin-link {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .85rem; font-weight: 600; color: var(--navy); text-decoration: none;
  background: rgba(255,255,255,.85); border: 1px solid var(--line-2); border-radius: 999px;
  padding: .5rem .95rem; box-shadow: var(--shadow-sm);
}
.admin-link .ic { width: .95rem; height: .95rem; color: var(--blue); }

.landing-body {
  position: relative; z-index: 2;
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 1rem 2rem;
  text-align: center;
}
.welcome { margin: 0; line-height: 1.02; }
.welcome span { display: block; font-size: 3.3rem; font-weight: 700; color: var(--navy); letter-spacing: -.02em; }
.welcome strong { display: block; font-size: 4.9rem; font-weight: 800; color: var(--teal-head); letter-spacing: -.03em; margin-top: .15rem; }
.welcome-sub { margin: 1.1rem 0 2.6rem; font-size: 1.35rem; color: var(--navy); }

.site-cards { display: flex; gap: 2rem; justify-content: center; }
.site-card {
  position: relative;
  width: 24.5rem;
  display: flex; flex-direction: column; align-items: stretch; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: .65rem .65rem 1.2rem;
  box-shadow: var(--shadow);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.site-card:hover, .site-card:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--blue-100); outline: none; }
.site-card:active { transform: translateY(-1px) scale(.99); }
.site-img { display: block; aspect-ratio: 16 / 8.2; border-radius: var(--r); overflow: hidden; background: var(--blue-50); }
.site-img img { width: 100%; height: 100%; object-fit: cover; }
.site-text { padding: 1.1rem .7rem 0; display: flex; flex-direction: column; gap: .55rem; padding-right: 4rem; }
.site-card .site-name { font-size: 1.3rem; }
.site-card .site-sub { font-size: .9rem; }
.site-name { font-size: 1.08rem; font-weight: 700; color: var(--navy); line-height: 1.3; }
.site-sub { font-size: .78rem; color: var(--blue); font-weight: 500; }
.tone-green .site-sub { color: var(--green); }
.site-go {
  position: absolute; right: 1rem; bottom: 1.1rem;
  width: 3rem; height: 3rem; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: var(--blue);
  box-shadow: 0 6px 12px rgba(31,111,229,.3);
  transition: transform .25s var(--ease);
}
.tone-green .site-go { background: var(--green); box-shadow: 0 6px 12px rgba(34,164,93,.3); }
.site-card:hover .site-go { transform: translateX(3px); }
.site-go .ic { width: 1.2rem; height: 1.2rem; }

.landing-hint { margin: 2.2rem 0 0; font-size: 1.1rem; color: var(--navy); font-weight: 500; }
.checkout-link {
  margin-top: .9rem;
  display: inline-flex; align-items: center; gap: .45rem;
  border: 1px solid var(--line-2); background: rgba(255,255,255,.8);
  border-radius: 999px; padding: .55rem 1.1rem; font-size: .82rem; color: var(--muted);
}
.checkout-link b { color: var(--blue); font-weight: 600; }
.checkout-link .ic { width: 1rem; height: 1rem; color: var(--blue); }

/* ============================================================ 02 COMPANY */

.pick-cards { display: flex; justify-content: center; gap: 1.6rem; }
.pick-card {
  position: relative;
  width: 17.5rem;
  display: flex; flex-direction: column; text-align: left;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-lg);
  padding: .6rem .6rem 1.2rem;
  box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s, transform .2s var(--ease);
}
.pick-card .site-name { padding: 1rem .6rem 0; }
.pick-card .site-sub { padding: .45rem .6rem 0; }
.pick-card .radio {
  position: absolute; right: 1rem; bottom: 1.1rem;
  width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 1.5px solid #a7b8cf; background: #fff;
  transition: border-color .2s;
}
.pick-card .radio::after { content: ""; position: absolute; inset: .22rem; border-radius: 50%; background: var(--blue); transform: scale(0); transition: transform .2s var(--ease); }
.pick-card:hover { transform: translateY(-3px); }
.pick-card[aria-checked="true"] { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,111,229,.12), var(--shadow-lg); }
.pick-card[aria-checked="true"] .radio { border-color: var(--blue); }
.pick-card[aria-checked="true"] .radio::after { transform: scale(1); }

/* ======================================================= 03 VISITOR TYPE */

.type-cards { display: flex; justify-content: center; gap: 1.6rem; margin-top: .6rem; }
.type-card {
  width: 18.5rem; min-height: 15.5rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
  border: 0; border-radius: var(--r-lg); color: #fff; padding: 1.6rem 1.2rem;
  box-shadow: var(--shadow-lg);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), filter .2s;
}
.type-card.blue { background: linear-gradient(160deg, #3f8cf5 0%, #1f6fe5 60%, #1a62d2 100%); box-shadow: 0 14px 30px rgba(31,111,229,.28); }
.type-card.green { background: linear-gradient(160deg, #3cc37b 0%, #22a45d 60%, #1c9453 100%); box-shadow: 0 14px 30px rgba(34,164,93,.28); }
.type-card:hover { transform: translateY(-4px); }
.type-card:active { transform: scale(.98); filter: brightness(.97); }
.type-icon .ic { width: 3.2rem; height: 3.2rem; }
.type-name { font-size: 1.35rem; font-weight: 700; margin-top: .4rem; }
.type-desc { font-size: .85rem; line-height: 1.45; opacity: .95; text-align: center; }

.type-more { display: flex; justify-content: center; align-items: center; gap: .7rem; margin-top: 2.2rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; gap: .45rem;
  border: 1.5px solid var(--line-2); background: #fff; border-radius: 999px;
  padding: .6rem 1.1rem; font-size: .85rem; font-weight: 600; color: var(--navy);
  transition: border-color .2s, background .2s;
}
.chip .ic { width: 1.05rem; height: 1.05rem; color: var(--blue); }
.chip:hover { border-color: var(--blue); background: var(--blue-50); }
.chip-out { color: var(--muted); }

/* ======================================================== 04 IC INPUT */

.id-row { display: flex; gap: .8rem; }
.id-row .input-xl { flex: 1; }
.btn-scan { min-height: 3.9rem; padding: 0 1.3rem; background: var(--blue-50); color: var(--blue); border-color: var(--blue-100); border-radius: var(--r); }
.btn-scan .ic { width: 1.4rem; height: 1.4rem; }
.btn-scan:hover { background: var(--blue-100); }

.keypad-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 1.5rem; margin-top: .6rem; }
.keypad-row > .btn-ghost { justify-self: start; }
.keypad-row > .btn-primary { justify-self: end; }
.keypad { display: grid; grid-template-columns: repeat(3, 4.3rem); gap: .7rem; }
.keypad button {
  height: 3.6rem; border-radius: var(--r-sm);
  border: 1.5px solid var(--line); background: #fff;
  font-size: 1.3rem; font-weight: 600; color: var(--navy);
  box-shadow: var(--shadow-sm);
  transition: background .12s, transform .08s, border-color .15s;
}
.keypad button:active { background: var(--blue-50); border-color: var(--blue-100); transform: scale(.95); }
.keypad .k-fn { font-size: .8rem; color: var(--muted); background: #f6f9fc; }
.keypad .k-fn .ic { width: 1.5rem; height: 1.5rem; color: var(--navy); }

/* ================================================== 05 EXISTING VISITOR */

.welcome-card {
  border: 1px solid #cfe9da; border-radius: var(--r-lg);
  background: linear-gradient(180deg, #e9f7ef 0%, #f6fbf8 45%, #fff 100%);
  box-shadow: var(--shadow);
  padding: 1.6rem 1.8rem 1.4rem;
}
.wc-head { position: relative; display: flex; align-items: center; gap: 1.3rem; padding-bottom: 1.3rem; }
.wc-head p { margin: 0; font-size: 1.05rem; color: var(--navy); font-weight: 600; }
.wc-head h2 { margin: .2rem 0 0; font-size: 1.7rem; color: var(--navy); font-weight: 800; letter-spacing: -.01em; }
.badge-soft { position: absolute; right: 0; top: 0; font-size: .72rem; font-weight: 600; color: var(--green-600); background: #fff; border: 1px solid #cfe9da; border-radius: 999px; padding: .3rem .75rem; }

.info-list { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: .6rem 1.3rem; }
.info-list > div { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid #f0f3f7; }
.info-list > div:last-child { border-bottom: 0; }
.info-list dt { font-size: .82rem; color: var(--muted); }
.info-list dd { margin: 0; font-size: .88rem; color: var(--navy); font-weight: 500; }
.info-list.compact { border: 0; padding: 0; }
.info-list.compact > div { grid-template-columns: 9.5rem 1fr; padding: .55rem 0; }

/* ======================================================= 06 APPOINTMENT */

.appt-card {
  display: grid; grid-template-columns: auto 1fr 1fr; gap: 1.8rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 1.8rem 2rem;
}
.appt-icon { width: 3.2rem; height: 3.2rem; border-radius: var(--r); background: var(--blue-50); color: var(--blue); display: grid; place-items: center; }
.appt-icon .ic { width: 1.7rem; height: 1.7rem; }
.appt-col { margin: 0; display: flex; flex-direction: column; gap: 1.1rem; }
.appt-col + .appt-col { border-left: 1px solid var(--line); padding-left: 1.8rem; }
.appt-col dt { font-size: .76rem; color: var(--muted); }
.appt-col dd { margin: .25rem 0 0; font-size: .98rem; color: var(--navy); font-weight: 600; }

/* ========================================================== 07 FORM */

.visit-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.05rem 1.6rem; }
.field label, .field-split label { display: block; font-size: .8rem; color: var(--muted); font-weight: 500; margin-bottom: .4rem; }
.field label i { color: var(--red); font-style: normal; }
.field-split { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }

/* ========================================================== 08 SCAN */

.scan-layout { display: grid; grid-template-columns: 1fr 15rem; gap: 2rem; align-items: start; }
.cam-frame {
  position: relative; aspect-ratio: 4 / 3; max-height: 52vh;
  border-radius: var(--r-lg); overflow: hidden;
  background: #1b2433; border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
}
.cam-frame video, .cam-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-frame canvas { object-fit: contain; background: #eef3f8; }
.cam-guide { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.cam-guide span { width: 72%; aspect-ratio: 85.6 / 54; border: 2.5px dashed rgba(255,255,255,.85); border-radius: 1rem; box-shadow: 0 0 0 100vmax rgba(10, 20, 35, .28); }
.cam-frame.has-shot .cam-guide { display: none; }
.cam-empty, .cam-busy { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .7rem; color: #cfd9e6; font-size: .9rem; text-align: center; padding: 1rem; }
.cam-empty .ic { width: 2.6rem; height: 2.6rem; opacity: .7; }
.cam-busy { background: rgba(15, 39, 71, .55); color: #fff; font-weight: 600; }
.spinner { width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; }
.cam-actions { display: flex; flex-direction: column; gap: .9rem; align-items: stretch; padding-top: .4rem; }
.cam-actions .link-btn { align-self: center; }
.ocr-result { font-size: .85rem; line-height: 1.5; border-radius: var(--r); padding: .8rem 1rem; background: var(--green-50); color: var(--green-600); border: 1px solid #cfe9da; animation: fadeUp .3s var(--ease); }
.ocr-result.warn { background: #fff7e6; color: #9a6400; border-color: #f6dfb0; }
.ocr-result b { color: var(--navy); display: block; }

/* ========================================================== 09 REVIEW */

.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.review-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 1.3rem 1.5rem; }
.review-card h3 { margin: 0 0 .9rem; font-size: .92rem; font-weight: 700; color: var(--navy); }
.review-who { display: flex; align-items: center; gap: .9rem; padding: .3rem 0 1rem; border-bottom: 1px solid #f0f3f7; margin-bottom: .4rem; }
.review-who strong { font-size: 1.1rem; color: var(--navy); }

/* ========================================================== 10 SUCCESS */

.s-success .blob.b1 { background: radial-gradient(circle at 60% 60%, #e1eefc 0%, rgba(225,238,252,0) 70%); }
.spark { position: absolute; width: .7rem; height: .7rem; border-radius: 2px; transform: rotate(45deg); opacity: 0; animation: spark 1.4s .3s var(--ease) forwards; }
.spark.s1 { left: 22%; top: 16%; background: #7fd3a1; }
.spark.s2 { left: 30%; top: 30%; background: #9cc3f7; width: .5rem; height: .5rem; }
.spark.s3 { right: 24%; top: 14%; background: #9cc3f7; }
.spark.s4 { right: 30%; top: 32%; background: #7fd3a1; width: .5rem; height: .5rem; }
.spark.s5 { left: 26%; top: 48%; background: #cfe0f6; }
.spark.s6 { right: 27%; top: 50%; background: #bfe7cf; }
@keyframes spark { 0% { opacity: 0; transform: translateY(1rem) rotate(0); } 60% { opacity: 1; } 100% { opacity: .85; transform: translateY(0) rotate(45deg); } }

.success-body { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.6rem 1rem 2rem; text-align: center; }
.success-body .pw-logo { position: absolute; top: 1.6rem; left: 50%; transform: translateX(-50%); }
.check-anim { width: 5.4rem; height: 5.4rem; margin-bottom: 1.1rem; }
.check-anim circle { fill: var(--green); transform-box: fill-box; transform-origin: center; animation: pop .45s var(--ease) both; }
.check-anim path { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 44; stroke-dashoffset: 44; animation: draw .4s .35s var(--ease) forwards; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.success-title { margin: 0; font-size: 2rem; font-weight: 800; color: var(--teal-head); letter-spacing: -.02em; }
.success-sub { margin: .5rem 0 1.6rem; font-size: 1.05rem; color: var(--green-600); font-weight: 600; }
.pass-card {
  display: grid; grid-template-columns: 1fr auto; text-align: left;
  width: min(30rem, 92vw);
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  animation: fadeUp .5s .25s var(--ease) both;
}
.pass-left { padding: 1.3rem 1.4rem; }
.pass-right { padding: 1.1rem 1.3rem; border-left: 1.5px dashed var(--line-2); text-align: center; }
.pass-label { margin: 0 0 .8rem; font-size: .78rem; color: var(--green-600); font-weight: 600; }
.pass-right .pass-label { color: var(--navy); }
.pass-host { display: flex; gap: .9rem; align-items: flex-start; }
.pass-host strong { display: block; font-size: 1.1rem; color: var(--navy); }
.pass-host span:not(.avatar) { display: block; font-size: .85rem; color: var(--muted); margin-top: .2rem; }
.qr { width: 6.2rem; height: 6.2rem; margin: 0 auto; }
.qr svg { width: 100%; height: 100%; display: block; }
.pass-code { margin: .5rem 0 0; font-size: .72rem; color: var(--muted); }
.pass-code b { color: var(--navy); letter-spacing: .12em; font-size: .85rem; }
.success-note { margin: 1.4rem 0 1rem; color: var(--blue); font-size: .92rem; font-weight: 500; }
.s-success .btn-pill { min-width: 15rem; }
.s-success.is-checkout .pass-card { display: none; }

/* ======================================================== 11 NOT FOUND */

.nf-illus { width: 11rem; margin: 1rem auto 1.4rem; }
.nf-illus.sm { width: 7rem; margin-top: 0; }
.nf-title { margin: 0; font-size: 1.4rem; color: var(--navy); font-weight: 700; }
.nf-sub { margin: .7rem 0 2rem; color: var(--blue); font-size: .95rem; line-height: 1.55; }
.center-col .btn-block { max-width: 24rem; }
.center-col .btn-block + .btn-block { margin-top: .9rem; }

/* ============================================================ MODAL */

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1rem; background: rgba(15, 39, 71, .42); animation: fade .25s ease both; }
.modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.modal-card { width: min(42rem, 100%); max-height: calc(100vh - 2rem); overflow: auto; background: #fff; border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: 1.8rem 2rem; animation: fadeUp .3s var(--ease) both; }
.modal-card h2 { margin: 0; font-size: 1.4rem; color: var(--navy); }
.modal-sub { margin: .4rem 0 1rem; color: var(--blue); font-size: .9rem; }
.rules { margin: 0 0 1rem; padding-left: 1.3rem; color: var(--text); font-size: .88rem; line-height: 1.55; columns: 2; column-gap: 2rem; }
.rules li { break-inside: avoid; margin-bottom: .3rem; }
.check { display: flex; gap: .7rem; align-items: flex-start; font-size: .88rem; padding: .8rem 1rem; background: var(--bg); border-radius: var(--r); }
.check input { width: 1.3rem; height: 1.3rem; accent-color: var(--blue); flex: none; margin-top: .1rem; }
.check a { color: var(--blue); }
.q { font-size: .88rem; margin: 1rem 0 .6rem; }
.yn { display: flex; gap: .8rem; }
.yn label { flex: 1; }
.yn input { position: absolute; opacity: 0; }
.yn span { display: block; text-align: center; padding: .8rem; border: 1.5px solid var(--line-2); border-radius: var(--r); font-weight: 600; transition: all .15s; }
.yn input:checked + span { border-color: var(--blue); background: var(--blue-50); color: var(--blue); }
.yn input:focus-visible + span { box-shadow: 0 0 0 3px rgba(31,111,229,.25); }

/* ====================================================== RESPONSIVE */

/* Short landscape screens (1366×768 and similar): trim vertical rhythm. */
@media (max-height: 820px) and (min-width: 900px) {
  .k-body { padding-top: 1rem; padding-bottom: 4vh; }
  .k-title { margin-bottom: 1.2rem; }
  .welcome-sub { margin-bottom: 1.6rem; }
  .landing-top { padding: 1.1rem 2rem; }
  .keypad button { height: 3.2rem; }
}

@media (max-width: 1100px) {
  .pet { height: min(40vh, 22rem); opacity: .9; }
  .pet-cat { height: min(35vh, 19rem); }
}

/* Tablet portrait / phones: stack, keep touch targets. */
@media (max-width: 820px) {
  .pet { display: none; }
  .site-cards, .pick-cards, .type-cards { flex-direction: column; align-items: center; gap: 1rem; }
  .site-card, .pick-card, .type-card { width: min(24rem, 100%); }
  .type-card { min-height: 10rem; }
  .welcome span { font-size: 2rem; }
  .welcome strong { font-size: 3rem; }
  .k-steps .lbl { display: none; }
  .k-steps { width: min(18rem, 80vw); }
  .visit-form, .review-grid, .scan-layout { grid-template-columns: 1fr; }
  .cam-frame { max-height: 38vh; }
  .appt-card { grid-template-columns: 1fr; }
  .appt-col + .appt-col { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 1.1rem; }
  .keypad-row { grid-template-columns: 1fr 1fr; }
  .keypad-row .keypad { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
  .info-list > div { grid-template-columns: 8rem 1fr; }
  .rules { columns: 1; }
  .k-header { padding: .9rem 1rem .4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .check-anim path { stroke-dashoffset: 0; }
}

/* ------------------------------------------- mobile number step */
.phone-row { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: .8rem; }
.country-select { font-size: 1rem; font-weight: 600; padding-right: 2.4rem; text-overflow: ellipsis; }

/* ------------------------------------------- details step: scan or type */
.form-title { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; }
.form-title .btn-scan { min-height: 3.2rem; white-space: nowrap; }
.field label .opt { color: var(--muted); font-weight: 400; }
.input[readonly] { background: #f3f6fa; color: var(--muted); }

/* failed-scan tips */
.ocr-result ul { margin: .5rem 0 .6rem; padding-left: 1.1rem; }
.ocr-result.warn li { margin: .25rem 0; color: #7a5200; }
.ocr-result.warn li b, .ocr-result.warn > b { color: #5c3d00; }
.ocr-result.warn > span { display: block; color: #7a5200; }

@media (max-width: 820px) {
  .phone-row { grid-template-columns: 1fr; }
  .form-title { flex-direction: column; align-items: stretch; }
}

/* Scan screen: a wider right column so failure tips fit without scrolling. */
.scan-layout { grid-template-columns: minmax(0, 1fr) 19rem; }
.ocr-result { font-size: .8rem; line-height: 1.45; padding: .7rem .9rem; }
.ocr-result ul { margin: .35rem 0 .45rem; }
.ocr-result li { margin: .15rem 0; }
@media (max-width: 820px) { .scan-layout { grid-template-columns: 1fr; } }
/* Bold words inside the tips stay in the sentence (the success message's
   IC / name lines are block-level on purpose). */
.ocr-result li b, .ocr-result > span b { display: inline; }
.ocr-result > b { display: block; margin-bottom: .1rem; }

/* ------------------------------------------------------------------
   Details step: "Scan IC / Passport" or "Fill in manually" first; the
   form drops down after a choice. .is-open is set on the screen.
   ------------------------------------------------------------------ */
.detail-head { display: flex; flex-direction: column; align-items: center; text-align: center; }
.detail-head .k-title { margin-bottom: 1.4rem; }
.detail-choice { display: flex; flex-direction: column; gap: 1rem; width: min(34rem, 100%); }
.choice-btn {
  display: flex; align-items: center; gap: 1.1rem; text-align: left;
  min-height: 5.4rem; padding: 1.1rem 1.4rem;
  border-radius: var(--r-lg); border: 1.5px solid var(--line-2); background: #fff; color: var(--navy);
  box-shadow: var(--shadow); transition: transform .2s var(--ease), box-shadow .2s, background .2s;
}
.choice-btn:active { transform: scale(.985); }
.choice-btn .ic { width: 2.3rem; height: 2.3rem; flex: none; color: var(--blue); }
.choice-btn b { display: block; font-size: 1.15rem; font-weight: 700; }
.choice-btn small { display: block; font-size: .82rem; color: var(--muted); margin-top: .2rem; }
.choice-scan { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 10px 22px rgba(31, 111, 229, .25); }
.choice-scan .ic, .choice-scan small { color: #fff; }
.choice-scan small { opacity: .9; }
.choice-scan[aria-expanded="true"] { background: var(--blue-600); }
.scan-menu { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; animation: fadeUp .25s var(--ease); }
.scan-menu .btn { min-height: 3.4rem; padding: 0 1rem; }

/* The form, folded away until a choice is made. */
.form-drop { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.form-drop-inner { overflow: hidden; min-height: 0; }
.screen.is-open .form-drop { grid-template-rows: 1fr; }
.screen.is-open .form-drop-inner { overflow: visible; }
.screen[data-screen="form"]:not(.is-open) [data-form-next] { visibility: hidden; }
.filled-note { display: flex; align-items: center; gap: .5rem; margin: 0 0 .9rem; padding: .6rem .9rem; border-radius: var(--r-sm);
  background: var(--green-50); color: var(--green-600); font-size: .85rem; font-weight: 600; border: 1px solid #cfe9da; }
.filled-note .ic { width: 1.1rem; height: 1.1rem; }

/* Open: title left, the two choices as a compact row on the right. */
.screen.is-open .detail-head { flex-direction: row; align-items: center; justify-content: space-between; gap: 1.2rem; text-align: left; margin-bottom: 1.1rem; }
.screen.is-open .detail-head .k-title { margin-bottom: 0; }
.screen.is-open .detail-choice { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; align-items: center; width: auto; gap: .6rem; }
.screen.is-open .choice-btn { min-height: 2.9rem; padding: .45rem 1rem; gap: .5rem; box-shadow: none; }
.screen.is-open .choice-btn .ic { width: 1.25rem; height: 1.25rem; }
.screen.is-open .choice-btn b { font-size: .88rem; }
.screen.is-open .choice-btn small { display: none; }
.screen.is-open .scan-menu { order: 3; width: 100%; grid-template-columns: auto auto; justify-content: end; }
.screen.is-open .scan-menu .btn { min-height: 2.9rem; font-size: .88rem; }

@media (max-width: 820px) {
  .screen.is-open .detail-head { flex-direction: column; align-items: stretch; }
  .screen.is-open .detail-choice { justify-content: stretch; }
  .screen.is-open .choice-btn { flex: 1; }
}

/* ------------------------------------------------ help strip (footer) */
.k-help {
  display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap;
  padding: .55rem 1rem .75rem; font-size: .85rem; color: var(--muted);
  border-top: 1px solid var(--line); background: rgba(255, 255, 255, .7);
}
.k-help[hidden] { display: none !important; }
.k-help > span { display: inline-flex; align-items: center; gap: .4rem; }
.k-help > span .ic { width: 1rem; height: 1rem; color: var(--blue); }
.k-help b { color: var(--navy); }
.k-help a[data-help-tel] { color: var(--blue); font-weight: 600; text-decoration: none; white-space: nowrap; }
.wa-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .85rem; border-radius: 999px; background: #25d366; color: #fff;
  font-weight: 700; font-size: .82rem; text-decoration: none; box-shadow: 0 4px 10px rgba(37, 211, 102, .3);
}
.wa-btn .ic { width: 1.05rem; height: 1.05rem; }
.wa-btn:active { transform: scale(.97); }
