/* ==========================================================================
   RCMPro — stylesheet
   1. Tokens   2. Base   3. Utilities & buttons   4. Header / nav
   5. Hero     6. Sections   7. Services   8. Process   9. Results
   10. FAQ     11. Contact CTA   12. Footer   13. Motion   14. Responsive
   ========================================================================== */

/* 1. Tokens --------------------------------------------------------------- */
:root {
  --ink: #0b1410;
  --ink-2: #111d18;
  --ink-3: #19281f;
  --paper: #f6f3ec;
  --paper-2: #ece8dc;
  --card: #fffdf8;

  --text: #0b1410;
  --muted: #56625c;
  --text-dark: #f2f5ef;
  --muted-dark: #9dada4;

  --accent: #c9f26c;
  --accent-deep: #1f5f4b;
  --warn: #f3c969;

  --line: rgba(11, 20, 16, 0.12);
  --line-dark: rgba(255, 255, 255, 0.11);

  --radius: 22px;
  --radius-sm: 12px;
  --container: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --section-y: clamp(72px, 10vw, 136px);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.nav-open { overflow: hidden; }

/* Keep the hidden attribute authoritative over component display rules */
[hidden] { display: none !important; }

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.04;
  text-wrap: balance;
}
h1 { font-size: clamp(2.7rem, 6.4vw, 5.4rem); }
h2 { font-size: clamp(2.1rem, 4.4vw, 3.6rem); }
h1 em, h2 em { font-style: italic; font-weight: 300; color: var(--accent-deep); }
h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }

:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 3px;
  border-radius: 6px;
}
.hero :focus-visible,
.site-header :focus-visible,
.section-dark :focus-visible,
.cta-panel :focus-visible,
.site-footer :focus-visible,
.modal :focus-visible,
.portal-page :focus-visible { outline-color: var(--accent); }

::selection { background: var(--accent); color: var(--ink); }

/* 3. Utilities & buttons -------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
  transition: top 0.2s;
}
.skip-link:focus { top: 16px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}
.eyebrow-pill {
  padding: 8px 16px 8px 12px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dark);
  letter-spacing: 0.1em;
}
.eyebrow-pill::before { display: none; }

.pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.2s ease-out infinite;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
    background-color 0.25s, border-color 0.25s, color 0.25s;
}
.btn-lg { padding: 16px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-arrow { width: 16px; height: 16px; transition: transform 0.35s var(--ease); }
.btn:hover .btn-arrow, .text-link:hover .btn-arrow { transform: translateX(4px); }

.btn-accent { background: var(--accent); color: var(--ink); }
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -12px rgba(201, 242, 108, 0.55);
}
.btn-ghost { border-color: var(--line-dark); background: transparent; color: var(--text-dark); }
.btn-icon { width: 16px; height: 16px; }
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.06); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid currentColor;
  font-weight: 700;
  color: var(--accent-deep);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.pill-ok { background: rgba(201, 242, 108, 0.14); color: var(--accent); }
.pill-wait { background: rgba(243, 201, 105, 0.14); color: var(--warn); }

/* 4. Header / nav --------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  color: var(--text-dark);
}
/* Glass background lives on a pseudo-element so the fixed mobile menu
   is not trapped by a backdrop-filter containing block. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(11, 20, 16, 0.78);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line-dark);
  opacity: 0;
  transition: opacity 0.35s;
}
.site-header.is-scrolled::before,
.site-header.is-open::before { opacity: 1; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 76px;
}

.brand {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
}
.brand-mark { width: 30px; height: 30px; }
.brand-name {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-dark);
}
.brand-name span { color: var(--accent); }

.nav-menu { display: flex; align-items: center; gap: 36px; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
  position: relative;
  padding: 6px 0;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--muted-dark);
  transition: color 0.25s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--text-dark); }
.nav-links a:hover::after, .nav-links a.is-active::after { transform: scaleX(1); }

.nav-toggle {
  position: relative;
  z-index: 2;
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.nav-toggle span {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 1.5px;
  background: var(--text-dark);
  transition: transform 0.4s var(--ease), top 0.4s var(--ease);
}
.nav-toggle span:first-child { top: 17px; }
.nav-toggle span:last-child { top: 24px; }
.is-open .nav-toggle span:first-child { top: 21px; transform: rotate(45deg); }
.is-open .nav-toggle span:last-child { top: 21px; transform: rotate(-45deg); }

/* 5. Hero ----------------------------------------------------------------- */
.hero {
  position: relative;
  padding-top: clamp(112px, 11vw, 148px);
  background: var(--ink);
  color: var(--text-dark);
  overflow: hidden;
  overflow: clip;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-dark) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 72% 28%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 75% 70% at 72% 28%, #000 0%, transparent 72%);
  opacity: 0.6;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  top: -28vw;
  right: -18vw;
  width: 70vw;
  height: 70vw;
  max-width: 1100px;
  max-height: 1100px;
  background: radial-gradient(closest-side, rgba(201, 242, 108, 0.17), rgba(31, 95, 75, 0.12) 55%, transparent);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: start;
  padding-bottom: clamp(64px, 9vw, 120px);
}

/* 10% smaller than the base h1 size */
.hero h1 { margin-top: 26px; font-size: clamp(2.43rem, 5.76vw, 4.86rem); }
.hero h1 em { color: var(--accent); }
.hero-lead {
  max-width: 34rem;
  margin-top: 26px;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--muted-dark);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }
.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--line-dark);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted-dark);
}
.hero-points li { display: flex; align-items: center; gap: 9px; }
.hero-points li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Dashboard visual */
.hero-visual { position: relative; }
.dash {
  position: relative;
  padding: 26px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.dash-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dash-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-dark);
}
.dash-title { margin-top: 4px; font-size: 1.05rem; font-weight: 700; }

.dash-score {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.26);
}
.ring { width: 58px; height: 58px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring-bg { stroke: rgba(255, 255, 255, 0.1); }
.ring-fg {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 163.4;
  stroke-dashoffset: 22.9;
  animation: ring 1.8s var(--ease) 0.5s both;
}
.dash-score-num {
  font-family: var(--font-display);
  font-size: 2.1rem;
  line-height: 1;
  letter-spacing: -0.02em;
}
.dash-score-num span { font-size: 1.1rem; color: var(--muted-dark); }
.dash-score-num .num { font-size: inherit; color: inherit; }
.dash-score .dash-label { margin-top: 5px; }
.dash-markets { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; margin-left: auto; max-width: 112px; }
.dash-markets span {
  padding: 3px 7px;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--muted-dark);
}

.dash-list { margin-top: 8px; }
.dash-list li {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-dark);
  animation: rise 0.8s var(--ease) both;
}
.dash-list li:last-child { border-bottom: 0; padding-bottom: 2px; }
.dash-list li:nth-child(1) { animation-delay: 0.6s; }
.dash-list li:nth-child(2) { animation-delay: 0.75s; }
.dash-list li:nth-child(3) { animation-delay: 0.9s; }
.dash-list li:nth-child(4) { animation-delay: 1.05s; }

.tick {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
}
.tick svg { width: 13px; height: 13px; }
.tick-wait { background: transparent; border: 1.5px solid rgba(243, 201, 105, 0.35); }
.tick-wait i {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1.5px solid transparent;
  border-top-color: var(--warn);
  margin: -1.5px;
  box-sizing: content-box;
  animation: spin 1.1s linear infinite;
}
.dash-item { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.dash-item strong { font-size: 0.92rem; font-weight: 600; }
.dash-item small { font-size: 0.76rem; color: var(--muted-dark); }

.float-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line-dark);
  border-radius: 16px;
  background: rgba(25, 40, 31, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.8);
  animation: float 7s ease-in-out infinite;
}
.float-chip svg { width: 26px; height: 26px; color: var(--accent); }
.float-chip span { display: flex; flex-direction: column; line-height: 1.3; }
.float-chip strong { font-size: 0.84rem; }
.float-chip small { font-size: 0.72rem; color: var(--muted-dark); }
.chip-num {
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1 !important;
  color: var(--accent);
}
.chip-a { top: 0; right: 0; }
.chip-b { bottom: 0; left: -26px; animation-delay: -3.5s; }

/* Marquee */
.marquee {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line-dark);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  padding-block: 22px;
  animation: marquee 38s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track li {
  display: flex;
  align-items: center;
  gap: 44px;
  padding-left: 44px;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--muted-dark);
  white-space: nowrap;
}
.marquee-track li::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

/* 6. Sections ------------------------------------------------------------- */
.section { padding-block: var(--section-y); }
.section[id], .hero[id] { scroll-margin-top: 72px; }
.section-tint { background: var(--paper-2); }
.section-dark { background: var(--ink); color: var(--text-dark); }
.section-dark h2 em, .cta-panel h2 em { color: var(--accent); }
.section-dark .eyebrow, .cta-panel .eyebrow { color: var(--accent); }
.section-dark .section-lead, .cta-panel .section-lead { color: var(--muted-dark); }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(24px, 5vw, 80px);
  align-items: end;
  margin-bottom: clamp(44px, 6vw, 76px);
}
.section-head h2, .faq-intro h2, .cta-copy h2 { margin-top: 20px; }
.section-lead { font-size: 1.08rem; color: var(--muted); max-width: 34rem; }

/* 7. Services ------------------------------------------------------------- */
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.service-grid > li { display: flex; }
.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 32px 30px 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.3s;
}
.service-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--accent-deep);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
}
.service-card:hover {
  transform: translateY(-6px);
  border-color: transparent;
  box-shadow: 0 30px 60px -30px rgba(11, 20, 16, 0.3);
}
.service-card:hover::after { transform: scaleX(1); }
.service-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 44px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--accent);
  transition: transform 0.5s var(--ease);
}
.service-card:hover .service-icon { transform: rotate(-6deg) scale(1.05); }
.service-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.service-card p { margin-top: 10px; color: var(--muted); font-size: 0.97rem; }
.service-no {
  position: absolute;
  top: 30px;
  right: 30px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  color: var(--muted);
}

/* 8. Process -------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.steps li { position: relative; padding-top: 34px; border-top: 1px solid rgba(11, 20, 16, 0.22); }
.steps li::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-deep);
  box-shadow: 0 0 0 5px var(--paper-2);
}
.step-no {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(3rem, 5vw, 4.2rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent-deep);
}
.steps h3 { margin-top: 22px; font-size: 1.3rem; }
.steps p { margin-top: 10px; color: var(--muted); font-size: 0.97rem; }
.step-tag {
  display: inline-block;
  margin-top: 20px;
  padding: 5px 12px;
  border: 1px solid rgba(11, 20, 16, 0.2);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* 9. Results -------------------------------------------------------------- */
.section-dark { position: relative; overflow: hidden; overflow: clip; }
.section-dark::before {
  content: "";
  position: absolute;
  bottom: -30vw;
  left: -20vw;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(closest-side, rgba(31, 95, 75, 0.28), transparent);
  pointer-events: none;
}
.section-dark .container { position: relative; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--line-dark);
}
.stat {
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 4vw, 48px) clamp(16px, 2.4vw, 32px);
  border-left: 1px solid var(--line-dark);
}
.stat:first-child { border-left: 0; padding-left: 0; }
.stat dd {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5.4vw, 4.6rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
/* Number and optional unit share one baseline, e.g. 20+ Years */
.stat dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.12em; }
.stat-unit { font-size: 0.42em; font-weight: 400; letter-spacing: 0; white-space: nowrap; }
.stat dt { order: 2; margin-top: 14px; font-size: 0.94rem; color: var(--muted-dark); text-wrap: balance; }

.quote { max-width: 60rem; margin-top: clamp(56px, 8vw, 104px); }
.quote-mark { width: 40px; height: 30px; color: var(--accent); }
.quote blockquote {
  margin-top: 28px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.1vw, 2.5rem);
  font-weight: 300;
  line-height: 1.28;
  letter-spacing: -0.015em;
  text-wrap: pretty;
}
.quote figcaption { display: flex; align-items: center; gap: 14px; margin-top: 34px; }
.quote figcaption span:last-child { display: flex; flex-direction: column; line-height: 1.4; }
.quote small { font-size: 0.88rem; color: var(--muted-dark); }
.avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ink-3);
  border: 1px solid var(--line-dark);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent);
}

/* 10. FAQ ----------------------------------------------------------------- */
.faq-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(40px, 7vw, 110px);
  align-items: start;
}
.faq-intro { position: sticky; top: 120px; }
.faq-intro .section-lead { margin-top: 22px; }
.faq-intro .text-link { margin-top: 30px; }

.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:first-child { border-top: 1px solid var(--line); }
.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: 26px 0;
  border: 0;
  background: none;
  font-size: clamp(1.05rem, 1.5vw, 1.22rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: color 0.25s;
}
.faq-q:hover { color: var(--accent-deep); }
.faq-icon {
  position: relative;
  flex: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: background-color 0.35s, border-color 0.35s, transform 0.5s var(--ease);
}
.faq-icon::before, .faq-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 1.5px;
  margin: -0.75px 0 0 -6px;
  background: currentColor;
  transition: transform 0.5s var(--ease), background-color 0.35s;
}
.faq-icon::after { transform: rotate(90deg); }
.faq-item.is-open .faq-icon {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--accent);
  transform: rotate(180deg);
}
.faq-item.is-open .faq-icon::after { transform: rotate(0deg); }

.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows 0.55s var(--ease), visibility 0s 0.55s;
}
.faq-item.is-open .faq-a {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows 0.55s var(--ease), visibility 0s;
}
.faq-a-inner { overflow: hidden; }
.faq-a p { max-width: 40rem; padding-bottom: 28px; color: var(--muted); }
/* Answers with more than one paragraph: tighter gap between them */
.faq-a p:not(:last-child) { padding-bottom: 14px; }
/* Bullet lists and sub-headings inside answers */
.faq-a ul { max-width: 40rem; padding: 0 0 14px 4px; color: var(--muted); }
.faq-a ul:last-child { padding-bottom: 28px; }
.faq-a li { position: relative; padding-left: 20px; }
.faq-a li + li { margin-top: 6px; }
.faq-a li::before {
  content: "";
  position: absolute;
  top: 0.65em;
  left: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-deep);
}
.faq-a li strong { color: var(--text); }
.faq-a .faq-subhead { padding-top: 6px; font-weight: 700; color: var(--text); }

/* 11. Contact CTA --------------------------------------------------------- */
.section-cta { padding-top: 0; }
.cta-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: clamp(32px, 5vw, 72px);
  padding: clamp(28px, 5.5vw, 76px);
  border-radius: clamp(24px, 3vw, 36px);
  background: var(--ink);
  color: var(--text-dark);
  overflow: hidden;
}
.cta-panel::before {
  content: "";
  position: absolute;
  top: -40%;
  left: -20%;
  width: 70%;
  aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(201, 242, 108, 0.14), transparent);
  pointer-events: none;
}
.cta-copy, .cta-form-wrap { position: relative; }
.cta-copy .section-lead { margin-top: 22px; }

.contact-list { display: grid; gap: 14px; margin-top: 38px; font-weight: 600; }
.contact-list li { display: flex; align-items: center; gap: 14px; }
.contact-list svg {
  flex: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.contact-list a { transition: color 0.25s; overflow-wrap: anywhere; }
.contact-list a:hover { color: var(--accent); }

.cta-form-wrap {
  padding: clamp(22px, 3vw, 36px);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}
.cta-form { display: grid; gap: 18px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 8px; align-content: start; }
.field label { font-size: 0.84rem; font-weight: 700; }
.optional { font-weight: 500; color: var(--muted-dark); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text-dark);
  font-size: 1rem; /* 16px avoids iOS zoom-on-focus */
  transition: border-color 0.25s, box-shadow 0.25s, background-color 0.25s;
}
.field textarea { resize: vertical; min-height: 112px; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%239dada4' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}
.field select option { background: var(--ink-2); color: var(--text-dark); }
.field ::placeholder { color: rgba(157, 173, 164, 0.7); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: rgba(255, 255, 255, 0.26); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(201, 242, 108, 0.16);
}
.field [aria-invalid="true"] { border-color: #ff9d8a; }
.field-error { font-size: 0.82rem; font-weight: 600; color: #ffb3a4; }
.form-note { font-size: 0.82rem; text-align: center; color: var(--muted-dark); }

.form-success {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 12px;
  min-height: 340px;
  text-align: center;
  animation: rise 0.8s var(--ease) both;
}
.form-success[hidden] { display: none; }
.form-success:focus { outline: none; }
.form-success h3 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 400; }
.form-success p { color: var(--muted-dark); max-width: 22rem; }
.success-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
}
.success-icon svg { width: 28px; height: 28px; }

/* 12. Footer -------------------------------------------------------------- */
.site-footer {
  padding-top: clamp(56px, 7vw, 88px);
  background: var(--ink);
  color: var(--muted-dark);
  font-size: 0.94rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: 40px;
  padding-bottom: clamp(48px, 6vw, 72px);
}
.footer-brand p { max-width: 20rem; margin-top: 18px; }
.site-footer h4 {
  margin-bottom: 18px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dark);
}
.footer-grid ul { display: grid; gap: 11px; }
.site-footer a { transition: color 0.25s; }
.site-footer a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  padding-block: 26px;
  border-top: 1px solid var(--line-dark);
  font-size: 0.86rem;
}
.footer-bottom ul { display: flex; gap: 28px; }

/* 13. Motion -------------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

@keyframes pulse { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes ring { from { stroke-dashoffset: 163.4; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes marquee { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
}

/* 14. Responsive ---------------------------------------------------------- */
@media (max-width: 1080px) {
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 52px; }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 920px) {
  /* Mobile navigation: full-screen panel */
  .nav { height: 68px; }
  .nav-toggle { display: block; }
  .nav-menu {
    position: fixed;
    inset: 0;
    z-index: 1;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    gap: 32px;
    padding: 108px var(--gutter) 36px;
    background: var(--ink);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity 0.4s var(--ease), transform 0.5s var(--ease), visibility 0s 0.5s;
  }
  .is-open .nav-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.4s var(--ease), transform 0.5s var(--ease), visibility 0s;
  }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-links a {
    display: block;
    padding: 18px 0;
    border-bottom: 1px solid var(--line-dark);
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--text-dark);
  }
  .nav-links a::after { display: none; }
  .nav-links a.is-active { color: var(--accent); }
  .nav-cta { padding: 18px 28px; font-size: 1rem; }

  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { max-width: 520px; }
  .chip-b { left: -8px; }

  .section-head { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .faq-grid { grid-template-columns: minmax(0, 1fr); }
  .faq-intro { position: static; }
  .cta-panel { grid-template-columns: minmax(0, 1fr); }

  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding-inline: 24px; }
  .stat:nth-child(odd) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line-dark); }
}

@media (max-width: 640px) {
  .service-grid { grid-template-columns: minmax(0, 1fr); }
  .service-icon { margin-bottom: 30px; }
  .steps { grid-template-columns: minmax(0, 1fr); row-gap: 44px; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .hero-actions .btn { flex: 1 1 100%; }
  .hero-points { flex-direction: column; }
  .dash { padding: 20px; }
  .dash-markets { display: none; }
  .chip-a { right: -4px; }
  .chip-b { left: -4px; }
  .float-chip { padding: 10px 13px; }

  .stat { padding-inline: 16px; }
  .cta-panel { margin-inline: calc(var(--gutter) * -0.5); }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .portal-visual .dash-item small { display: none; }
}

/* ==========================================================================
   15. Compliance check (hero form + result)
   ========================================================================== */
.nav-actions { display: flex; align-items: center; gap: 12px; }

/* Title above the compliance check card */
.checker-intro { margin-bottom: 20px; }
.checker-heading { font-size: clamp(1.75rem, 2.7vw, 2.35rem); line-height: 1.1; }
.checker-heading em { color: var(--accent); }
.checker-sub { margin-top: 8px; font-size: 1.05rem; color: var(--muted-dark); }
.checker-sub strong { font-weight: 700; color: var(--accent); }

.checker-form, .checker-result { display: grid; gap: 16px; }
.checker-result:focus { outline: none; }
.checker .dash-head { margin-bottom: 4px; }
.checker .dash-title { font-size: 1.12rem; }

.checker .field label,
.checker legend {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.4;
}
.checker fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.checker legend { margin-bottom: 8px; }
.checker .field .sub-label {
  padding-left: 32px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted-dark);
}
.q-no {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
}
.checker .field select { padding-block: 12px; text-overflow: ellipsis; }

/* Question 3: pill-style radio buttons */
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; flex: 1 1 auto; }
.choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}
.choice span {
  display: block;
  padding: 11px 14px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}
.choice:hover span { border-color: rgba(255, 255, 255, 0.26); }
.choice input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Result */
.pill-alert { background: rgba(255, 157, 138, 0.14); color: #ffb3a4; }

.checker .dash-score { align-items: flex-start; margin-top: 0; }
.level-badge {
  --lvl: var(--accent);
  display: grid;
  place-items: center;
  align-content: center;
  flex: none;
  width: 66px;
  height: 66px;
  border-radius: 18px;
  background: var(--lvl);
  color: var(--ink);
  animation: pop 0.6s var(--ease) both;
}
.level-badge[data-level="2"] { --lvl: var(--warn); }
.level-badge[data-level="3"] { --lvl: #ff9d8a; }
.level-badge small {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
}
.level-badge strong {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 500;
  line-height: 1;
}
.level-badge-sm { width: 52px; height: 52px; border-radius: 14px; }
.level-badge-sm strong { font-size: 1.6rem; }
.level-title { font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.level-desc { margin-top: 5px; font-size: 0.86rem; line-height: 1.5; color: var(--muted-dark); }

.checker .dash-list { margin-top: -6px; }
.checker .dash-list li { padding: 11px 0; }
.checker .dash-list li:nth-child(1) { animation-delay: 0.08s; }
.checker .dash-list li:nth-child(2) { animation-delay: 0.16s; }
.checker .dash-list li:nth-child(3) { animation-delay: 0.24s; }
.checker .dash-list li:nth-child(4) { animation-delay: 0.32s; }
.checker .dash-list li:nth-child(5) { animation-delay: 0.4s; }
.checker .dash-list li:nth-child(6) { animation-delay: 0.48s; }
.field-hint { font-size: 0.78rem; line-height: 1.45; color: var(--muted-dark); }

/* ---- Compact layout so the whole check fits on the front page ---- */
.checker { padding: 22px 24px; }
.checker-form, .checker-result { gap: 12px; }
.checker .dash-head { align-items: center; margin-bottom: 0; }
.checker .field { gap: 6px; }
.checker legend { margin-bottom: 6px; }
.checker .field label, .checker legend { font-size: 0.84rem; }
.checker .field select { padding-block: 9px; font-size: 0.94rem; }
.checker .choice span { padding: 8px 14px; font-size: 0.86rem; }
.checker .field-hint { margin-top: 5px; font-size: 0.74rem; }
.checker .btn-block { padding-block: 12px; }
/* The sub-category list sits directly under its category; label kept for screen readers */
.checker .field .sub-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.checker #ck-sub-field { margin-top: -4px; }

/* Result: answers in two columns */
.checker-result .dash-score { padding: 14px 16px; }
.checker .dash-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; margin-top: -4px; }
.checker .dash-list li { align-items: flex-start; gap: 10px; padding: 9px 0; }
.checker .dash-list li:last-child { padding-bottom: 9px; border-bottom: 1px solid var(--line-dark); }
.checker .dash-list .tick { width: 20px; height: 20px; margin-top: 2px; }
.checker .dash-list .tick svg { width: 10px; height: 10px; }
.checker .dash-item strong { font-size: 0.84rem; }
.checker .dash-item small { font-size: 0.76rem; line-height: 1.4; }
.checker-result .form-note { font-size: 0.76rem; }

@media (max-width: 640px) {
  .checker { padding: 20px; }
  .checker .field select { font-size: 1rem; } /* 16px avoids iOS zoom-on-focus */
  .checker .dash-list { grid-template-columns: minmax(0, 1fr); }
}
.checker .dash-item small { font-size: 0.8rem; }

.area-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.area-tags span {
  padding: 4px 10px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted-dark);
}

.area-tags b { margin-left: 3px; font-weight: 700; color: var(--text-dark); }

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  font-weight: 700;
  color: var(--text-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.25s;
}
.link-btn:hover { color: var(--accent); }

/* Quote summary shown above the contact form */
.quote-summary {
  padding: 18px;
  border: 1px solid rgba(201, 242, 108, 0.3);
  border-radius: 16px;
  background: rgba(201, 242, 108, 0.06);
  animation: rise 0.7s var(--ease) both;
}
.quote-summary-head { display: flex; align-items: center; gap: 14px; }
.quote-summary-head > div { margin-right: auto; min-width: 0; }
.quote-summary-head .link-btn { font-size: 0.8rem; color: var(--muted-dark); }
.quote-summary-title { margin-top: 3px; font-size: 0.95rem; font-weight: 700; line-height: 1.35; }
.quote-summary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line-dark);
}
/* The last item (the standards line) spans both columns */
.quote-summary-list div:last-child { grid-column: 1 / -1; }
.quote-summary-list dt {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-dark);
}
.quote-summary-list dd { margin-top: 2px; font-size: 0.86rem; font-weight: 600; line-height: 1.4; }

/* ==========================================================================
   16. Login dialog
   ========================================================================== */
.modal {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: var(--ink-2);
  color: var(--text-dark);
  box-shadow: 0 50px 100px -30px rgba(0, 0, 0, 0.8);
  overflow-y: auto;
}
.modal[open] { animation: modal-in 0.45s var(--ease); }
.modal::backdrop {
  background: rgba(5, 10, 8, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.modal-body { display: grid; gap: 18px; padding: clamp(24px, 6vw, 36px); }
.modal .eyebrow { color: var(--accent); }
.modal h2 { margin-top: 14px; font-size: 2.1rem; }
.modal-lead { margin-top: 8px; font-size: 0.95rem; color: var(--muted-dark); }
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  background: transparent;
  color: var(--text-dark);
  cursor: pointer;
  transition: border-color 0.25s, background-color 0.25s;
}
.modal-close:hover { border-color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.06); }
.modal-close svg { width: 14px; height: 14px; }

.demo-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 14px;
  padding: 14px 16px;
  border: 1px dashed rgba(201, 242, 108, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(201, 242, 108, 0.05);
}
.demo-box > div { flex: 1 1 180px; min-width: 0; }
.demo-creds { margin-top: 4px; font-size: 0.86rem; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.demo-creds span { display: block; }

/* ==========================================================================
   17. Client portal (portal.html)
   ========================================================================== */
.portal-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--ink);
  color: var(--text-dark);
}
.portal {
  position: relative;
  flex: 1;
  padding: clamp(116px, 13vw, 164px) 0 clamp(56px, 7vw, 96px);
  overflow: hidden;
  overflow: clip;
}
.portal::before {
  content: "";
  position: absolute;
  top: -30vw;
  right: -20vw;
  width: 70vw;
  height: 70vw;
  max-width: 1100px;
  max-height: 1100px;
  background: radial-gradient(closest-side, rgba(201, 242, 108, 0.13), rgba(31, 95, 75, 0.1) 55%, transparent);
  pointer-events: none;
}
.portal .container { position: relative; }
.portal .eyebrow { color: var(--accent); }
.portal h1 { margin-top: 20px; font-size: clamp(2.3rem, 4.8vw, 3.9rem); }
.portal h1 em { color: var(--accent); }
.portal-head { margin-bottom: clamp(32px, 4.5vw, 56px); }
.portal-head .hero-lead { margin-top: 18px; }

.portal-user { display: flex; align-items: center; gap: 22px; }
.portal-back { font-size: 0.9rem; font-weight: 600; color: var(--muted-dark); transition: color 0.25s; }
.portal-back:hover { color: var(--text-dark); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta strong { font-size: 0.88rem; }
.user-meta small { font-size: 0.74rem; color: var(--muted-dark); }
.avatar-sm { width: 38px; height: 38px; font-size: 0.76rem; }

.portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(28px, 4.5vw, 64px);
  align-items: start;
}
.portal-side { display: grid; gap: 18px; }

/* Project reference + days-ahead chips: static, in a row above the progress panel */
.chip-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; }
.chip-static {
  position: static;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: none;
  animation: none;
}

.panel {
  padding: 24px 26px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}
.panel h2 {
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--muted-dark);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.panel-title { margin-top: 10px; font-size: 1.08rem; font-weight: 700; line-height: 1.35; }
.panel-sub { margin-top: 4px; font-size: 0.9rem; color: var(--muted-dark); overflow-wrap: anywhere; }
.panel-sub a { color: var(--accent); }
.panel-next { border-color: rgba(243, 201, 105, 0.3); background: rgba(243, 201, 105, 0.06); }
.panel-next .panel-sub { color: var(--warn); font-weight: 600; }

/* Date picker (staff Project Due Date field) */
input[type="date"] { color-scheme: dark; min-height: 46px; }

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  padding-bottom: 22px;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  top: 30px;
  bottom: 2px;
  left: 13px;
  width: 1.5px;
  background: var(--line-dark);
}
.timeline li:last-child::before { display: none; }
.timeline li.is-done::before { background: rgba(201, 242, 108, 0.45); }
.tl-dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--line-dark);
  border-radius: 50%;
  color: var(--ink);
}
.tl-dot svg { width: 13px; height: 13px; }
.is-done .tl-dot { border-color: var(--accent); background: var(--accent); }
.is-current .tl-dot { border-color: var(--warn); }
.is-current .tl-dot::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warn);
  animation: blink 1.6s ease-in-out infinite;
}
.tl-body { display: flex; flex-direction: column; padding-top: 2px; line-height: 1.4; }
.tl-body strong { font-size: 0.98rem; }
.tl-body small { margin-top: 2px; font-size: 0.82rem; color: var(--muted-dark); }
.is-upcoming .tl-body { opacity: 0.55; }

/* Portal: greeting name, messages and documents */
#welcome-name { font-size: 0.8em; }

.btn-sm { padding: 8px 14px; font-size: 0.8rem; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* Greeting on the left, messages drop-down on the right */
.portal-top { margin-bottom: clamp(28px, 4vw, 48px); }
.portal-top .portal-head { margin-bottom: 0; }
/* Dashboard card with the documents panel underneath, same width */
.portal-main { display: grid; gap: 18px; min-width: 0; }

.msg-panel { padding: 0; }
.msg-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  list-style: none;
  cursor: pointer;
  border-radius: var(--radius);
}
.msg-summary::-webkit-details-marker { display: none; }
.msg-summary-title {
  margin-right: auto;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-dark);
}
.msg-chevron { width: 16px; height: 16px; color: var(--muted-dark); transition: transform 0.35s var(--ease); }
.msg-panel[open] .msg-chevron { transform: rotate(180deg); }
.msg-panel .msg-list { max-height: 170px; margin: 0 24px; }
/* New-message box at the bottom of the panel */
.msg-compose { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 14px 24px 22px; }
.msg-compose textarea {
  flex: 1 1 200px;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text-dark);
  font-size: 1rem; /* 16px avoids iOS zoom-on-focus */
  line-height: 1.45;
  resize: vertical;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.msg-compose textarea::placeholder { color: rgba(157, 173, 164, 0.7); }
.msg-compose textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(201, 242, 108, 0.16); }
.msg-compose .btn { padding: 12px 20px; }
.msg-compose .field-error { flex: 1 1 100%; }
.lead-link { font-size: inherit; color: var(--accent); }
.lead-line { margin-top: 10px; font-size: 1rem; line-height: 1.55; color: var(--muted-dark); }

.msg-list { display: grid; gap: 12px; max-height: 340px; padding-right: 4px; overflow-y: auto; }
.msg {
  max-width: 88%;
  padding: 12px 14px;
  border: 1px solid var(--line-dark);
  border-radius: 14px 14px 14px 4px;
  background: rgba(0, 0, 0, 0.26);
}
.msg-out {
  justify-self: end;
  border-color: rgba(201, 242, 108, 0.28);
  border-radius: 14px 14px 4px 14px;
  background: rgba(201, 242, 108, 0.08);
}
.msg-meta { display: flex; align-items: baseline; gap: 10px; font-size: 0.76rem; color: var(--muted-dark); }
.msg-meta strong { font-size: 0.82rem; color: var(--text-dark); }
.msg-subject { margin-top: 6px; font-size: 0.9rem; font-weight: 700; }
.msg-text { margin-top: 4px; font-size: 0.9rem; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-line; }

.doc-drop {
  padding: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  text-align: center;
  color: var(--muted-dark);
  transition: border-color 0.25s, background-color 0.25s, color 0.25s;
}
.doc-drop.is-over { border-color: var(--accent); background: rgba(201, 242, 108, 0.07); color: var(--text-dark); }
.doc-list { display: grid; margin-top: 8px; }
.doc { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-dark); }
.doc:last-child { border-bottom: 0; }
.doc-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--accent);
}
.doc-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.doc-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
.doc-body strong { font-size: 0.9rem; font-weight: 600; overflow-wrap: anywhere; }
.doc-body small { font-size: 0.76rem; color: var(--muted-dark); }
.doc-status { min-height: 1.4em; margin-top: 6px; font-size: 0.82rem; color: var(--accent); }


/* ---- Real portal + staff area (portal.php, account.php, admin/) ---- */
.portal-user form { display: flex; }
a.user-chip { color: inherit; }

/* Account settings drop-down (click your name) */
.account-menu { position: relative; }
.account-menu > summary { list-style: none; cursor: pointer; border-radius: 999px; padding: 2px 6px 2px 2px; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary:hover .user-meta strong { color: var(--accent); }
.account-menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.account-menu .msg-chevron { width: 14px; height: 14px; color: var(--muted-dark); transition: transform 0.2s; }
.account-menu[open] .msg-chevron { transform: rotate(180deg); }
.account-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 60;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  background: var(--ink-2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.portal-user .account-form { display: grid; gap: 12px; margin-top: 12px; }
.account-form .field { display: grid; gap: 6px; }
.account-form input { padding: 10px 12px; font-size: 0.92rem; }
.account-form input[readonly] { opacity: 0.7; cursor: not-allowed; }
.account-form .field-hint { font-size: 0.74rem; }
.account-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.account-actions .link-btn { font-size: 0.84rem; }
.doc-body a { color: inherit; }
.doc-body { margin-right: auto; }
.doc-download { flex: none; }
.doc-body a:hover strong { color: var(--accent); text-decoration: underline; }
.msg-empty, .doc-empty { font-size: 0.86rem; color: var(--muted-dark); }

/* Requirements (compliance files) in the client portal: an Upload File link
   and the client's files sit under each requirement */
.req-title {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-dark);
  font-family: inherit; /* same as the Project Summary label */
}
.req-list { margin-top: 2px; }
.req-list li { flex-wrap: wrap; row-gap: 8px; }
.req-files { flex-basis: 100%; padding-left: 39px; }
.req-upload {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
}
.req-upload:hover { color: var(--text-dark); }
.req-upload svg { width: 14px; height: 14px; flex: none; }
.req-upload.is-busy { pointer-events: none; opacity: 0.6; }
.check-files { margin-top: 2px; }
.check-files .doc { padding: 8px 0; }
.check-files .doc-icon { width: 28px; height: 28px; }
.check-files .doc-icon svg { width: 14px; height: 14px; }
.check-files .doc-body strong { font-size: 0.84rem; }
.panel-subhead { margin-top: 4px; }
.admin-form-grid .field-wide { grid-column: 1 / -1; width: 100%; }
.admin-subhead { margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line-dark); }
.field textarea[name="check_areas"] { min-height: 0; }
.panel-danger { border-color: rgba(255, 157, 138, 0.3); }
.btn-danger { border: 1px solid rgba(255, 157, 138, 0.5); background: transparent; color: #ffb3a4; }
.btn-danger:hover { background: rgba(255, 157, 138, 0.12); color: #ffd0c6; }
/* Project details shown to the client in Project Summary */
.dash-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin-top: 18px; }
.dash-facts div { min-width: 0; }
.dash-facts dt { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-dark); }
.dash-facts dd { margin: 3px 0 0; font-size: 0.86rem; line-height: 1.45; overflow-wrap: anywhere; }
@media (max-width: 640px) { .dash-facts { grid-template-columns: minmax(0, 1fr); } }
/* Service progress sits in the narrower right column on the staff page:
   stage name on its own line, note and state underneath */
.panel-stages .admin-row-stage { grid-template-columns: minmax(0, 1fr) 128px; row-gap: 6px; }
.panel-stages .admin-row-stage strong { grid-column: 1 / -1; font-size: 0.9rem; }
.check-files-staff .doc-list { margin-top: 2px; }
.check-files-staff .doc { flex-wrap: wrap; }
.doc-remove { flex: none; }
.admin-form .check-files { width: 100%; margin-top: -6px; padding-left: 14px; border-left: 2px solid var(--line-dark); }

.flash {
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid rgba(201, 242, 108, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(201, 242, 108, 0.08);
  font-size: 0.92rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.flash-error { border-color: rgba(255, 157, 138, 0.45); background: rgba(255, 157, 138, 0.08); color: #ffb3a4; }

.admin-title { margin-top: 16px; font-size: clamp(2rem, 3.6vw, 2.9rem); }
/* Project title on the staff project page: 30% smaller than other staff page titles */
.admin-title.project-title { font-size: clamp(1.4rem, 2.52vw, 2.03rem); }
.admin-title + .hero-lead { margin-top: 10px; margin-bottom: 26px; }
.admin-narrow { max-width: 560px; }
.admin-narrow .hero-lead, .admin-narrow .flash { margin-top: 14px; }
.admin-narrow .panel { margin-top: 24px; }
.admin-block { margin-top: 22px; }
.admin-grid { margin-top: 8px; }
.portal .eyebrow a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.panel > h2 + .admin-form, .panel > h2 + .panel-sub { margin-top: 16px; }
.admin-form { display: grid; gap: 14px; justify-items: start; }
.admin-form .field, .admin-form .admin-row { width: 100%; }
.admin-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.field-action { align-self: end; }
.admin-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 140px; gap: 10px; align-items: center; }
.admin-row-stage { grid-template-columns: 84px minmax(0, 1fr) 140px; }
.admin-row input, .admin-row select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text-dark);
  font-size: 0.94rem;
}
.admin-row select option { background: var(--ink-2); }
.admin-row input:focus, .admin-row select:focus { outline: none; border-color: var(--accent); }

.form-send-error { text-align: center; }
.enquiry.is-read { opacity: 0.72; }
.enquiry .panel-head { margin-bottom: 4px; }
.enquiry-check {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(201, 242, 108, 0.25);
  border-radius: var(--radius-sm);
  background: rgba(201, 242, 108, 0.05);
  font-size: 0.86rem;
  line-height: 1.6;
}
.enquiry-message { margin-top: 14px; font-size: 0.95rem; line-height: 1.6; overflow-wrap: anywhere; }
.enquiry-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.enquiry-reply { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-dark); }
.enquiry-reply .field { width: 100%; }
.enquiry-reply .enquiry-actions { margin-top: 0; }
.enquiry-replies { display: grid; gap: 12px; margin-top: 16px; }
.enquiry-replies li { padding: 12px 14px; border-left: 2px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: rgba(201, 242, 108, 0.05); }
.enquiry-reply-subject { margin-top: 4px; font-size: 0.86rem; font-weight: 700; }
.enquiry-replies .msg-text { margin-top: 4px; font-size: 0.9rem; line-height: 1.55; overflow-wrap: anywhere; }

.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.admin-table th {
  padding: 0 14px 12px 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
  color: var(--muted-dark);
  white-space: nowrap;
}
.admin-table td { padding: 14px 14px 14px 0; border-top: 1px solid var(--line-dark); vertical-align: middle; }
.admin-table td small { display: block; font-size: 0.78rem; color: var(--muted-dark); }

@media (max-width: 640px) {
  .admin-form-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-row, .admin-row-stage { grid-template-columns: minmax(0, 1fr); }
}

.portal-note { margin-top: clamp(28px, 4vw, 44px); font-size: 0.84rem; color: var(--muted-dark); }
.portal-footer { padding-top: 0; }

@keyframes pop { from { opacity: 0; transform: scale(0.7); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(0.98); } }
@keyframes blink { 50% { opacity: 0.35; } }

/* Responsive rules for sections 15–17 */
@media (max-width: 920px) {
  .nav-actions { flex-direction: column; align-items: stretch; }
  .nav-actions .btn { padding: 18px 28px; font-size: 1rem; }

  .portal-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  /* Long product names get the full width; the status pill drops underneath */
  .checker-result .dash-head { flex-direction: column; gap: 10px; }
  .quote-summary-list { grid-template-columns: minmax(0, 1fr); }
  .portal-back, .user-meta { display: none; }
  .account-panel { position: fixed; top: 70px; right: 16px; left: 16px; width: auto; }
  .portal-user { gap: 12px; }
  .panel { padding: 22px 20px; }
}
