/* Bark AI — shared stylesheet for every page of barkpethealth.com.
   Rules this file keeps:
     - one accent colour (teal); system fonts only, nothing loaded from other sites
     - spacing on an 8-pt scale (4 is the half step)
     - corner radius 12px (controls) or 16px (cards); nothing pill-shaped
     - body text 16px or larger; buttons, inputs and links to tap are 48px high or more
     - dark mode through prefers-color-scheme
   Colour pairs are checked for WCAG AA by audit script contrast.mjs. */

/* ------------------------------------------------------------- tokens */
:root {
    color-scheme: light;
    --bg:            #F5F7F6;
    --surface:       #FFFFFF;
    --surface-2:     #EAEFED;
    --text:          #17201D;
    --text-soft:     #3F4C47;
    --text-mute:     #56635E;
    --border:        #D3DBD7;
    --border-strong: #73817C;
    --accent:        #0F766E;
    --accent-hover:  #0B5F59;
    --accent-text:   #0D6B64;
    --on-accent:     #FFFFFF;
    --accent-soft:   #DDF1EE;
    --danger:        #B42318;
    --danger-soft:   #FDECEA;
    --warn:          #7A4A00;
    --warn-soft:     #FFF3DC;
    --success:       #116B3B;
    --success-soft:  #E2F4E9;
    --code-bg:       #17201D;
    --code-text:     #ECF1EF;

    --radius:    12px;
    --radius-lg: 16px;
    --s-1: 8px;  --s-2: 16px; --s-3: 24px; --s-4: 32px;
    --s-5: 40px; --s-6: 48px; --s-8: 64px; --s-10: 80px;
    --tap: 48px;
    --shadow: 0 1px 2px rgba(23, 32, 29, 0.06), 0 4px 16px rgba(23, 32, 29, 0.06);
    --max-width: 1120px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg:            #0F1614;
        --surface:       #18211E;
        --surface-2:     #222D29;
        --text:          #ECF1EF;
        --text-soft:     #C6D0CC;
        --text-mute:     #A3B0AB;
        --border:        #34423D;
        --border-strong: #7F8E88;
        --accent:        #2DD4BF;
        --accent-hover:  #5EEAD4;
        --accent-text:   #5EEAD4;
        --on-accent:     #06231F;
        --accent-soft:   #12362F;
        --danger:        #FFA59C;
        --danger-soft:   #3A1613;
        --warn:          #FFD08A;
        --warn-soft:     #3A2A0C;
        --success:       #7EE2A8;
        --success-soft:  #12301F;
        --code-bg:       #0A0F0E;
        --code-text:     #ECF1EF;
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    }
}

/* --------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.55;
    overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
img { height: auto; }
[hidden] { display: none !important; }

h1, h2, h3, h4 { margin: 0 0 var(--s-2); line-height: 1.2; color: var(--text); }
h1 { font-size: clamp(30px, 5vw, 44px); letter-spacing: -0.01em; }
h2 { font-size: clamp(24px, 3.2vw, 32px); }
h3 { font-size: 20px; }
h4 { font-size: 17px; }
p  { margin: 0 0 var(--s-2); }
ul, ol { margin: 0 0 var(--s-2); padding-left: var(--s-3); }
li { margin-bottom: var(--s-1); }

a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; border-radius: 4px; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--s-3); }
.container-narrow { max-width: 760px; }
@media (max-width: 480px) { .container { padding: 0 var(--s-2); } }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.trap { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.text-soft { color: var(--text-soft); }
.text-mute { color: var(--text-mute); }
.center { text-align: center; }
.stack > * + * { margin-top: var(--s-3); }

/* ------------------------------------------------------------- header */
.site-header {
    position: sticky; top: 0; z-index: 10;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.site-header nav {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--s-2);
    min-height: var(--s-8);
}
.brand {
    display: inline-flex; align-items: center; gap: var(--s-1);
    min-height: var(--tap);
    font-weight: 700; font-size: 20px;
    color: var(--text); text-decoration: none;
}
.brand-mark { font-size: 24px; line-height: 1; }
.nav-links { display: flex; align-items: center; gap: var(--s-1); }
.nav-links a:not(.btn) {
    display: inline-flex; align-items: center;
    min-height: var(--tap); padding: 0 var(--s-1);
    color: var(--text-soft); text-decoration: none; font-size: 16px;
}
.nav-links a:not(.btn):hover { color: var(--text); text-decoration: underline; }
@media (max-width: 860px) { .nav-links a:not(.btn) { display: none; } }

/* ------------------------------------------------------------ buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s-1);
    min-height: var(--tap);
    padding: 12px var(--s-3);
    border: 2px solid transparent;
    border-radius: var(--radius);
    font: inherit; font-size: 17px; font-weight: 600; line-height: 1.2;
    text-align: center; text-decoration: none;
    cursor: pointer;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { background: var(--surface); color: var(--accent-text); border-color: var(--accent-text); }
.btn-secondary:hover { background: var(--accent-soft); }
.btn-danger { background: var(--danger); color: var(--surface); }
.btn-large { min-height: 56px; padding: var(--s-2) var(--s-4); font-size: 18px; }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.btn-row.center { justify-content: center; }
@media (max-width: 480px) { .btn-row > .btn { flex: 1 1 100%; } }

/* -------------------------------------------------------------- cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--s-3);
}
.card > :last-child { margin-bottom: 0; }
.card-title { margin: 0 0 var(--s-1); font-size: 20px; font-weight: 700; }
.card-icon { font-size: 28px; line-height: 1; margin-bottom: var(--s-1); }
.card-accent { border-color: var(--accent); border-width: 2px; }
.card p { color: var(--text-soft); }

.grid { display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fit, minmax(min(100%, 256px), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 304px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }

/* -------------------------------------------------------------- forms */
.form { display: grid; gap: var(--s-3); }
.field { display: grid; gap: var(--s-1); }
.field > label, .field > .label { font-weight: 600; font-size: 17px; color: var(--text); }
.field .optional { font-weight: 400; color: var(--text-mute); }
.field input, .field textarea, .field select {
    width: 100%; min-width: 0;
    min-height: var(--tap);
    padding: 12px var(--s-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font: inherit; font-size: 17px;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-mute); opacity: 1; }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible {
    outline: 3px solid var(--accent-text); outline-offset: 1px; border-color: var(--accent-text);
}
.field .help { margin: 0; font-size: 16px; color: var(--text-mute); }
.field .error { margin: 0; font-size: 16px; font-weight: 600; color: var(--danger); }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--danger); border-width: 2px; }

/* ------------------------------------------------------------ notices */
.notice {
    display: flex; gap: var(--s-2); align-items: flex-start;
    padding: var(--s-2);
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text);
}
.notice > svg { flex: none; width: 24px; height: 24px; margin-top: 2px; }
.notice p { margin: 0; color: inherit; }
.notice p + p { margin-top: var(--s-1); }
.notice-title { font-weight: 700; }
.notice-success { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.notice-error   { background: var(--danger-soft);  border-color: var(--danger);  color: var(--danger); }
.notice-warn    { background: var(--warn-soft);    border-color: var(--warn);    color: var(--warn); }
.notice-info    { background: var(--accent-soft);  border-color: var(--accent-text); color: var(--text); }

/* -------------------------------------------------------- empty state */
.empty-state {
    display: grid; justify-items: center; gap: var(--s-2);
    padding: var(--s-5) var(--s-3);
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    text-align: center;
}
.empty-state svg { width: 96px; height: 96px; color: var(--accent-text); }
.empty-state h3 { margin: 0; }
.empty-state p { margin: 0; max-width: 480px; color: var(--text-soft); }

/* ------------------------------------------------------ page sections */
.section { padding: var(--s-8) 0; scroll-margin-top: var(--s-10); }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }
.section-alt .card, .section-alt .empty-state { background: var(--bg); }
.section-head { max-width: 680px; margin: 0 auto var(--s-4); text-align: center; }
.section-head p { color: var(--text-soft); margin: 0; }
@media (max-width: 640px) { .section { padding: var(--s-6) 0; } }

.hero { padding: var(--s-8) 0; text-align: center; }
.hero .container { max-width: 800px; }
.hero h1 em { font-style: normal; color: var(--accent-text); }
.lede { font-size: clamp(18px, 2.2vw, 20px); color: var(--text-soft); margin-bottom: var(--s-3); }
.tag {
    display: inline-block;
    padding: var(--s-1) var(--s-2);
    border-radius: var(--radius);
    background: var(--accent-soft);
    color: var(--text);
    font-size: 16px; font-weight: 600;
    margin-bottom: var(--s-2);
}
.tag-alert { background: var(--danger-soft); color: var(--danger); }

.check-list { list-style: none; padding: 0; }
.check-list li { position: relative; padding-left: var(--s-4); color: var(--text-soft); }
.check-list li::before { content: "✓"; position: absolute; left: 0; font-weight: 700; color: var(--accent-text); }
.price { font-size: 36px; font-weight: 700; margin: 0 0 var(--s-1); color: var(--text); }
.price small { font-size: 16px; font-weight: 400; color: var(--text-mute); }

/* numbered steps / checklists */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: var(--s-2); }
.steps > li {
    counter-increment: step;
    position: relative;
    margin: 0;
    padding: var(--s-2) var(--s-2) var(--s-2) var(--s-8);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.steps > li::before {
    content: counter(step);
    position: absolute; left: var(--s-2); top: var(--s-2);
    width: var(--s-4); height: var(--s-4);
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius);
    background: var(--accent); color: var(--on-accent);
    font-weight: 700; font-size: 16px;
}
.steps h3 { font-size: 18px; margin: 0 0 4px; }
.steps p { margin: 0; color: var(--text-soft); }

/* FAQ */
.faq-list { max-width: 760px; margin: 0 auto; display: grid; gap: var(--s-1); }
.faq-list details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.faq-list summary {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-2);
    min-height: 56px; padding: var(--s-1) var(--s-2);
    cursor: pointer; font-weight: 600; list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font-size: 24px; line-height: 1; color: var(--text-mute); }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { padding: 0 var(--s-2) var(--s-2); margin: 0; color: var(--text-soft); }

/* key / value rows (download page) */
.meta-list { margin: var(--s-3) 0 0; }
.meta-list div {
    display: flex; justify-content: space-between; gap: var(--s-2);
    padding: var(--s-1) 0;
    border-bottom: 1px solid var(--border);
}
.meta-list div:last-child { border-bottom: 0; }
.meta-list dt { color: var(--text-mute); flex: none; }
.meta-list dd { margin: 0; text-align: right; word-break: break-all; font-family: var(--mono); font-size: 16px; }
pre.code {
    margin: 0 0 var(--s-2); padding: var(--s-2);
    background: var(--code-bg); color: var(--code-text);
    border-radius: var(--radius);
    font-family: var(--mono); font-size: 16px;
    overflow-x: auto;
}
.code-big {
    display: inline-block;
    padding: var(--s-2) var(--s-3);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--mono); font-size: 24px; font-weight: 700; letter-spacing: 1px;
    word-break: break-all;
}

/* long-form pages (privacy / terms / support / safety) */
.prose { padding: var(--s-6) 0 var(--s-8); }
.prose .container { max-width: 760px; }
.prose h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: var(--s-1); }
.prose h2 { font-size: 24px; margin: var(--s-5) 0 var(--s-2); scroll-margin-top: var(--s-10); }
.prose h3 { font-size: 19px; margin: var(--s-3) 0 var(--s-1); }
.prose p, .prose li { color: var(--text-soft); }
.prose .updated { color: var(--text-mute); margin-bottom: var(--s-4); }
.prose .card h2, .prose .card h3 { margin-top: 0; }
.prose .steps h3 { margin: 0 0 4px; }

/* ------------------------------------------------------ lost-pet list */
.pet-grid { display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.pet-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.pet-card .pet-thumb { aspect-ratio: 4 / 3; }
.pet-card-body { display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-2); flex: 1; }
.pet-card-body p { margin: 0; }
.pet-card-body .btn { margin-top: auto; }
.pet-thumb {
    display: flex; align-items: center; justify-content: center;
    width: 100%;
    background: var(--accent-soft);
    color: var(--accent-text);
    overflow: hidden;
}
.pet-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pet-thumb svg { width: 56%; height: 56%; }

/* ------------------------------------------------------ lost-pet page */
.pet-page { padding: var(--s-4) 0 var(--s-8); }
.pet-page .container { max-width: 720px; }
.pet-hero { padding: 0; overflow: hidden; }
.pet-hero .pet-thumb { aspect-ratio: 4 / 3; max-height: 480px; }
.pet-hero-body { padding: var(--s-3); }
.pet-hero-body h1 { margin-bottom: var(--s-1); }
.pet-facts { font-size: 19px; color: var(--text-soft); margin-bottom: var(--s-2); }
.fact-list { margin: 0; display: grid; gap: var(--s-1); }
.fact-list div { display: flex; flex-wrap: wrap; gap: 4px var(--s-1); }
.fact-list dt { font-weight: 700; color: var(--text); }
.fact-list dd { margin: 0; color: var(--text-soft); }
.contact-buttons { display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fit, minmax(min(100%, 184px), 1fr)); }
.report-box summary {
    display: inline-flex; align-items: center;
    min-height: var(--tap);
    cursor: pointer; font-weight: 600; color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px;
}
.report-box[open] summary { margin-bottom: var(--s-2); }

/* ------------------------------------------------------------- footer */
.site-footer {
    padding: var(--s-6) 0 var(--s-4);
    background: var(--surface);
    border-top: 1px solid var(--border);
}
.footer-inner { display: grid; gap: var(--s-4); grid-template-columns: 1fr 2fr; align-items: start; }
.footer-brand .brand-name { font-size: 20px; font-weight: 700; }
.footer-tag { margin: var(--s-1) 0 0; color: var(--text-mute); font-size: 16px; }
.footer-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.footer-nav h2 { font-size: 16px; font-weight: 700; color: var(--text); margin: 0; min-height: var(--s-4); }
.footer-nav a {
    display: flex; align-items: center;
    min-height: var(--tap);
    color: var(--text-soft); font-size: 16px; text-decoration: none;
    overflow-wrap: anywhere;
}
.footer-nav a:hover { color: var(--text); text-decoration: underline; }
.copyright {
    grid-column: 1 / -1;
    margin: 0; padding-top: var(--s-2);
    border-top: 1px solid var(--border);
    color: var(--text-mute); font-size: 16px;
}
@media (max-width: 720px) {
    .footer-inner { grid-template-columns: 1fr; }
    .footer-nav { grid-template-columns: 1fr 1fr; }
    .footer-nav > div:last-child { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------- utilities */
.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.pt-0 { padding-top: 0; }
.pb-4 { padding-bottom: var(--s-4); }
.max-480 { max-width: 480px; }
.max-560 { max-width: 560px; margin-inline: auto; }
.max-800 { max-width: 800px; margin-inline: auto; }
.check-row { display: flex; gap: var(--s-2); align-items: center; min-height: var(--tap); cursor: pointer; }
.check-row input { width: 24px; height: 24px; min-height: 0; flex: none; padding: 0; accent-color: var(--accent); }
.field > .check-row { font-weight: 400; }
.prose form.card { margin-bottom: var(--s-3); }

/* ----------------------------------------------- insurance comparison */
.ins-page { padding: var(--s-6) 0 var(--s-8); }
.ins-page h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: var(--s-1); }
.ins-page .lede { max-width: 760px; }
.ins-page h2 { font-size: 24px; margin: var(--s-5) 0 var(--s-1); scroll-margin-top: var(--s-10); }
.ins-controls { margin-top: var(--s-3); }
.ins-count { color: var(--text-mute); }
.ins-grid { display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fit, minmax(min(100%, 416px), 1fr)); align-items: start; }
.ins-card { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.ins-card > * { margin: 0; }
.ins-card .ins-species { color: var(--text-soft); }
.ins-facts { margin: 0; display: grid; gap: var(--s-2); }
.ins-facts dt { font-weight: 700; font-size: 16px; color: var(--text); }
.ins-facts dd { margin: 0; color: var(--text-soft); overflow-wrap: anywhere; }
.ins-price { display: block; font-size: 20px; color: var(--text); }
.ins-basis { display: block; font-size: 16px; color: var(--text-mute); }
.ins-none { color: var(--text-mute); }
.ins-links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); }
.ins-affiliate { font-size: 16px; font-weight: 600; color: var(--text-soft); }
.ins-rating { display: inline-flex; align-items: center; min-height: var(--tap); }
.ins-card .ins-meta { font-size: 16px; color: var(--text-mute); overflow-wrap: anywhere; padding-top: var(--s-2); border-top: 1px solid var(--border); }
.ins-guide { max-width: 760px; }
.ins-guide .ins-facts { margin-bottom: var(--s-2); }
.ins-jump { list-style: none; padding: 0; margin: var(--s-3) 0 0; display: grid; gap: 0 var(--s-2); grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.ins-jump li { margin: 0; }
.ins-jump a { display: inline-flex; align-items: center; min-height: var(--tap); }
@media (max-width: 480px) { .ins-links > .btn { flex: 1 1 100%; } }
