/* BabCard — public pages (driver page, replaced page, errors).
   Kept small: drivers may be on slow connections. */

:root {
  --green: #0B6E4F;
  --green-dark: #08543C;
  --green-tint: #E3F2EC;
  --ink: #13201C;
  --ink-2: #33433E;
  --muted: #4B5A55;
  --line: #D5DDD9;
  --surface-2: #F3F6F5;
  --amber-bg: #FFF3D6;
  --amber-ink: #6B4700;
  --focus: #1A56DB;
  --font: system-ui, -apple-system, "Segoe UI", Tahoma, "Noto Sans Arabic", "Geeza Pro", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: #fff; color: var(--ink); font-family: var(--font); font-size: 1rem; line-height: 1.6;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--green); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

/* Status pages (404, replaced, errors) */
.status {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; width: 100%; max-width: 480px; margin-inline: auto; padding: 32px 24px; text-align: center;
}
.status h1 { margin: 0; font-size: 1.625rem; line-height: 1.4; }
.status p { margin: 0; font-size: 1rem; line-height: 1.7; }
.status-icon {
  display: flex; align-items: center; justify-content: center;
  width: 96px; height: 96px; border-radius: 999px; background: var(--amber-bg); color: var(--amber-ink);
}

.pub-footer { padding: 16px 16px 24px; text-align: center; color: var(--muted); font-size: .8125rem; }
.pub-footer p { margin: 0; }

/* Copy feedback */
.when-copied { display: none; }
.when-idle, .when-copied { align-items: center; justify-content: center; gap: 8px; }
.when-idle { display: inline-flex; }
.is-copied .when-idle { display: none; }
.is-copied .when-copied { display: inline-flex; }

/* Language switch */
.pub-lang {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px;
  color: var(--ink); font-weight: 600; text-decoration: none;
}
.status .pub-lang { position: absolute; top: 8px; inset-inline-end: 8px; }

/* Driver page */
.pub-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-block: 8px; padding-inline: 16px 8px; border-bottom: 1px solid #E1E7E4;
}
.pub-top h1 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.125rem; }
.pub-top h1 svg { color: var(--green); }
.driver { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 560px; margin-inline: auto; padding: 16px; }
.btn-location {
  display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 72px; padding: 10px 16px;
  border-radius: 14px; background: var(--green); color: #fff; text-decoration: none;
}
.btn-location:hover { background: var(--green-dark); color: #fff; }
.btn-location-text { display: flex; flex-direction: column; align-items: center; line-height: 1.3; }
.btn-location-main { font-size: 1.375rem; font-weight: 700; }
.btn-location-sub { font-size: .875rem; color: #E3F2EC; }
.box { margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; }
.box h2 { margin: 0 0 8px; font-size: .9375rem; font-weight: 600; color: var(--muted); }
.box-soft { border: 0; background: var(--surface-2); }
.addr-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.addr-code { margin: 0; font-family: var(--mono); font-size: 1.875rem; font-weight: 700; letter-spacing: 3px; }
.btn-copy {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 16px;
  border: 2px solid var(--green); border-radius: 12px; background: #fff; color: var(--green);
  font: inherit; font-weight: 700; cursor: pointer;
}
.btn-copy.is-copied { background: var(--green); color: #fff; }
.note-text { margin: 0; font-size: 1.125rem; line-height: 1.7; }
.meta { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: .8125rem; color: var(--muted); }
.meta svg { flex: none; }
.box-trust { display: flex; align-items: flex-start; gap: 12px; border-color: #B9DCCB; background: #EEF8F3; }
.box-trust > svg { flex: none; color: var(--green); }
.trust-main { margin: 0; font-size: .9375rem; font-weight: 600; line-height: 1.5; }
.box-trust .meta { margin-top: 4px; }
.btn-share {
  display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 12px;
  border: 1px solid #7C8B86; background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer;
}
.btn-share.is-copied { border-color: var(--green); background: var(--green); color: #fff; }

/* Door photo: at most ~45% of the visible screen, so "Open location" and the
   address are always on the first screen, even for tall photos. Tap = full size.
   svh = the screen height with the browser bars showing (iPhone Safari). */
.door-photo {
  position: relative; display: flex; justify-content: center; margin: -16px -16px 0;
  background: #E6ECE9; text-decoration: none;
}
.door-photo img { width: auto; height: auto; max-width: 100%; max-height: 45vh; max-height: 45svh; }
.photo-zoom {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; background: rgba(19, 32, 28, .78); color: #fff;
  font-size: .875rem; font-weight: 600;
}

/* Replaced page */
.status { position: relative; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--surface-2); font-size: .875rem; font-weight: 600; }
.callout { width: 100%; padding: 16px; border: 1px solid #B9DCCB; border-radius: 14px; background: #EEF8F3; font-size: 1.0625rem; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Demo page only */
.demo-banner p { margin: 0; }
.demo-banner { margin: 0; padding: 10px 16px; background: #FFF3D6; color: #6B4700; text-align: center;
  font-size: .9375rem; font-weight: 600; line-height: 1.5; }
.demo-banner a { color: #6B4700; font-weight: 700; white-space: nowrap; }
