/* PetChipHub design system — layered on Bootstrap 5.
   Tokens first, then Bootstrap variable overrides, then components. */

:root {
  /* Brand */
  --brand-900: #134e4a;
  --brand-700: #0f766e;   /* primary — 5.5:1 on white */
  --brand-600: #0d9488;
  --brand-100: #ccfbf1;
  --brand-50:  #f0fdfa;
  --accent-400: #fbbf24;  /* chip gold, decorative only */
  --accent-700: #b45309;

  /* Neutrals (slate) */
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --ink-300: #cbd5e1;
  --ink-200: #e2e8f0;
  --ink-100: #f1f5f9;
  --surface: #ffffff;
  --page: #f8fafc;

  --danger: #b91c1c;
  --success: #047857;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow: 0 4px 16px rgba(15, 23, 42, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Bootstrap overrides */
  --bs-body-font-family: var(--font);
  --bs-body-color: var(--ink-700);
  --bs-body-bg: var(--page);
  --bs-emphasis-color: var(--ink-900);
  --bs-secondary-color: var(--ink-500);
  --bs-primary: var(--brand-700);
  --bs-primary-rgb: 15, 118, 110;
  --bs-link-color: var(--brand-700);
  --bs-link-color-rgb: 15, 118, 110;
  --bs-link-hover-color: var(--brand-900);
  --bs-link-hover-color-rgb: 19, 78, 74;
  --bs-border-color: var(--ink-200);
  --bs-border-radius: var(--radius-sm);
  --bs-border-radius-lg: var(--radius);
  --bs-focus-ring-color: rgba(15, 118, 110, .3);
  --bs-danger: var(--danger);
  --bs-danger-rgb: 185, 28, 28;
  --bs-success-rgb: 4, 120, 87;
  --bs-form-invalid-color: var(--danger);
  --bs-form-invalid-border-color: var(--danger);
}

html { scroll-padding-top: 80px; }
body { font-family: var(--font); background: var(--page); color: var(--ink-700); line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--ink-900); font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
a { text-underline-offset: .15em; }
:focus-visible { outline: 3px solid rgba(15, 118, 110, .45); outline-offset: 2px; }
.mono { font-family: var(--font-mono); letter-spacing: .02em; }
.text-muted { color: var(--ink-500) !important; }
.req { color: var(--danger); }
.lead { color: var(--ink-700); }

.skip-link { position: absolute; left: -999px; top: 8px; z-index: 2000; background: var(--ink-900); color: #fff; padding: .5rem 1rem; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: var(--radius-sm); }
.btn-lg { padding: .75rem 1.5rem; font-size: 1.0625rem; }
.btn-primary {
  --bs-btn-bg: var(--brand-700); --bs-btn-border-color: var(--brand-700);
  --bs-btn-hover-bg: var(--brand-900); --bs-btn-hover-border-color: var(--brand-900);
  --bs-btn-active-bg: var(--brand-900); --bs-btn-active-border-color: var(--brand-900);
  --bs-btn-disabled-bg: var(--brand-700); --bs-btn-disabled-border-color: var(--brand-700);
  --bs-btn-focus-shadow-rgb: 15, 118, 110;
}
.btn-outline-primary {
  --bs-btn-color: var(--brand-700); --bs-btn-border-color: var(--brand-700);
  --bs-btn-hover-bg: var(--brand-700); --bs-btn-hover-border-color: var(--brand-700); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--brand-900); --bs-btn-active-border-color: var(--brand-900);
}
.btn-light-on-dark { background: #fff; color: var(--brand-900); }
.btn-light-on-dark:hover { background: var(--brand-50); color: var(--brand-900); }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; color: var(--ink-900); margin-bottom: .35rem; }
.form-control, .form-select { border-color: var(--ink-300); padding: .6rem .8rem; }
.form-control-lg { font-size: 1.0625rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand-600); box-shadow: 0 0 0 .2rem rgba(15, 118, 110, .2); }
.form-text { color: var(--ink-500); }
.form-section { border: 0; padding: 0; margin: 0 0 2rem; }
.form-section legend { font-size: 1.125rem; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--ink-200); width: 100%; }
.form-check-lg .form-check-input { width: 1.25rem; height: 1.25rem; margin-top: .15rem; }
.form-check-lg .form-check-label { padding-left: .35rem; }
.form-check-input:checked { background-color: var(--brand-700); border-color: var(--brand-700); }
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.stripe-field { padding: .85rem .8rem; min-height: 48px; }
.help-disclosure { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: var(--radius-sm); padding: .75rem 1rem; }
.help-disclosure summary { font-weight: 600; color: var(--brand-900); cursor: pointer; }
.help-disclosure[open] summary { margin-bottom: .5rem; }

/* ---------- Layout ---------- */
.petchipbody { min-height: 60vh; }
.section { padding-block: 3rem; }
.section-lg { padding-block: 4.5rem; }
.section-alt { background: var(--surface); border-block: 1px solid var(--ink-200); }
.container-narrow { max-width: 520px; }
.container-form { max-width: 860px; }
.container-prose { max-width: 820px; }
.panel { background: var(--surface); border: 1px solid var(--ink-200); border-radius: var(--radius-lg); padding: 1.75rem; box-shadow: var(--shadow-sm); }
.panel-muted { background: var(--ink-100); box-shadow: none; }
@media (min-width: 768px) { .panel { padding: 2.25rem; } .panel-form { padding: 2.5rem; } }
.page-hero { background: var(--brand-50); border-bottom: 1px solid var(--brand-100); padding-block: 3rem 2.5rem; margin-bottom: 2.5rem; }
.page-hero h1 { font-size: clamp(1.75rem, 3vw + 1rem, 2.5rem); margin-bottom: .5rem; }
.section-heading { max-width: 640px; margin-bottom: 2rem; }
.section-heading h2 { font-size: clamp(1.5rem, 2vw + 1rem, 2rem); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8125rem; font-weight: 700; color: var(--brand-700); margin-bottom: .5rem; }

/* ---------- Header ---------- */
.site-header { background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--ink-200); position: sticky; top: 0; z-index: 1030; backdrop-filter: saturate(180%) blur(8px); }
.site-header .navbar { padding-block: .65rem; }
.site-header .navbar-brand img { height: 40px; width: auto; }
.site-header .nav-link { color: var(--ink-700); font-weight: 600; padding: .5rem .85rem !important; border-radius: var(--radius-sm); }
.site-header .nav-link:hover, .site-header .nav-link:focus { color: var(--brand-900); background: var(--brand-50); }
.site-header .nav-link[aria-current="page"] { color: var(--brand-700); }
.site-header .btn { margin-left: .25rem; }
@media (max-width: 991.98px) {
  .site-header .navbar-collapse { padding-block: .75rem; }
  .site-header .btn { margin: .5rem 0 0; width: 100%; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ink-900); color: #cbd5e1; padding-block: 3rem 2rem; margin-top: 4rem; }
.site-footer a { color: #e2e8f0; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer h2 { color: #fff; font-size: .9375rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .85rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .45rem; }
.site-footer .footer-brand img { height: 36px; width: auto; }
.site-footer .footer-legal { border-top: 1px solid #1e293b; margin-top: 2rem; padding-top: 1.25rem; font-size: .875rem; color: #94a3b8; }

/* ---------- Cookie banner ---------- */
.cookie-banner { position: fixed; inset: auto 0 0 0; z-index: 1080; background: var(--surface); border-top: 1px solid var(--ink-200); box-shadow: 0 -8px 24px rgba(15, 23, 42, .1); padding: 1rem 0; }

/* ---------- Home ---------- */
.hero { background: linear-gradient(180deg, var(--brand-50) 0%, var(--page) 100%); padding-block: 3.5rem 3rem; }
@media (min-width: 992px) { .hero { padding-block: 5rem 4.5rem; } }
.hero h1 { font-size: clamp(2rem, 3.2vw + 1rem, 3.25rem); letter-spacing: -.02em; margin-bottom: 1rem; }
.hero .lead { font-size: 1.1875rem; max-width: 34rem; }
.hero-media { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 4 / 3; background: var(--brand-100); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-note { font-size: .9375rem; color: var(--ink-500); }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { position: relative; padding-left: 1.75rem; margin-bottom: .5rem; }
.check-list li::before { content: ""; position: absolute; left: 0; top: .45em; width: 1rem; height: 1rem; border-radius: 50%; background: var(--brand-100) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%230f766e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M4 8.5l2.5 2.5L12 5.5'/%3E%3C/svg%3E") center / 80% no-repeat; }
.feature { height: 100%; }
.feature-icon { width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--brand-50); color: var(--brand-700); display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; margin-bottom: 1rem; }
.feature h3 { font-size: 1.125rem; }
.steps-home { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps-home li { counter-increment: step; position: relative; padding-left: 3.25rem; margin-bottom: 1.5rem; }
.steps-home li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--brand-700); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.steps-home h3 { font-size: 1.125rem; margin-bottom: .25rem; }
.action-card { display: block; height: 100%; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--ink-200); border-radius: var(--radius); padding: 1.25rem; transition: border-color .15s, box-shadow .15s; }
.action-card:hover, .action-card:focus { border-color: var(--brand-600); box-shadow: var(--shadow-sm); color: inherit; }
.action-card h3 { font-size: 1.0625rem; color: var(--brand-900); margin-bottom: .25rem; }
.action-card p { margin: 0; font-size: .9375rem; color: var(--ink-500); }
.lookup-box { background: var(--brand-900); color: #e2f6f3; border-radius: var(--radius-lg); padding: 2rem; }
.lookup-box h2 { color: #fff; }
.cta-band { background: var(--brand-700); color: #e6fffa; border-radius: var(--radius-lg); padding: 2.5rem 2rem; }
.cta-band h2 { color: #fff; }

/* ---------- FAQ ---------- */
.faq .accordion-button { font-weight: 600; color: var(--ink-900); }
.faq .accordion-button:not(.collapsed) { background: var(--brand-50); color: var(--brand-900); box-shadow: none; }
.faq .accordion-button:focus { box-shadow: 0 0 0 .2rem rgba(15, 118, 110, .2); }
.faq details { border: 1px solid var(--ink-200); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: .75rem; }
.faq summary { padding: 1rem 1.25rem; font-weight: 600; color: var(--ink-900); cursor: pointer; list-style-position: outside; }
.faq details[open] summary { border-bottom: 1px solid var(--ink-200); }
.faq .faq-body { padding: 1rem 1.25rem; }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* ---------- Registration flow ---------- */
.steps { margin-bottom: 1.5rem; }
.steps ol { list-style: none; display: flex; gap: .5rem; padding: 0; margin: 0; }
.steps li { flex: 1; display: flex; align-items: center; gap: .5rem; padding: .6rem .75rem; border-radius: var(--radius-sm); background: var(--ink-100); color: var(--ink-500); font-size: .875rem; font-weight: 600; }
.steps li.current { background: var(--brand-700); color: #fff; }
.steps li.done { background: var(--brand-100); color: var(--brand-900); }
.steps-num { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .7); color: var(--ink-900); flex-shrink: 0; font-size: .8125rem; }
.steps li.current .steps-num { background: #fff; color: var(--brand-700); }
@media (max-width: 575.98px) { .steps li:not(.current) .steps-label { display: none; } .steps li { flex: 0 0 auto; } .steps li.current { flex: 1; } }

.review-list { display: grid; grid-template-columns: minmax(7rem, 35%) 1fr; gap: .5rem 1rem; margin: 0 0 1rem; }
.review-list dt { color: var(--ink-500); font-weight: 500; }
.review-list dd { margin: 0; color: var(--ink-900); word-break: break-word; }
.price-option { display: flex; gap: .75rem; align-items: flex-start; border: 1px solid var(--ink-300); border-radius: var(--radius-sm); padding: .9rem 1rem; margin-bottom: .6rem; cursor: pointer; }
.price-option:has(input:checked) { border-color: var(--brand-700); background: var(--brand-50); box-shadow: 0 0 0 1px var(--brand-700) inset; }
.price-option input { margin-top: .3rem; accent-color: var(--brand-700); width: 1.1rem; height: 1.1rem; }
.price-option-body { display: block; flex: 1; }
.price-option-title { display: flex; justify-content: space-between; gap: 1rem; font-weight: 600; color: var(--ink-900); }
.price-option-desc { display: block; font-size: .875rem; color: var(--ink-500); }
.price-single { display: flex; justify-content: space-between; font-weight: 600; color: var(--ink-900); border: 1px solid var(--ink-200); border-radius: var(--radius-sm); padding: .9rem 1rem; }
.price { color: var(--ink-900); font-weight: 700; white-space: nowrap; }
.divider-text { display: flex; align-items: center; gap: .75rem; color: var(--ink-500); font-size: .875rem; margin: 1rem 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; border-top: 1px solid var(--ink-200); }
.success-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--brand-100); color: var(--brand-700); display: inline-flex; align-items: center; justify-content: center; font-size: 1.75rem; margin-bottom: 1rem; }
.next-steps { padding-left: 1.25rem; margin: 0; }
.next-steps li { margin-bottom: .6rem; }
.crop-wrapper { background: var(--ink-100); border-radius: var(--radius-sm); overflow: hidden; max-height: 360px; }
.crop-wrapper img { max-width: 100%; display: block; }

/* ---------- Account ---------- */
.pet-card { display: grid; grid-template-columns: 72px 1fr; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--ink-200); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.pet-card.is-lost { border-color: #fca5a5; background: #fffbfb; }
.pet-card-photo img, .pet-card-placeholder { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; display: flex; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand-700); font-size: 1.5rem; }
.pet-card-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; }
@media (min-width: 768px) { .pet-card { grid-template-columns: 72px 1fr auto; } .pet-card-actions { grid-column: auto; justify-content: flex-end; max-width: 300px; } }
.link-list { list-style: none; padding: 0; }
.link-list li { padding: .4rem 0; border-bottom: 1px solid var(--ink-200); }
.link-list li:last-child { border-bottom: 0; }

/* ---------- Lost pets ---------- */
.lost-card { background: var(--surface); border: 1px solid var(--ink-200); border-radius: var(--radius); overflow: hidden; height: 100%; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.lost-card:hover { border-color: var(--brand-600); box-shadow: var(--shadow-sm); color: inherit; }
.lost-card-img { aspect-ratio: 4 / 3; background: var(--ink-100); display: flex; align-items: center; justify-content: center; color: var(--ink-300); font-size: 2.5rem; }
.lost-card-img img { width: 100%; height: 100%; object-fit: cover; }
.lost-card-body { padding: 1rem; }
.lost-card-body h3 { font-size: 1.0625rem; margin-bottom: .25rem; }

/* ---------- Prose (legal & help) ---------- */
.prose { color: var(--ink-700); }
.prose h2 { font-size: 1.375rem; margin: 2.25rem 0 .75rem; }
.prose h3 { font-size: 1.125rem; margin: 1.5rem 0 .5rem; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: .35rem; }
.prose .note { background: var(--brand-50); border-left: 4px solid var(--brand-700); padding: 1rem 1.25rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.toc { background: var(--ink-100); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.toc ol { margin: 0; padding-left: 1.25rem; }
@media (min-width: 992px) { .toc-sticky { position: sticky; top: 90px; } }

/* ---------- Utilities ---------- */
.toast-container { z-index: 1090; }
.toast { min-width: 280px; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .cookie-banner, .toast-container { display: none !important; } }
/* When the server returned a specific error, hide the generic client-side hint. */
.invalid-feedback.d-block ~ .invalid-feedback:not(.d-block) { display: none !important; }
.photo-actions:not([hidden]) { display: flex; gap: .5rem; }
