/* ============================================================================
   SPM EUROCARE — DESIGN SYSTEM
   Single source of truth for typography, colour, spacing and components.
   Every page uses these tokens. Change a token here, it changes everywhere.
   ========================================================================= */

/* ---------------------------------------------------------------- 1. TOKENS */
:root {
  /* Brand — SPM Blue is sampled from the SPM Medicare corporate mark */
  --blue-900: #062A47;
  --blue-800: #0A3C63;
  --blue-700: #0B5488;
  --blue-600: #0A6FB8;   /* Primary SPM Blue */
  --blue-500: #1487D6;
  --blue-300: #7FBEE8;
  --blue-100: #DCEBF7;
  --blue-75:  #E4F0F9;   /* section tint — stronger than blue-50 */
  --blue-50:  #F0F7FC;

  /* Ink / neutrals */
  --ink-900: #0C1A28;
  --ink-800: #16283A;
  --ink-700: #223243;
  --ink-500: #52667B;
  --ink-400: #7A8CA0;
  --ink-300: #B7C4D2;
  --ink-200: #DCE4EC;
  --ink-100: #EDF2F7;
  --ink-50:  #F6F8FB;
  --white:   #FFFFFF;

  /* Accent — used sparingly: verification, safety, positive differentiator */
  --green-700: #0B6E3E;
  --green-600: #0F8A4D;
  --green-100: #E1F3E9;

  /* Signal */
  --amber-600: #B26A00;
  --amber-100: #FDF1DC;
  --red-600:   #B42318;
  --red-100:   #FDE7E5;

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, monospace;

  /* Type scale — fluid, 1440px-first then graceful down to 320px */
  --t-display: clamp(2.25rem, 1.35rem + 3.1vw, 4rem);
  --t-h1:      clamp(2rem,    1.4rem  + 2.1vw, 3.1rem);
  --t-h2:      clamp(1.6rem,  1.25rem + 1.3vw, 2.35rem);
  --t-h3:      clamp(1.22rem, 1.08rem + 0.5vw, 1.5rem);
  --t-h4:      1.0625rem;
  --t-body:    1rem;
  --t-sm:      0.9062rem;
  --t-xs:      0.8125rem;
  --t-eyebrow: 0.75rem;

  /* Spacing */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 24px;  --s-6: 32px;  --s-7: 40px;  --s-8: 56px;
  --s-9: 72px;  --s-10: 96px; --s-11: 128px;

  /* Structure */
  --maxw: 1280px;
  --gutter: clamp(20px, 4vw, 56px);
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 14px;

  /* Elevation — restrained. Borders do most of the work. */
  --sh-1: 0 1px 2px rgba(12, 26, 40, .06);
  --sh-2: 0 2px 8px rgba(12, 26, 40, .07), 0 1px 2px rgba(12, 26, 40, .05);
  --sh-3: 0 12px 32px rgba(12, 26, 40, .12), 0 2px 6px rgba(12, 26, 40, .06);
  --sh-4: 0 24px 64px rgba(6, 42, 71, .20);

  --hdr-h: 72px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ------------------------------------------------------------- 2. RESET */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--ink-700);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
/* Components below set display on their own class, which would otherwise beat
   the UA rule for [hidden]. Keep the attribute authoritative. */
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: var(--blue-700); text-decoration-thickness: 1px; text-underline-offset: 2px; }
ul, ol { padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }

h1, h2, h3, h4 {
  color: var(--ink-900);
  font-weight: 650;
  letter-spacing: -0.021em;
  line-height: 1.14;
  text-wrap: balance;
}
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); line-height: 1.25; }
h4 { font-size: var(--t-h4); line-height: 1.35; letter-spacing: -0.011em; }
p  { text-wrap: pretty; }

/* Accessibility primitives ------------------------------------------------ */
:focus-visible {
  outline: 2px solid var(--blue-600);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
:focus:not(:focus-visible) { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; top: -100px; left: var(--s-4); z-index: 999;
  background: var(--blue-700); color: #fff; padding: 12px 20px;
  border-radius: var(--radius); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------- 3. LAYOUT */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(56px, 7vw, 104px); }
.section--tight { padding-block: clamp(40px, 5vw, 72px); }
.section--tint { background: var(--ink-50); }
/* Blue tint carries a hairline top and bottom edge so the colour reads as a
   deliberate band rather than a wash. */
.section--blue {
  background: linear-gradient(180deg, var(--blue-75) 0%, var(--blue-50) 100%);
  border-block: 1px solid #D3E6F5;
}
.section--dark { background: var(--blue-900); color: var(--blue-100); }
.section--dark h2, .section--dark h3, .section--dark h4 { color: #fff; }

.rule { height: 1px; background: var(--ink-200); border: 0; }

/* The header is sticky, so an anchor would otherwise land underneath it.
   Applies to every in-page link target, not just #about. */
[id] { scroll-margin-top: calc(var(--hdr-h) + 24px); }

/* Section heading block --------------------------------------------------- */
.eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-size: var(--t-eyebrow); font-weight: 700; letter-spacing: .11em;
  text-transform: uppercase; color: var(--blue-600); margin-bottom: var(--s-4);
}
.eyebrow::before {
  content: ""; width: 24px; height: 2px; background: var(--blue-600); flex: none;
}
.section--dark .eyebrow { color: var(--blue-300); }
.section--dark .eyebrow::before { background: var(--blue-300); }
.eyebrow--center { justify-content: center; }

.lede { font-size: clamp(1.0312rem, 1rem + .25vw, 1.1875rem); color: var(--ink-500); max-width: 62ch; }
.section--dark .lede { color: var(--blue-100); opacity: .88; }
.head { max-width: 760px; margin-bottom: var(--s-8); }
.head--center { margin-inline: auto; text-align: center; }
.head--center .lede { margin-inline: auto; }
.head h2 + .lede { margin-top: var(--s-4); }

/* Grid helpers ------------------------------------------------------------ */
/* Grid and flex items default to min-width:auto, so a wide child (a data
   table, a long word) stretches its track and pushes the page sideways.
   Resetting it here is what keeps `.tscroll` able to do its job. */
.grid > *, .split > *, .psplit > *, .euGrid > *, .modelGrid > *, .hero__in > * { min-width: 0; }
.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px)  { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------- 4. BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 22px; border-radius: var(--radius); font-size: var(--t-sm);
  font-weight: 600; letter-spacing: -0.005em; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background-color .18s var(--ease), border-color .18s var(--ease),
              color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.btn svg { flex: none; transition: transform .22s var(--ease); }
.btn:hover svg.arr { transform: translateX(3px); }

.btn--primary { background: var(--blue-600); color: #fff; box-shadow: var(--sh-1); }
.btn--primary:hover { background: var(--blue-700); box-shadow: var(--sh-2); }
.btn--primary:active { background: var(--blue-800); transform: translateY(1px); }

.btn--secondary { background: #fff; color: var(--ink-900); border-color: var(--ink-300); }
.btn--secondary:hover { border-color: var(--blue-600); color: var(--blue-700); background: var(--blue-50); }

.btn--ghost { background: transparent; color: var(--blue-700); padding-inline: 10px; }
.btn--ghost:hover { background: var(--blue-50); }

.btn--onDark { background: #fff; color: var(--blue-900); }
.btn--onDark:hover { background: var(--blue-100); }
.btn--outlineDark { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn--outlineDark:hover { border-color: #fff; background: rgba(255,255,255,.1); }

.btn--sm { padding: 9px 15px; font-size: var(--t-xs); }
.btn--lg { padding: 16px 30px; font-size: var(--t-body); }
.btn--block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* Text link with arrow ---------------------------------------------------- */
.tlink {
  display: inline-flex; align-items: center; gap: 7px; font-weight: 600;
  font-size: var(--t-sm); color: var(--blue-700); text-decoration: none;
}
.tlink svg { transition: transform .22s var(--ease); }
/* Touch pointers get a taller hit area without changing the visual rhythm. */
@media (pointer: coarse) { .tlink { padding-block: 6px; } }
.tlink:hover { color: var(--blue-800); }
.tlink:hover svg { transform: translateX(3px); }

/* ------------------------------------------------------------- 5. BADGES */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 100px; font-size: var(--t-xs); font-weight: 600; line-height: 1.4;
  border: 1px solid;
}
.badge--neutral { background: var(--ink-100); color: var(--ink-700); border-color: var(--ink-200); }
.badge--blue    { background: var(--blue-100); color: var(--blue-800); border-color: #C3DEF2; }
.badge--green   { background: var(--green-100); color: var(--green-700); border-color: #BFE3CE; }
.badge--amber   { background: var(--amber-100); color: var(--amber-600); border-color: #F2DFB8; }

/* ------------------------------------------------------------- 6. CARDS */
.card {
  background: #fff; border: 1px solid var(--ink-200); border-radius: var(--radius-lg);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.card--hover:hover { border-color: var(--blue-300); box-shadow: var(--sh-3); transform: translateY(-3px); }

/* Product image frame -----------------------------------------------------
   Two of the supplied photographs have a coloured ring baked into the image.
   A ring cannot be cropped off a square photo cleanly — trimming the edges
   leaves four arc segments in the corners. So the ring becomes the system:
   every product sits on a circular disc, drawn in CSS for the photos that
   do not already carry one. The catalogue then reads as one set.          */
/* The disc and the photo are both absolutely centred. That matters: a
   percentage max-height on a normal-flow child resolves against an
   auto-sized track and is silently dropped. Against a positioned
   containing block with a definite height it resolves correctly. */
.pimg {
  position: relative; display: block; overflow: hidden;
  background: linear-gradient(170deg, var(--blue-50) 0%, #fff 62%);
  border-bottom: 1px solid var(--ink-100);
}
.pimg::before {
  content: ""; position: absolute; top: 50%; left: 50%;
  height: 82%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; background: #fff; border: 2px solid var(--blue-100);
  transition: border-color .3s var(--ease), transform .45s var(--ease);
}
.pimg--ringed::before { display: none; }      /* photo brings its own ring */

.pimg img {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: auto; height: auto; max-width: 58%; max-height: 54%;
  object-fit: contain; transition: transform .45s var(--ease);
}
.pimg--ringed img { max-width: 90%; max-height: 90%; }

.card--hover:hover .pimg::before { border-color: var(--blue-300); transform: translate(-50%, -50%) scale(1.03); }
.card--hover:hover .pimg img { transform: translate(-50%, -50%) scale(1.06); }

/* ------------------------------------------------------------- 7. FORMS */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--t-sm); font-weight: 600; color: var(--ink-800); }
.field .req { color: var(--red-600); margin-left: 2px; }
.field .hint { font-size: var(--t-xs); color: var(--ink-400); }

.input, .select, .textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--ink-300);
  border-radius: var(--radius); background: #fff; color: var(--ink-900);
  font-size: var(--t-sm); transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-400); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-400); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(10,111,184,.16);
}
.textarea { min-height: 104px; resize: vertical; }
.select {
  appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%2352667B' stroke-width='1.7' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
.field--error .input, .field--error .select, .field--error .textarea {
  border-color: var(--red-600); background: #FFFBFB;
}
.err {
  display: none; align-items: center; gap: 6px;
  font-size: var(--t-xs); font-weight: 500; color: var(--red-600);
}
.field--error .err { display: flex; }

.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input[type="checkbox"] {
  flex: none; width: 18px; height: 18px; margin-top: 2px;
  accent-color: var(--blue-600); cursor: pointer;
}
.check span { font-size: var(--t-xs); line-height: 1.55; color: var(--ink-500); }
.check--error span { color: var(--red-600); }

/* ------------------------------------------------------------- 8. MODAL */
.modal {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: flex-start; justify-content: center; padding: var(--s-5);
  overflow-y: auto; background: rgba(6, 26, 44, .58);
  backdrop-filter: blur(3px);
}
.modal[data-open="true"] { display: flex; animation: fade .2s var(--ease); }
.modal__panel {
  position: relative; width: 100%; max-width: 720px; margin-block: auto;
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--sh-4);
  animation: rise .28s var(--ease);
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }

.modal__head {
  position: sticky; top: 0; z-index: 2; background: #fff;
  padding: var(--s-5) var(--s-6); border-bottom: 1px solid var(--ink-200);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal__body { padding: var(--s-6); }
.modal__close {
  position: absolute; top: 14px; right: 14px; width: 36px; height: 36px;
  display: grid; place-items: center; border-radius: var(--radius);
  color: var(--ink-500);
}
.modal__close:hover { background: var(--ink-100); color: var(--ink-900); }

/* ------------------------------------------------- 9. SCROLL REVEAL */
.rv { opacity: 0; transform: translateY(18px); }
.rv.in { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .6s var(--ease); }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; } }

/* ------------------------------------------- 10. SCROLLABLE TABLE */
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dtable { min-width: 620px; font-size: var(--t-sm); }
.dtable th, .dtable td { padding: 13px 16px; text-align: left; vertical-align: top; }
.dtable thead th {
  font-size: var(--t-xs); font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--ink-500);
  border-bottom: 1px solid var(--ink-200);
}
.dtable tbody tr + tr td { border-top: 1px solid var(--ink-100); }
.dtable tbody th { font-weight: 600; color: var(--ink-800); }
.dtable .hl { background: var(--blue-50); }
.dtable thead .hl { color: var(--blue-800); border-bottom-color: var(--blue-300); }

/* ------------------------------------------------------------- 11. MISC */
.disclaimer {
  display: flex; gap: 11px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--ink-50); border: 1px solid var(--ink-200);
  font-size: var(--t-xs); line-height: 1.6; color: var(--ink-500);
}
.disclaimer svg { flex: none; margin-top: 2px; color: var(--ink-400); }

.tick { display: flex; gap: 10px; align-items: flex-start; font-size: var(--t-sm); color: var(--ink-500); }
.tick svg { flex: none; margin-top: 4px; color: var(--green-600); }
