/* petcv — one stylesheet for the site, the app, the share page and the PDF.
   Plain on purpose: it is a CV, and it should read like a tidy document. */

:root {
  color-scheme: light dark;
  --ink: #1e2420;
  --bg: #f6f4ef;
  --paper: #ffffff;
  --line: #e1ddd3;
  --muted: #5d665f;
  --brand: #2f5d50;
  --brand-ink: #f5f2ea;
  --accent: #c9822b;
  --good: #1f7a4d;
  --bad: #b23b3b;
  --warn: #9a6200;
  --warn-bg: #fff4dc;
  --warn-line: #ecc77a;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e7e5de; --bg: #121614; --paper: #1a201d; --line: #2c3530; --muted: #9ba59e;
    --brand: #7cbfa9; --brand-ink: #0e1311; --accent: #e2a64a; --good: #4cc08a; --bad: #ef7d7d; --warn: #e2b04a;
    --warn-bg: #2d2717; --warn-line: #6d5a2c;
  }
}

* { box-sizing: border-box; }
/* Classes that set display (.claim, .btn, .card…) must not win over hidden. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--brand); }
h1 { font-size: clamp(28px, 4.6vw, 42px); letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 12px; }
h2 { font-size: 22px; letter-spacing: -0.01em; margin: 32px 0 10px; }
h3 { font-size: 17px; margin: 20px 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small, .hint { font-size: 14px; }
.hint { color: var(--muted); margin-top: 6px; }
.error { color: var(--bad); min-height: 1em; }
.ok { color: var(--good); }
.bad { color: var(--bad); font-weight: 650; }
.warn { color: var(--warn); font-weight: 650; }
.lede { font-size: 19px; color: var(--muted); max-width: 680px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; font-weight: 700; color: var(--accent); margin: 0 0 4px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--paper); padding: 8px 12px; z-index: 10; }

main { max-width: 820px; margin: 0 auto; padding: 36px 20px 64px; }
main.wide { max-width: 1080px; }

/* ── Header and footer ─────────────────────────────────────────────────── */

.site-header {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--paper); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.site-header nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-header nav a { color: var(--muted); text-decoration: none; font-weight: 550; }
.site-header nav a[aria-current="page"], .site-header nav a:hover { color: var(--ink); }
.site-header .account { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.sync-dot[data-state="synced"] { background: var(--good); }
.sync-dot[data-state="syncing"] { background: var(--accent); }
.sync-dot[data-state="error"], .sync-dot[data-state="offline"] { background: var(--bad); }

.claim { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 10px 20px; background: var(--warn-bg); border-bottom: 1px solid var(--warn-line); }

.site-footer {
  display: flex; gap: 18px; justify-content: space-between; flex-wrap: wrap;
  padding: 24px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px;
}
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }

/* ── Controls ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 10px 18px; border-radius: 8px; border: 1px solid var(--brand);
  background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 650;
  text-decoration: none; cursor: pointer;
}
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.ghost[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.small { padding: 5px 11px; font-size: 14px; }
.btn.big { padding: 13px 24px; font-size: 18px; }
.wide-btn { width: 100%; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 4px; }
label.inline { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; margin: 0; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
}
input[type="checkbox"], input[type="radio"] { width: auto; }
input[type="file"] { padding: 6px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 14px; }
.honeypot { position: absolute; left: -5000px; }
progress { width: 100%; height: 8px; accent-color: var(--brand); }

/* ── Blocks ────────────────────────────────────────────────────────────── */

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 14px 0; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card.narrow { max-width: 440px; }
details.card summary { cursor: pointer; }
details.card[open] summary { margin-bottom: 10px; }
.notice { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius); padding: 10px 14px; margin: 12px 0; }
.empty { color: var(--muted); padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.pill { display: inline-block; margin-left: 8px; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); color: var(--muted); vertical-align: 1px; }
.pill.good { color: var(--good); border-color: var(--good); }
.pill.bad { color: var(--bad); border-color: var(--bad); }
blockquote { margin: 10px 0; padding: 4px 0 4px 14px; border-left: 3px solid var(--line); }
.quote { white-space: pre-wrap; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
th, td { padding: 9px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }

/* ── App ───────────────────────────────────────────────────────────────── */

.app-top { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar.large { width: 120px; height: 120px; }
.avatar.empty { display: grid; place-items: center; background: var(--line); color: var(--muted); font-weight: 800; font-size: 22px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 18px 0 8px; }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--brand); }
.pets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pet-card { display: flex; gap: 14px; align-items: center; text-decoration: none; color: var(--ink); margin: 0; }
.pet-card > div { flex: 1; }
.with-photo { display: grid; grid-template-columns: 160px 1fr; gap: 20px; }
@media (max-width: 640px) { .with-photo { grid-template-columns: 1fr; } }
.photo-field { margin-bottom: 4px; }
.savebar { position: sticky; bottom: 0; display: flex; gap: 12px; align-items: center; justify-content: flex-end; flex-wrap: wrap; padding: 12px 0; background: var(--bg); border-top: 1px solid var(--line); }
.savebar > div { margin-right: auto; }
.savebar p { margin: 0; }
.reference header { margin-bottom: 4px; }
.enquiry fieldset { border: 0; padding: 0; margin: 14px 0 0; min-width: 0; }
.enquiry legend { font-weight: 600; font-size: 14px; padding: 0; }
.enquiry .choices { display: grid; gap: 2px; }
.enquiry .choices label.inline { padding: 6px 0; min-height: 32px; }
.enquiry textarea { font-family: inherit; }
.preview { border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px 22px; background: var(--paper); }

/* ── The profile (share page, PDF, preview) ────────────────────────────── */

.profile-head { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.profile-photo { width: 200px; height: 200px; border-radius: var(--radius); object-fit: cover; }
.profile .lede { margin-bottom: 8px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 18px; margin: 0 0 8px; }
.fact dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.fact dd { margin: 0; font-weight: 600; }
.profile section { break-inside: avoid-page; }
.profile .reference { border-top: 1px solid var(--line); padding: 12px 0; break-inside: avoid; }
.profile-footer { margin-top: 24px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); break-inside: avoid; }
.print-only { display: none; }
.invite { margin-top: 24px; }
.invite textarea { width: 100%; margin-top: 6px; }
.kit textarea { width: 100%; margin: 6px 0; font-family: inherit; }
.kit code { overflow-wrap: anywhere; }

/* ── Marketing ─────────────────────────────────────────────────────────── */

.hero { padding: 24px 0 8px; }
.hero h1 { max-width: 760px; }
.hero.end { text-align: center; padding: 40px 0 0; }
.hero.end .btn { margin-top: 6px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.features .card { margin: 0; }
.features h3 { margin-top: 0; }
.steps { padding-left: 22px; display: grid; gap: 4px; }
.steps h3 { margin: 10px 0 2px; }
.agents { border: 2px solid var(--brand); }
.plan ul { padding-left: 18px; }

/* A household pack: each pet's CV after the contents, on a new page when printed. */
.pack-pet { margin-top: 36px; padding-top: 24px; border-top: 2px dashed var(--line); }
.pack-contents ol { padding-left: 22px; }
.pack-order { padding-left: 22px; display: grid; gap: 6px; }
.pack-order li > .row { align-items: center; gap: 8px; }
.pack-choices { display: grid; gap: 2px; }
.pack-choices label.inline { padding: 6px 0; min-height: 32px; }

@media print {
  .site-header, .site-footer, .claim, .tabs, .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  main, main.wide { max-width: none; padding: 0; }
  .card, table, .preview { border-color: #ccc; }
  a { color: inherit; text-decoration: none; }
  .profile-photo { width: 150px; height: 150px; }
  h2 { margin-top: 18px; }
  .print-only { display: block; }
  .profile-footer { color: #333; font-size: 10pt; }
  .profile-footer a { text-decoration: underline; }
  .pack-pet { break-before: page; margin-top: 0; padding-top: 0; border-top: 0; }
  @page { margin: 16mm; }
}
