/* ============================================================================
   OpesCare Finder — shared public stylesheet
   ----------------------------------------------------------------------------
   One file, no framework, mobile-first (base 360px; min-width 640px / 960px).
   EVERY component is built from the :root tokens below — page agents must not
   introduce new colors; semantic states come from --f-good/--f-warn/--f-danger
   and their washes. Brand is #0F4C81. Never purple. No webfonts (system-ui).
   ========================================================================== */

:root {
  --f-ground: #F7FAFC;
  --f-surface: #FFFFFF;
  --f-ink: #0F172A;
  --f-ink-soft: #334155;
  --f-muted: #64748B;
  --f-line: #E2E8F0;
  --f-brand: #0F4C81;
  --f-brand-ink: #0B3A66;
  --f-wash: #E9F1F8;
  --f-good: #0E7A4C;
  --f-good-wash: #E7F4EE;
  --f-danger: #B42318;
  --f-danger-wash: #FBEAE7;
  --f-warn: #B54708;
  --f-warn-wash: #FBF0E5;
  --f-r: 12px;
  --f-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 16px rgba(15, 23, 42, 0.06);
  --f-header-h: 60px;
}

/* ---- Reset (lite) ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--f-header-h) + 8px); }
body {
  margin: 0;
  font-family: var(--f-font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--f-ink);
  background: var(--f-ground);
}
h1, h2, h3, h4, p, figure, blockquote { margin: 0 0 0.75em; }
ul, ol { margin: 0; padding: 0; }
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--f-brand); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--f-brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Layout ------------------------------------------------------------- */
.f-container {
  max-width: 1100px;
  padding-inline: 16px;
  margin-inline: auto;
  width: 100%;
}
.f-section { padding-block: clamp(48px, 8vw, 96px); }
.f-section--tight { padding-block: clamp(28px, 5vw, 56px); }
.f-section--surface { background: var(--f-surface); }
.f-section--wash { background: var(--f-wash); }

.f-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) {
  .f-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
}

/* ---- Typography --------------------------------------------------------- */
.f-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--f-brand);
  margin-bottom: 12px;
}
.f-h1 {
  font-size: clamp(1.75rem, 4.5vw + 0.9rem, 2.75rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--f-ink);
}
.f-h2 {
  font-size: clamp(1.375rem, 2vw + 0.9rem, 1.9rem);
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: -0.015em;
  color: var(--f-ink);
}
.f-lead {
  font-size: clamp(1rem, 0.5vw + 0.925rem, 1.1875rem);
  line-height: 1.65;
  color: var(--f-ink-soft);
  max-width: 62ch;
}
.f-muted { color: var(--f-muted); }
.f-small { font-size: 0.875rem; }

/* ---- Buttons ------------------------------------------------------------ */
.f-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--f-r);
  border: 1px solid var(--f-line);
  background: var(--f-surface);
  color: var(--f-ink);
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
}
.f-btn:active { transform: translateY(1px); }
.f-btn:hover { border-color: var(--f-brand); color: var(--f-brand-ink); }
.f-btn--primary {
  background: var(--f-brand);
  border-color: var(--f-brand);
  color: #FFFFFF;
}
.f-btn--primary:hover { background: var(--f-brand-ink); border-color: var(--f-brand-ink); color: #FFFFFF; }
.f-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--f-brand);
}
.f-btn--ghost:hover { background: var(--f-wash); border-color: transparent; color: var(--f-brand-ink); }
.f-btn--block { width: 100%; }
.f-btn[disabled], .f-btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }

/* ---- Cards -------------------------------------------------------------- */
.f-card {
  background: var(--f-surface);
  border: 1px solid var(--f-line);
  border-radius: var(--f-r);
  padding: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
a.f-card { display: block; color: inherit; text-decoration: none; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
a.f-card:hover { border-color: var(--f-brand); box-shadow: var(--f-shadow); }

/* ---- Inputs ------------------------------------------------------------- */
.f-input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--f-line);
  border-radius: var(--f-r);
  background: var(--f-surface);
  color: var(--f-ink);
  font-size: 1rem; /* 16px+ prevents iOS zoom-on-focus */
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.f-input::placeholder { color: var(--f-muted); }
.f-input:focus-visible {
  outline: none;
  border-color: var(--f-brand);
  box-shadow: 0 0 0 3px var(--f-wash);
}
textarea.f-input { height: auto; min-height: 96px; padding-block: 12px; resize: vertical; }
select.f-input { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.f-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 650;
  color: var(--f-ink-soft);
  margin-bottom: 6px;
}
.f-field { margin-bottom: 16px; }
.f-hint { font-size: 0.8125rem; color: var(--f-muted); margin-top: 6px; }
.f-error { font-size: 0.8125rem; color: var(--f-danger); margin-top: 6px; }
.f-input--invalid { border-color: var(--f-danger); }

/* ---- Chips -------------------------------------------------------------- */
.f-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--f-line);
  background: var(--f-surface);
  color: var(--f-ink-soft);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.f-chip:hover { border-color: var(--f-brand); color: var(--f-brand-ink); }
.f-chip.is-active,
.f-chip[aria-pressed="true"],
.f-chip[aria-current] {
  background: var(--f-wash);
  border-color: var(--f-brand);
  color: var(--f-brand-ink);
}

/* ---- Badges (semantic status only — colors never mean anything else) ---- */
.f-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.5;
  background: var(--f-wash);
  color: var(--f-brand-ink);
}
.f-badge--good { background: var(--f-good-wash); color: var(--f-good); }
.f-badge--warn { background: var(--f-warn-wash); color: var(--f-warn); }
.f-badge--danger { background: var(--f-danger-wash); color: var(--f-danger); }

/* ---- Skeleton loading --------------------------------------------------- */
.f-skeleton {
  position: relative;
  overflow: hidden;
  background: var(--f-line);
  border-radius: 8px;
  color: transparent !important;
  min-height: 1em;
  user-select: none;
  pointer-events: none;
}
.f-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: f-shimmer 1.4s infinite;
}
@keyframes f-shimmer { 100% { transform: translateX(100%); } }

/* ---- Icons -------------------------------------------------------------- */
.f-icon { flex-shrink: 0; display: inline-block; vertical-align: -0.18em; }

/* ---- Skip link ---------------------------------------------------------- */
.f-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--f-surface);
  color: var(--f-brand);
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 0 0 var(--f-r) 0;
  text-decoration: none;
}
.f-skip:focus-visible { left: 0; }

/* ============================================================================
   Header + navigation
   ========================================================================== */
.f-nav-toggle { position: absolute; opacity: 0; pointer-events: none; }

.f-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--f-surface);
  border-bottom: 1px solid var(--f-line);
}
.f-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--f-header-h);
}
.f-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--f-brand);
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.f-brand__mark { color: var(--f-brand); }
.f-brand__finder { font-weight: 550; color: var(--f-ink-soft); }
.f-header__actions { display: flex; align-items: center; gap: 8px; }

/* Language switcher */
.f-lang {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--f-line);
  border-radius: 999px;
  overflow: hidden;
}
.f-lang a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 34px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--f-muted);
}
.f-lang a.is-active { background: var(--f-wash); color: var(--f-brand-ink); }
.f-lang a:focus-visible { outline-offset: -3px; }

/* Desktop inline nav — hidden on mobile */
.f-nav { display: none; }
@media (min-width: 1300px) {
  .f-nav { display: flex; align-items: center; gap: 2px; }
  .f-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--f-ink-soft);
    text-decoration: none;
    white-space: nowrap;
  }
  .f-nav a:hover { background: var(--f-wash); color: var(--f-brand-ink); }
  .f-nav a[aria-current="page"] { color: var(--f-brand); }
}

/* Header login — desktop only; on mobile it lives in the nav panel CTA */
.f-nav__login { display: none; }
@media (min-width: 1300px) { .f-nav__login { display: inline-flex; } }

/* Burger — mobile/tablet only */
.f-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--f-line);
  background: var(--f-surface);
  color: var(--f-ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.f-burger .f-burger__close { display: none; }
.f-nav-toggle:checked ~ .f-header .f-burger .f-burger__open { display: none; }
.f-nav-toggle:checked ~ .f-header .f-burger .f-burger__close { display: block; }
.f-nav-toggle:focus-visible ~ .f-header .f-burger { outline: 3px solid var(--f-brand); outline-offset: 2px; }
@media (min-width: 1300px) {
  .f-burger { display: none; }
}

/* Desktop nav breakpoint (web audit 2026-10-19): the inline nav needs
   ~1200px in English and ~1650px in French, more than the 1100px content
   column. The header row gets a wider track and the inline nav only shows
   where it fits; below that the burger panel carries the links. */
@media (min-width: 1300px) {
  .f-header__row { max-width: 1320px; }
}
@media (min-width: 1300px) and (max-width: 1759px) {
  html:lang(fr) .f-nav,
  html:lang(fr) .f-nav__login { display: none; }
  html:lang(fr) .f-burger { display: inline-flex; }
  html:lang(fr) .f-nav-toggle:checked ~ .f-nav-panel { display: flex !important; }
}
@media (min-width: 1760px) {
  html:lang(fr) .f-header__row { max-width: 1720px; }
}

/* Full-screen mobile panel */
.f-nav-panel {
  position: fixed;
  inset: 0;
  top: var(--f-header-h);
  z-index: 90;
  background: var(--f-surface);
  padding: 20px 16px 32px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  gap: 4px;
}
.f-nav-toggle:checked ~ .f-nav-panel { display: flex; }
body:has(.f-nav-toggle:checked) { overflow: hidden; }
.f-nav-panel a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 8px 12px;
  border-radius: var(--f-r);
  font-size: 1.125rem;
  font-weight: 650;
  color: var(--f-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--f-line);
}
.f-nav-panel a:last-of-type { border-bottom: 0; }
.f-nav-panel a .f-nav-panel__go { color: var(--f-muted); }
.f-nav-panel a:active { background: var(--f-wash); }
.f-nav-panel__label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.f-nav-panel__label .f-icon { color: var(--f-brand); }
.f-nav-panel__cta { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
/* The panel's row style (.f-nav-panel a) out-ranks .f-btn--primary: keep the
   CTA a centred button with white text on brand blue. */
.f-nav-panel .f-nav-panel__cta a.f-btn { justify-content: center; color: #FFFFFF; border-bottom: 0; font-size: 1rem; min-height: 52px; }
.f-nav-panel .f-nav-panel__cta a.f-btn .f-icon { color: currentColor; }
@media (min-width: 1300px) {
  .f-nav-panel { display: none !important; }
}

/* ============================================================================
   Footer
   ========================================================================== */
.f-footer {
  background: var(--f-surface);
  border-top: 1px solid var(--f-line);
  padding-block: clamp(36px, 6vw, 64px) 24px;
  font-size: 0.9375rem;
}
.f-footer__grid { display: grid; grid-template-columns: 1fr; gap: 28px; }
@media (min-width: 640px) {
  .f-footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
}
.f-footer__title {
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--f-muted);
  margin-bottom: 12px;
}
.f-footer ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.f-footer__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  color: var(--f-ink-soft);
  text-decoration: none;
}
.f-footer__link:hover { color: var(--f-brand); text-decoration: underline; }
.f-footer__tagline { color: var(--f-muted); max-width: 34ch; }
.f-footer__meta {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--f-line);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--f-muted);
}
.f-footer__meta p { margin: 0; }
@media (min-width: 640px) {
  .f-footer__meta-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
}

/* ---- Motion preferences -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .f-skeleton::after { animation: none; }
}

/* ── Search loading state (public/js/finder-loading.js) ─────────────── */
.f-loading-status {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  z-index: 400; display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 9999px;
  background: var(--f-ink, #0F2340); color: #fff;
  font-size: 0.9rem; font-weight: 600; box-shadow: 0 6px 24px rgba(15, 35, 64, .25);
}
.f-loading-status:empty { width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; box-shadow: none; }
.f-loading-status:empty::before { display: none; }
.f-loading-status::before,
button.is-loading::before {
  content: ""; width: 16px; height: 16px; flex-shrink: 0;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: f-spin .7s linear infinite;
}
button.is-loading { cursor: progress; opacity: .85; display: inline-flex; align-items: center; gap: 8px; }
@keyframes f-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .f-loading-status::before, button.is-loading::before { animation-duration: 2.4s; }
}
