/* ==========================================================================
   Styling Pro Nest — main stylesheet
   Layout columns use the Bootstrap grid (bootstrap-grid.min.css, loaded first).
   This file holds the visual design: tokens, components and page sections.
   1 Tokens · 2 Base · 3 Header · 4 Buttons · 5 Hero · 6 Sections
   7 Service cards · 8 Blog · 9 Forms · 10 Footer · 11 Responsive · 12 Motion
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --plum-950: #1f1030;
  --plum-800: #3a1d5c;
  --plum-700: #4a2775;
  --violet-600: #6a3ba8;
  --violet-500: #7e52bd;
  --violet-400: #9b74d4;
  --violet-200: #d8c8ef;
  --lilac-100: #f1ebf9;
  --lilac-50: #f8f5fc;
  --paper: #fdfcfe;
  --ink: #2a2333;
  --muted: #5e5669;
  --line: #e3dcec;
  --sage-700: #3f5a45;
  --sage-600: #4f6b55;
  --sage-100: #e4ece5;
  --danger: #b3261e;
  --danger-bg: #fcebea;
  --success: #2f6b3a;
  --success-bg: #e6f2e8;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;

  --step--1: .875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 1.4rem + 1.5vw, 2.375rem);
  --step-4: clamp(2.125rem, 1.6rem + 2.6vw, 3.375rem);

  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 6.5rem;

  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 18px;
  --measure: 68ch;
  --header-h: 76px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body.nav-open { overflow: hidden; }

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--plum-800);
  line-height: 1.15;
  letter-spacing: -.015em;
  margin: 0 0 var(--space-4);
  font-weight: 700;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); letter-spacing: -.025em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.3; font-weight: 600; }

p { margin: 0 0 var(--space-4); }
p, li { text-wrap: pretty; }
ul { padding-left: 1.25rem; margin: 0 0 var(--space-4); }

a { color: var(--violet-600); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--plum-800); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--violet-500); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--violet-200); color: var(--plum-950); }

.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 200;
  background: var(--plum-800); color: #fff;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-s); font-weight: 600;
}
.skip-link:focus { top: var(--space-3); color: #fff; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Container: Bootstrap's grid container, with a fixed width and fluid gutters */
.container {
  max-width: 1240px;
  padding-left: clamp(16px, 4vw, 40px);
  padding-right: clamp(16px, 4vw, 40px);
}
.container-narrow { max-width: 860px; }

.section { padding-top: var(--space-9); padding-bottom: var(--space-9); }
.section-tight { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.section-tint { background: var(--lilac-50); }
.section-dark { background: var(--plum-950); color: #e9e2f3; }
.section-dark h2, .section-dark h3 { color: #fff; }

.section-head { max-width: 660px; margin-bottom: var(--space-7); }
.section-head p { color: var(--muted); font-size: var(--step-1); line-height: 1.55; margin: 0; }
.section-dark .section-head p { color: #cfc4e0; }
.section-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-5); flex-wrap: wrap; margin-bottom: var(--space-7); }
.section-head-row .section-head { margin-bottom: 0; }

.lede { font-size: var(--step-1); color: var(--muted); line-height: 1.55; }
.muted { color: var(--muted); }

/* Icon chip */
.icon-chip {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--lilac-100); color: var(--violet-600);
}
.icon-chip svg { width: 24px; height: 24px; }
.icon-chip-sage { background: var(--sage-100); color: var(--sage-700); }

/* 3. Header & navigation ------------------------------------------------------ */
.site-header { position: sticky; top: 0; z-index: 100; border-bottom: 1px solid transparent; transition: border-color .2s ease; }
/* Blur on a pseudo-element so the fixed mobile menu is not trapped inside the header */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(253, 252, 254, .94);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: var(--space-5); min-height: var(--header-h); }

/* Logo: mark + name on one line, one typographic style */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--plum-800);
  margin-right: auto; flex-shrink: 0; white-space: nowrap;
}
.brand:hover { color: var(--plum-800); }
.brand img { width: 40px; height: 40px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: -.02em; line-height: 1; }

.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 46px; height: 46px; border: 1px solid var(--line); border-radius: var(--radius-m);
  background: #fff; color: var(--plum-800); cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.primary-nav { display: flex; align-items: center; gap: var(--space-5); }
.nav-list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-link {
  display: inline-flex; align-items: center; padding: 10px 14px; border-radius: var(--radius-m);
  font-weight: 500; font-size: 1rem; line-height: 1.2; color: var(--ink); text-decoration: none; white-space: nowrap;
}
.nav-link:hover { background: var(--lilac-100); color: var(--plum-800); }
.nav-link[aria-current="page"] {
  color: var(--violet-600); font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--violet-600); border-radius: var(--radius-m) var(--radius-m) 0 0;
}

/* 4. Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: var(--radius-m); border: 2px solid transparent;
  font: 600 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--violet-600); color: #fff; }
.btn-primary:hover { background: var(--plum-700); color: #fff; }
.btn-secondary { background: transparent; color: var(--plum-800); border-color: var(--violet-200); }
.btn-secondary:hover { border-color: var(--violet-600); color: var(--violet-600); background: #fff; }
.btn-light { background: #fff; color: var(--plum-800); }
.btn-light:hover { background: var(--lilac-100); color: var(--plum-800); }
.btn-outline-light { color: #fff; border-color: rgba(255, 255, 255, .45); background: transparent; }
.btn-outline-light:hover { border-color: #fff; color: #fff; background: rgba(255, 255, 255, .08); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }

.text-link { font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.text-link svg { width: 18px; height: 18px; }
.text-link:hover { text-decoration: underline; }

/* 5. Hero & house drawing ------------------------------------------------------ */
.hero {
  position: relative; overflow: hidden;
  padding-top: var(--space-8); padding-bottom: var(--space-9);
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--paper);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, var(--paper) 30%, rgba(253, 252, 254, .55) 60%, rgba(253, 252, 254, .2));
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { max-width: 13ch; }
.hero .lede { max-width: 46ch; margin-bottom: var(--space-6); }
.hero-hint { display: flex; gap: 10px; align-items: flex-start; margin: var(--space-6) 0 0; font-size: var(--step--1); color: var(--muted); max-width: 40ch; }
.hero-hint svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--violet-600); margin-top: 2px; }

.house-svg { width: 100%; height: auto; overflow: visible; }
.house-svg .ln { fill: none; stroke: var(--plum-800); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.house-svg .ln-thin { fill: none; stroke: var(--violet-400); stroke-width: 1.5; stroke-linecap: round; }
.house-svg .fill-wall { fill: #fff; }
.house-svg .fill-tint { fill: var(--lilac-100); }
.house-svg .fill-violet { fill: var(--violet-400); }
.house-svg .fill-plum { fill: var(--plum-800); }
.house-svg .fill-sage { fill: #9fb8a3; }
.house-svg .fill-sage-dark { fill: var(--sage-600); }
.house-svg .fill-glass { fill: #e7def5; }
.house-svg .fill-panel { fill: var(--plum-700); }

.hotspot { cursor: pointer; outline: none; }
.hotspot .hs-ring { fill: var(--violet-600); opacity: .18; transform-box: fill-box; transform-origin: center; animation: hs-pulse 2.6s ease-out infinite; }
.hotspot .hs-dot { fill: var(--violet-600); stroke: #fff; stroke-width: 3; transition: fill .2s ease; }
.hotspot .hs-plus { stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }
.hotspot .hs-tip { opacity: 0; transition: opacity .18s ease; pointer-events: none; }
.hotspot .hs-tip rect { fill: var(--plum-950); }
.hotspot .hs-tip text { fill: #fff; font: 600 15px var(--font-body); }
.hotspot:hover .hs-dot, .hotspot:focus-visible .hs-dot { fill: var(--plum-950); }
.hotspot:hover .hs-tip, .hotspot:focus-visible .hs-tip { opacity: 1; }
.hotspot:focus-visible .hs-dot { stroke: var(--violet-200); stroke-width: 5; }
@keyframes hs-pulse {
  0% { transform: scale(.7); opacity: .35; }
  70%, 100% { transform: scale(1.5); opacity: 0; }
}

/* Inner page hero */
.page-hero { padding-top: var(--space-7); padding-bottom: var(--space-8); background: var(--lilac-50); border-bottom: 1px solid var(--line); }
.page-hero h1 { max-width: 20ch; }
.page-hero .lede { max-width: 60ch; margin-bottom: 0; }
.page-hero .btn-row { margin-top: var(--space-6); }
.media-frame img { width: 100%; border-radius: var(--radius-l); aspect-ratio: 3 / 2; object-fit: cover; background: var(--lilac-100); }

.breadcrumb { margin-bottom: var(--space-5); font-size: var(--step--1); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--violet-400); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--violet-600); text-decoration: underline; }

/* 6. Sections ---------------------------------------------------------------- */
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-5); }
.feature-list li { display: grid; grid-template-columns: auto 1fr; gap: var(--space-4); align-items: start; }
.feature-list h3 { margin-bottom: 4px; font-size: 1.125rem; }
.feature-list p { margin: 0; color: var(--muted); }

/* Benefits on dark: ruled list, not cards */
.benefit { padding-top: var(--space-5); border-top: 1px solid rgba(255, 255, 255, .16); height: 100%; }
.benefit h3 { margin-bottom: var(--space-2); }
.benefit p { margin: 0; color: #cfc4e0; }

/* Process: a sequence shown with icons and a connecting line, no numbering */
.process-step { position: relative; height: 100%; }
.process-step .icon-chip { background: var(--violet-600); color: #fff; border-radius: 50%; position: relative; z-index: 1; }
.process-step h3 { margin: var(--space-4) 0 var(--space-2); font-size: 1.125rem; }
.process-step p { margin: 0; color: var(--muted); font-size: .98rem; }
@media (min-width: 992px) {
  .process-row > div:not(:last-child) .process-step::after {
    content: ""; position: absolute; top: 24px; left: 60px; right: -12px;
    border-top: 2px dashed var(--violet-200);
  }
}

.check-list { list-style: none; padding: 0; margin: 0 0 var(--space-6); display: grid; gap: var(--space-3); }
.check-list li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; }
.check-list svg { width: 22px; height: 22px; color: var(--sage-600); margin-top: 2px; }
.inline-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }

/* Compact service rows (homepage) */
.service-group { padding-top: var(--space-5); border-top: 2px solid var(--plum-800); }
.service-group + .service-group { margin-top: var(--space-7); }
.service-group-head h3 { font-size: var(--step-2); margin-bottom: var(--space-2); }
.service-group-head p { color: var(--muted); font-size: .98rem; margin: 0; }
.service-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-4); align-items: center;
  padding: var(--space-4); height: 100%;
  border: 1px solid var(--line); border-radius: var(--radius-l); background: #fff;
  text-decoration: none; color: var(--ink);
  transition: border-color .18s ease, background-color .18s ease;
}
.service-row:hover { border-color: var(--violet-400); background: var(--lilac-50); color: var(--ink); }
.service-row h4 { margin: 0 0 2px; font-size: 1.0625rem; font-family: var(--font-display); color: var(--plum-800); font-weight: 600; }
.service-row p { margin: 0; font-size: .925rem; color: var(--muted); line-height: 1.5; }
.service-row .row-arrow { width: 20px; height: 20px; color: var(--violet-400); transition: transform .18s var(--ease); }
.service-row:hover .row-arrow { transform: translateX(3px); color: var(--violet-600); }

/* FAQ accordion (native details/summary) */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--space-4);
  padding: var(--space-5) 0; font: 600 1.125rem/1.4 var(--font-display); color: var(--plum-800);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--violet-600); }
.faq-icon {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--violet-200);
  display: grid; place-items: center; transition: transform .2s var(--ease), background-color .2s ease;
}
.faq-icon svg { width: 16px; height: 16px; }
.faq details[open] .faq-icon { transform: rotate(45deg); background: var(--lilac-100); }
.faq-answer { padding: 0 var(--space-7) var(--space-5) 0; color: var(--muted); max-width: var(--measure); }
.faq-answer p:last-child { margin-bottom: 0; }

/* CTA band */
.cta-band { background: var(--violet-600); color: #fff; border-radius: var(--radius-l); padding: clamp(28px, 5vw, 64px); }
.cta-band h2 { color: #fff; margin-bottom: var(--space-3); }
.cta-band p { margin: 0; color: #ece4f8; max-width: 52ch; }

/* Newsletter band */
.newsletter h2 { margin-bottom: var(--space-3); }
.newsletter p { color: var(--muted); margin: 0; }
.inline-field { display: flex; gap: var(--space-3); align-items: flex-start; }
.inline-field .field { flex: 1; }

/* Callout */
.callout {
  display: grid; grid-template-columns: auto 1fr; gap: var(--space-4);
  padding: var(--space-5); border-radius: var(--radius-l); background: var(--sage-100); color: var(--sage-700);
}
.callout svg { width: 24px; height: 24px; margin-top: 2px; }
.callout p { margin: 0; color: #2f4535; }
.callout strong { color: #23362a; }

/* 7. Service cards --------------------------------------------------------- */
.jump-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--space-6); }
.jump-nav a {
  font-size: .925rem; padding: 6px 14px; border: 1px solid var(--violet-200); border-radius: 999px;
  text-decoration: none; color: var(--plum-800); background: #fff;
}
.jump-nav a:hover { border-color: var(--violet-600); color: var(--violet-600); }

.group-heading { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; padding-top: var(--space-5); border-top: 2px solid var(--plum-800); margin-bottom: var(--space-6); }
.group-heading h2 { margin: 0; font-size: var(--step-2); }
.group-heading p { margin: 0; color: var(--muted); max-width: 52ch; }
.service-group-block + .service-group-block { margin-top: var(--space-8); }

.service-card {
  display: flex; flex-direction: column; height: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.service-card:hover { border-color: var(--violet-400); box-shadow: 0 18px 40px -24px rgba(58, 29, 92, .45); }
.service-card:target { border-color: var(--violet-600); box-shadow: 0 0 0 3px var(--violet-200); }
.service-card-media { background: var(--lilac-100); overflow: hidden; }
.service-card-media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .5s var(--ease); }
.service-card:hover .service-card-media img { transform: scale(1.03); }
.service-card-body { display: flex; flex-direction: column; flex: 1; padding: 0 var(--space-5) var(--space-5); }
.service-card-body .icon-chip { margin-top: -24px; position: relative; border: 3px solid #fff; width: 52px; height: 52px; }
.service-card h3 { margin: var(--space-4) 0 var(--space-2); }
.service-card p { color: var(--muted); font-size: .985rem; }
.service-card .card-note { font-size: .875rem; color: var(--sage-700); background: var(--sage-100); padding: 8px 12px; border-radius: var(--radius-m); }
.service-card .btn { margin-top: auto; align-self: flex-start; }

/* 8. Blog -------------------------------------------------------------------- */
.post-card { display: flex; flex-direction: column; height: 100%; }
.post-card-media { display: block; border-radius: var(--radius-l); overflow: hidden; background: var(--lilac-100); margin-bottom: var(--space-4); }
.post-card-media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .4s var(--ease); }
.post-card:hover .post-card-media img { transform: scale(1.03); }
.post-cat { display: inline-block; font-size: .875rem; font-weight: 600; color: var(--violet-600); margin-bottom: var(--space-2); }
.post-card h3, .post-card h2 { font-size: 1.25rem; margin-bottom: var(--space-2); }
.post-card h3 a, .post-card h2 a, .post-feature h2 a { color: var(--plum-800); text-decoration: none; }
.post-card h3 a:hover, .post-card h2 a:hover, .post-feature h2 a:hover { color: var(--violet-600); text-decoration: underline; }
.post-card p { color: var(--muted); font-size: .975rem; }
.post-card .text-link { margin-top: auto; }
.post-feature { margin-bottom: var(--space-8); }
.post-feature h2 { font-size: var(--step-3); }
.post-feature .post-card-media { margin: 0; }

.article-header { padding-top: var(--space-7); padding-bottom: var(--space-6); }
.article-header h1 { max-width: 22ch; }
.article-header .lede { max-width: 60ch; }
.article-cover { margin: 0 0 var(--space-7); }
.article-cover img { width: 100%; border-radius: var(--radius-l); aspect-ratio: 16 / 9; object-fit: contain; background: var(--lilac-100); }
.byline { color: var(--muted); font-size: .95rem; }

.prose { max-width: var(--measure); font-size: 1.125rem; line-height: 1.75; }
.prose h2 { font-size: var(--step-2); margin-top: var(--space-7); }
.prose h2:first-child { margin-top: 0; }
.prose ul { margin-bottom: var(--space-5); }
.prose li { margin-bottom: var(--space-2); }
.prose li::marker { color: var(--violet-500); }

.sidebar { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: var(--space-5); }
.sidebar-card { border: 1px solid var(--line); border-radius: var(--radius-l); padding: var(--space-5); background: #fff; }
.sidebar-card h2 { font-size: 1.125rem; margin-bottom: var(--space-3); }
.sidebar-card p { color: var(--muted); font-size: .95rem; }
.sidebar-card-accent { background: var(--plum-950); border-color: var(--plum-950); color: #e9e2f3; }
.sidebar-card-accent h2 { color: #fff; }
.sidebar-card-accent p { color: #cfc4e0; }
.toc ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 6px 10px; border-left: 2px solid var(--line); text-decoration: none; color: var(--muted); font-size: .95rem; line-height: 1.4; }
.toc a:hover { color: var(--violet-600); border-left-color: var(--violet-600); }

.article-footer { max-width: var(--measure); margin-top: var(--space-7); padding-top: var(--space-6); border-top: 1px solid var(--line); }
.copy-status { font-size: .9rem; color: var(--success); min-height: 1.4em; margin: var(--space-3) 0 0; }

/* Legal */
.legal-toc { position: sticky; top: calc(var(--header-h) + 24px); }

/* 9. Forms ------------------------------------------------------------------- */
.form { display: grid; gap: var(--space-5); }
.field { display: grid; gap: 6px; align-content: start; }
.field label { font-weight: 600; font-size: .975rem; color: var(--plum-800); }
.field .optional { font-weight: 400; color: var(--muted); }
.hint { font-size: .875rem; color: var(--muted); margin: 0; }

input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  font: 400 1rem/1.4 var(--font-body); color: var(--ink); background: #fff;
  border: 1.5px solid #cfc5dc; border-radius: var(--radius-s);
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 160px; resize: vertical; }
select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a3ba8' 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; background-size: 18px; padding-right: 40px;
}
input:hover, select:hover, textarea:hover { border-color: var(--violet-400); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet-600); box-shadow: 0 0 0 4px rgba(106, 59, 168, .18); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgba(179, 38, 30, .15); }

.field-error { color: var(--danger); font-size: .9rem; font-weight: 500; margin: 0; }
.field-error:empty { display: none; }

.checkbox { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: .95rem; }
.checkbox input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--violet-600); }

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-alert { padding: var(--space-4) var(--space-5); border-radius: var(--radius-m); font-weight: 500; display: grid; grid-template-columns: 22px 1fr; gap: 12px; }
.form-alert svg { width: 22px; height: 22px; margin-top: 1px; }
.form-alert p { margin: 0; }
.form-alert[hidden] { display: none; }
.form-alert-error { background: var(--danger-bg); color: var(--danger); }
.form-alert-success { background: var(--success-bg); color: var(--success); }

.form-card { border: 1px solid var(--line); border-radius: var(--radius-l); padding: clamp(24px, 4vw, 40px); background: #fff; }
.contact-info { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-5); }
.contact-info li { display: grid; grid-template-columns: auto 1fr; gap: var(--space-4); align-items: start; }
.contact-info h3 { margin-bottom: 2px; font-size: 1.0625rem; }
.contact-info p { margin: 0; color: var(--muted); }
.contact-info address { font-style: normal; color: var(--muted); }

/* Not-found page */
.status-page { padding-top: var(--space-9); padding-bottom: var(--space-9); min-height: 60vh; display: grid; align-items: center; }
.status-page h1 { max-width: 18ch; }

/* 10. Footer --------------------------------------------------------------- */
.site-footer { background: var(--plum-950); color: #cfc4e0; padding-top: var(--space-8); font-size: .975rem; }
.site-footer a { color: #e9e2f3; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .brand { color: #fff; margin-bottom: var(--space-4); }
.footer-col h2 { font-size: 1rem; color: #fff; margin-bottom: var(--space-4); letter-spacing: 0; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-contact li { display: flex; gap: 10px; align-items: center; }
.footer-contact svg { width: 18px; height: 18px; color: var(--violet-200); flex-shrink: 0; }
.footer-bottom {
  margin-top: var(--space-8); border-top: 1px solid rgba(255, 255, 255, .12); padding: var(--space-5) 0;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); font-size: .9rem;
}
.footer-bottom p { margin: 0; }
.footer-bottom ul { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-5); margin: 0; padding: 0; }

.back-to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 90; width: 48px; height: 48px; border-radius: 50%;
  border: 0; background: var(--plum-800); color: #fff; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 10px 24px -8px rgba(31, 16, 48, .5);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .2s ease, transform .2s var(--ease), visibility .2s;
}
.back-to-top svg { width: 22px; height: 22px; }
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--violet-600); }

/* Image fallback, applied by main.js when an image fails to load */
img.img-failed {
  background: repeating-linear-gradient(135deg, var(--lilac-100) 0 12px, var(--lilac-50) 12px 24px);
  min-height: 160px; object-position: -9999px -9999px;
}

/* 11. Responsive (breakpoints match Bootstrap: lg 992, md 768) ------------- */
@media (max-width: 991.98px) {
  :root { --header-h: 68px; }
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    background: var(--paper); flex-direction: column; align-items: stretch; gap: var(--space-5);
    padding: var(--space-5) clamp(16px, 4vw, 40px) var(--space-7);
    overflow-y: auto; border-top: 1px solid var(--line); display: none;
  }
  .primary-nav.is-open { display: flex; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-list > li { border-bottom: 1px solid var(--line); }
  .nav-link { width: 100%; padding: 16px 4px; font-size: 1.125rem; border-radius: 0; }
  .nav-link:hover { background: none; }
  .nav-link[aria-current="page"] { box-shadow: none; border-radius: 0; }
  .header-cta { width: 100%; }

  .hero::after { background: linear-gradient(180deg, var(--paper) 35%, rgba(253, 252, 254, .6)); }
  .hero h1 { max-width: 16ch; }
  .sidebar, .legal-toc { position: static; }
}

@media (max-width: 767.98px) {
  :root { --step-0: 1rem; }
  .section { padding-top: var(--space-8); padding-bottom: var(--space-8); }
  .section-tight { padding-top: var(--space-7); padding-bottom: var(--space-7); }
  .brand-name { font-size: 1.15rem; }
  .brand img { width: 34px; height: 34px; }
  .inline-field { flex-direction: column; align-items: stretch; }
  .btn-row .btn { flex: 1 1 auto; }
  .faq-answer { padding-right: 0; }
  .prose { font-size: 1.0625rem; }
  .back-to-top { right: 14px; bottom: 14px; }
}

/* 12. Reduced motion and print ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .hotspot .hs-ring { display: none; }
}
@media print {
  .site-header, .site-footer, .back-to-top, .newsletter, .cta-band, .sidebar { display: none !important; }
}

/* Footer contact list (Bootstrap's grid file has no list reset) */
.footer-contact { list-style: none; margin: 0 0 var(--space-4); }
.footer-col h2.mt-4 { margin-top: var(--space-5); }

/* On phones, keep wide Bootstrap gutters inside the page padding (vertical spacing is unchanged) */
@media (max-width: 767.98px) {
  .row.g-5 { --bs-gutter-x: 1.5rem; }
}
