/* ============================================================
   Vehicle Assessment showcase page (report.html)
   Load AFTER style.css - it reuses the same colours, buttons,
   header, hero and footer. Only new components are defined here
   (all new class names start with "rp-").
   ============================================================ */

:root {
  /* Grading colours (same family as the report PDF) */
  --g-critical: #c0392b;
  --g-bad: #e08e45;
  --g-poor: #e0b400;
  --g-good: #8db53f;
  --g-excellent: #2ca05a;
  --g-na: #9aa5b4;
}

/* Report tabs in the nav bar */
.main-nav .nav-tab {
  padding: .4rem .9rem;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  font-weight: 600;
  transition: background-color .2s, color .2s;
}
.main-nav .nav-tab:hover {
  background: var(--primary);
  color: #fff;
}
.main-nav { gap: 1.25rem; } 

/* ---------- Header: logo + Call + Chat, visible on every screen ---------- */
.rp-header .header-actions { display: flex; gap: .5rem; }
.rp-header .btn svg { width: 1rem; height: 1rem; }
@media (max-width: 480px) {
  .rp-header .btn-label { display: none; }
  .rp-header .btn-sm { width: 2.5rem; padding: 0; }
  .rp-header .btn svg { width: 1.1rem; height: 1.1rem; }
}

/* ---------- Hero (shorter than the main site hero) ---------- */
.rp-hero { min-height: auto; padding-block: 2rem; }
.rp-hero .pill { margin-bottom: 0; }

/* ---------- Stats strip ---------- */
.rp-stats-wrap { padding-block: 1.5rem 1rem; }
.rp-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 64rem;
  margin-inline: auto;
}
.rp-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  text-align: center;
}
.rp-stat strong { display: block; font-size: 2rem; font-weight: 700; line-height: 1.1; color: var(--primary); }
.rp-stat span { color: var(--muted-foreground); font-size: .9rem; }
@media (min-width: 768px) { .rp-stats { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Section headings ---------- */
.rp-head { max-width: 46rem; margin-bottom: 2.5rem; }
.rp-head.rp-center { text-align: center; margin-inline: auto; }
.rp-head.rp-center h2 { justify-content: center; }
.rp-letter {
  display: inline-flex;
  align-items: center;
  padding: .35rem .9rem;
  margin-bottom: 1rem;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.rp-head h2 {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
  font-weight: 700;
  line-height: 1.25;
}
.rp-emoji {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  height: 2.75rem;
  padding-inline: .5rem;
  background: var(--primary-soft);
  border-radius: var(--radius);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary);
}
.rp-lead { font-size: 1.1rem; line-height: 1.7; color: var(--muted-foreground); }

/* ---------- Language switch (EN | AR) ---------- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  height: 2.25rem;
  padding: .2rem;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.lang-opt {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 .65rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted-foreground);
  transition: background-color .2s, color .2s;
}
.lang-opt:hover { color: var(--primary); }
.lang-opt.active { background: var(--primary); color: #fff; }
@media (max-width: 480px) { .lang-opt { padding: 0 .45rem; } }

/* ---------- Index cards ---------- */
.rp-index { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px)  { .rp-index { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .rp-index { grid-template-columns: repeat(3, 1fr); } }
.rp-index-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: border-color .3s, box-shadow .3s, transform .3s;
}
.rp-index-card:hover {
  border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.rp-index-wide { grid-column: 1 / -1; }
.rp-index-card h3 { font-size: 1.05rem; font-weight: 700; line-height: 1.3; margin-bottom: .25rem; }
.rp-index-card p { font-size: .9rem; line-height: 1.5; color: var(--muted-foreground); }
.rp-index-card .rp-kicker { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin-bottom: .2rem; }
.rp-index-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.rp-subs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; padding: 0; list-style: none; }
.rp-subs a {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .75rem;
  background: var(--accent);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 500;
  transition: background-color .2s, color .2s, border-color .2s;
}
.rp-subs a:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Generic cards & fact grids ---------- */
.rp-facts { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px)  { .rp-facts { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .rp-facts.cols-4 { grid-template-columns: repeat(4, 1fr); } }
.rp-fact {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem 1.25rem;
  transition: transform .3s, box-shadow .3s;
}
.rp-fact:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.rp-fact h3 { font-size: 1rem; font-weight: 600; margin-bottom: .3rem; }
.rp-fact p { font-size: .92rem; line-height: 1.55; color: var(--muted-foreground); }
.rp-foot { margin-top: 1.5rem; color: var(--muted-foreground); font-size: .95rem; line-height: 1.6; }

.rp-split { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 1024px) { .rp-split { grid-template-columns: 1.3fr 1fr; gap: 3rem; } }
.rp-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.rp-panel h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; }
.rp-panel p { color: var(--muted-foreground); line-height: 1.6; }

.rp-tag {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 999px;
  background: var(--accent);
  border: 1px solid var(--border);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

/* ---------- Section C: score weights ---------- */
.rp-bar { display: grid; grid-template-columns: 1fr auto; gap: .35rem .75rem; margin-bottom: 1rem; font-size: .95rem; }
.rp-bar span { font-weight: 500; }
.rp-bar b { color: var(--primary); }
.rp-track { grid-column: 1 / -1; height: .65rem; border-radius: 999px; background: var(--muted); overflow: hidden; }
.rp-track i { display: block; height: 100%; width: var(--w); border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--secondary)); }
.rp-total-line { display: flex; justify-content: space-between; margin-top: 1.25rem; padding-top: 1rem; border-top: 2px solid var(--border); font-weight: 700; }
.rp-verdict { text-align: center; border-radius: var(--radius-lg); padding: 1.75rem 1rem; background: var(--g-good); color: #fff; margin-bottom: 1rem; }
.rp-verdict strong { display: block; font-size: 2.2rem; line-height: 1.1; }
.rp-verdict small { display: block; margin-top: .35rem; font-size: .9rem; font-weight: 600; opacity: .95; }

/* ---------- Section D: chart ---------- */
.rp-chart { width: 100%; height: auto; display: block; }
.rp-chart .grid { stroke: var(--border); stroke-width: 1; }
.rp-chart .line { fill: none; stroke: var(--foreground); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.rp-chart .dot { fill: var(--foreground); }
.rp-chart text { font-size: 12px; fill: var(--muted-foreground); font-family: inherit; }

/* ---------- Section E: sub-section cards ---------- */
.rp-subgrid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 768px) {
  .rp-subgrid { grid-template-columns: repeat(2, 1fr); }
  .rp-subgrid .rp-sub:last-child { grid-column: 1 / -1; }
}
.rp-sub {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  transition: transform .3s, box-shadow .3s;
}
.rp-sub:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.rp-sub-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.rp-sub-head .rp-emoji { height: 2.5rem; min-width: 2.5rem; }
.rp-sub-head h3 { flex: 1; font-size: 1.1rem; font-weight: 600; line-height: 1.35; }
.rp-pts { flex-shrink: 0; padding: .2rem .7rem; background: var(--primary); color: #fff; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.rp-sub > p { margin-bottom: 1rem; color: var(--muted-foreground); line-height: 1.6; }
.rp-checks { display: grid; gap: .5rem; padding: 0; list-style: none; }
.rp-checks li { position: relative; padding-inline-start: 1.4rem; font-size: .95rem; line-height: 1.5; }
.rp-checks li::before { content: ""; position: absolute; inset-inline-start: 0; top: .5rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--primary); }

/* ---------- Section F: photo tiles ---------- */
.rp-photos { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .rp-photos { grid-template-columns: repeat(3, 1fr); } }
.rp-photo {
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 1rem;
  text-align: center;
  background: linear-gradient(135deg, #aebcc4, #c5d0d6);
  border-radius: var(--radius-lg);
  color: var(--foreground);
}
.rp-photo svg { width: 2.75rem; height: 2.75rem; }
.rp-photo span { font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.rp-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* ---------- Section G: severity cards ---------- */
.rp-sevs { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .rp-sevs { grid-template-columns: repeat(3, 1fr); } }
.rp-sev {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 6px solid var(--c);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem 1.5rem;
}
.rp-sev h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: .25rem; }
.rp-sev > p { font-size: .9rem; color: var(--muted-foreground); margin-bottom: 1rem; }
.rp-sev dl { margin: 0; }
.rp-sev dt { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-foreground); }
.rp-sev dd { margin: 0 0 .8rem; line-height: 1.5; }
.rp-sev dd:last-child { margin-bottom: 0; }

/* ---------- Chips + grade colours ---------- */
.rp-chip { display: inline-block; padding: .2rem .7rem; border-radius: var(--radius-sm); background: var(--c); color: #fff; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.g-critical { --c: var(--g-critical); }
.g-bad      { --c: var(--g-bad); }
.g-poor     { --c: var(--g-poor); }
.g-poor.rp-chip { color: #3d2f00; }
.g-good     { --c: var(--g-good); }
.g-excellent{ --c: var(--g-excellent); }
.g-na       { --c: var(--g-na); }

/* ---------- Section H: cost table ---------- */
.rp-table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.rp-table { width: 100%; min-width: 36rem; border-collapse: collapse; font-size: .95rem; }
.rp-table th { background: var(--foreground); color: #fff; text-align: start; padding: .75rem 1rem; font-size: .85rem; }
.rp-table td { padding: .85rem 1rem; border-top: 1px solid var(--border); vertical-align: top; }
.rp-total {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  margin-top: 1.25rem;
  padding: 1.1rem 1.5rem;
  background: var(--foreground);
  color: #fff;
  border-radius: var(--radius-lg);
  font-size: 1.05rem;
  font-weight: 700;
}

/* ---------- Section I: notes ---------- */
.rp-note { padding: 1.1rem 1.25rem; background: var(--muted); border-inline-start: 4px solid var(--primary); border-radius: var(--radius-sm); line-height: 1.65; color: #3d4a5c; }
.rp-note + .rp-note { margin-top: 1rem; }
.rp-note strong { color: var(--foreground); }

/* ---------- Section J: grading scales ---------- */
.rp-scales { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .rp-scales { grid-template-columns: repeat(2, 1fr); } }
.rp-scale { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.rp-scale h3 { padding: .8rem 1.1rem; background: var(--foreground); color: #fff; font-size: 1rem; font-weight: 600; }
.rp-scale ul { margin: 0; padding: 0; list-style: none; }
.rp-scale li { display: grid; grid-template-columns: 8.5rem 1fr; gap: .75rem; align-items: center; padding: .7rem 1.1rem; border-top: 1px solid var(--border); font-size: .92rem; line-height: 1.45; }
.rp-scale li:first-child { border-top: none; }
@media (max-width: 420px) { .rp-scale li { grid-template-columns: 1fr; gap: .35rem; } }

/* ---------- Section K: glossary ---------- */
.rp-terms { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .rp-terms { grid-template-columns: repeat(2, 1fr); } }
.rp-term { background: var(--card); border: 1px solid var(--border); border-inline-start: 4px solid var(--primary); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.1rem 1.25rem; }
.rp-term h3 { font-size: 1rem; font-weight: 700; margin-bottom: .35rem; }
.rp-term h3 span { color: var(--primary); font-weight: 600; margin-inline-end: .35rem; }
.rp-term p { font-size: .93rem; line-height: 1.6; color: var(--muted-foreground); }

/* ---------- Closing call-to-action ---------- */
.rp-cta {
  position: relative;
  overflow: hidden;
  padding-block: 4.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  text-align: center;
}
.rp-cta h2 { margin-bottom: 1rem; font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 700; line-height: 1.25; }
.rp-cta p { max-width: 40rem; margin: 0 auto 2rem; line-height: 1.6; color: rgba(255, 255, 255, .92); }
.rp-cta .hero-buttons { justify-content: center; }
.btn-light { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.btn-light:hover { background: var(--primary-soft); box-shadow: var(--shadow); }
.rp-cta .btn-outline { color: #fff; border-color: #fff; }
.rp-cta .btn-outline:hover { background: #fff; color: var(--primary); }

/* ---------- Footer: two columns on this page ---------- */
@media (min-width: 1024px) { .rp-footer .footer-grid { grid-template-columns: 2fr 1fr; } }


/* ============================================================
   ANIMATIONS - switched on by report.js (it adds .rp-js to <html>)
   Without JavaScript, or with "reduce motion" enabled, none of the
   hidden states below apply and the page just shows normally.
   ============================================================ */

@keyframes rpUp    { from { opacity: 0; transform: translateY(30px); }  to { opacity: 1; transform: none; } }
@keyframes rpSlide { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes rpZoom  { from { opacity: 0; transform: scale(.85); }        to { opacity: 1; transform: none; } }
@keyframes rpPop   { 0% { opacity: 0; transform: scale(.3) rotate(-12deg); } 60% { opacity: 1; transform: scale(1.15) rotate(4deg); } 100% { opacity: 1; transform: none; } }
@keyframes rpFlash { from { opacity: .85; } to { opacity: 0; } }
@keyframes rpShine { 0%, 55% { left: -60%; } 100% { left: 130%; } }

/* ---- hidden until revealed ---- */
.rp-js :is(.rp-head, .rp-index-card, .rp-fact, .rp-panel, .rp-sub, .rp-sev, .rp-scale, .rp-term, .rp-note,
           .rp-table-wrap, .rp-total, .rp-foot, .rp-bar, .rp-total-line, .rp-chart,
           .rp-cta h2, .rp-cta p, .rp-cta .hero-buttons,
           .rp-stat, .rp-photo, .rp-verdict, .rp-subs li,
           .rp-checks li, .rp-scale li, .rp-table tbody tr) { opacity: 0; }

/* ---- reveal: slide up ---- */
.rp-js :is(.rp-head, .rp-index-card, .rp-fact, .rp-panel, .rp-sub, .rp-sev, .rp-scale, .rp-term, .rp-note,
           .rp-table-wrap, .rp-total, .rp-foot, .rp-bar, .rp-total-line, .rp-chart,
           .rp-cta h2, .rp-cta p, .rp-cta .hero-buttons).rp-in {
  opacity: 1;
  animation: rpUp .8s cubic-bezier(.2, .7, .2, 1) var(--d, 0s) backwards;
}
/* ---- reveal: zoom ---- */
.rp-js :is(.rp-stat, .rp-photo, .rp-verdict, .rp-subs li).rp-in {
  opacity: 1;
  animation: rpZoom .7s cubic-bezier(.2, .8, .2, 1.1) var(--d, 0s) backwards;
}
/* ---- reveal: slide in from the side ---- */
.rp-js :is(.rp-checks li, .rp-scale li, .rp-table tbody tr).rp-in {
  opacity: 1;
  animation: rpSlide .6s cubic-bezier(.2, .7, .2, 1) var(--d, 0s) backwards;
}

/* ---- section heading: icon pops in ---- */
.rp-js .rp-head.rp-in .rp-emoji { animation: rpPop .8s cubic-bezier(.3, 1.4, .5, 1) calc(var(--d, 0s) + .25s) backwards; }

/* ---- score bars fill up (Section C) ---- */
.rp-js .rp-track i { width: 0; }
.rp-js .rp-bar.rp-in .rp-track i {
  width: var(--w);
  transition: width 1.5s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0s) + .25s);
}

/* ---- verdict badge: pop + a shine that sweeps across ---- */
.rp-verdict { position: relative; overflow: hidden; }
.rp-verdict::after {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent);
  transform: skewX(-20deg);
  animation: rpShine 4.5s ease-in-out 1.5s infinite;
  pointer-events: none;
}
.rp-js .rp-verdict.rp-in strong { animation: rpPop .9s cubic-bezier(.3, 1.5, .5, 1) calc(var(--d, 0s) + .3s) backwards; }

/* ---- depreciation chart: the line draws itself, dots pop in ---- */
.rp-js .rp-chart .line {
  stroke-dasharray: var(--len, 1000);
  stroke-dashoffset: var(--len, 1000);
}
.rp-js .rp-chart.rp-in .line {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.8s cubic-bezier(.4, 0, .2, 1) .3s;
}
.rp-js .rp-chart .dot {
  opacity: 0;
  transform: scale(0);
  transform-box: fill-box;
  transform-origin: center;
}
.rp-js .rp-chart.rp-in .dot {
  opacity: 1;
  transform: scale(1);
  transition: opacity .3s, transform .5s cubic-bezier(.3, 1.6, .5, 1);
}
.rp-js .rp-chart.rp-in .dot:nth-of-type(1) { transition-delay: .3s; }
.rp-js .rp-chart.rp-in .dot:nth-of-type(2) { transition-delay: .8s; }
.rp-js .rp-chart.rp-in .dot:nth-of-type(3) { transition-delay: 1.3s; }
.rp-js .rp-chart.rp-in .dot:nth-of-type(4) { transition-delay: 1.9s; }

/* ---- photo tiles: a camera "flash" when they appear ---- */
.rp-photo { position: relative; overflow: hidden; }
.rp-photo::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.rp-js .rp-photo.rp-in::after { animation: rpFlash .7s ease-out calc(var(--d, 0s) + .5s); }
.rp-photo svg { transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.rp-photo:hover svg { transform: scale(1.18) rotate(-6deg); }

/* ---- cursor glow on cards (position is set by report.js) ---- */
.rp-index-card, .rp-fact, .rp-sub { isolation: isolate; }
.rp-fact, .rp-sub { position: relative; }
.rp-index-card::before, .rp-fact::before, .rp-sub::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(232, 89, 12, .13), transparent 65%);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.rp-index-card:hover::before, .rp-fact:hover::before, .rp-sub:hover::before { opacity: 1; }

/* ---- hero photo tilt ---- */
.rp-tilt { transition: transform .25s ease-out; will-change: transform; }

/* ---- header gets a soft shadow once the page scrolls ---- */
.rp-header { transition: box-shadow .3s; }
.rp-header.rp-scrolled { box-shadow: 0 6px 24px -10px rgba(16, 24, 40, .3); }

/* ---- reading progress bar ---- */
.rp-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; }
.rp-progress i {
  display: block;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

/* ---- section rail A-K (wide screens only) ---- */
.rp-rail {
  display: none;
  position: fixed;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  flex-direction: column;
  gap: .45rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s;
}
.rp-rail.rp-show { opacity: 1; pointer-events: auto; }
@media (min-width: 1280px) {
  .rp-rail { display: flex; }
  .rp-has-rail main .container-wide { padding-right: 4.25rem; }   /* keep the rail clear of the content */
}
.rp-rail a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted-foreground);
  transition: background-color .25s, color .25s, border-color .25s, transform .25s;
}
.rp-rail a:hover, .rp-rail a.rp-active { background: var(--primary); border-color: var(--primary); color: #fff; transform: scale(1.15); }
.rp-rail a::after {
  content: attr(data-tip);
  position: absolute;
  right: calc(100% + .6rem);
  top: 50%;
  transform: translate(6px, -50%);
  padding: .3rem .65rem;
  background: var(--foreground);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: .78rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.rp-rail a:hover::after { opacity: 1; transform: translate(0, -50%); }

/* ---- back-to-top button ---- */
.rp-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .3s, transform .3s, background-color .2s;
}
.rp-top.rp-show { opacity: 1; transform: none; pointer-events: auto; }
.rp-top:hover { background: var(--primary-hover); }

/* ---------- Picture slot (Section C & D), same look as the hero picture ---------- */
.rp-img-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  aspect-ratio: 3 / 2;
  background: linear-gradient(135deg, var(--primary-soft), var(--secondary-soft));
}
.rp-img-wrap img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Active page in the nav ---------- */
.main-nav .nav-tab.active,
.main-nav .nav-tab[aria-current="page"] {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
/* ---------- Home: "what brings you here" flow ---------- */
.rp-flow { padding-block: 3rem 4.5rem; }

/* black question box (also uses .rp-total for its dark look + reveal animation) */
.rp-q { display: block; position: relative; max-width: 36rem; margin: 0 auto 3.25rem; padding: 1.25rem 1.75rem; text-align: center; }
.rp-q h2 { font-size: clamp(1.2rem, 2.6vw, 1.6rem); line-height: 1.3; }
.rp-q p { margin-top: .35rem; font-size: 1rem; font-weight: 500; color: rgba(255, 255, 255, .78); }

.rp-branches { --g: 2rem; position: relative; display: grid; gap: 2.5rem var(--g); grid-template-columns: 1fr; }

/* two cards + connector lines with arrows (desktop) */
@media (min-width: 768px) {
  .rp-branches { grid-template-columns: 1fr 1fr; align-items: start; }
  .rp-q::after { content: ""; position: absolute; left: calc(50% - 1.5px); top: 100%; width: 3px; height: 1.6rem; background: #aebcc4; }
  .rp-branches::before { content: ""; position: absolute; top: -1.65rem; left: calc(25% - var(--g) / 4); right: calc(25% - var(--g) / 4); height: 3px; background: #aebcc4; }
  .rp-branch::before { content: ""; position: absolute; left: calc(50% - 1.5px); top: -1.65rem; width: 3px; height: 1.65rem; background: #aebcc4; }
  .rp-branch::after { content: ""; position: absolute; left: calc(50% - 7px); top: -.55rem; border: 7px solid transparent; border-top: 9px solid #aebcc4; border-bottom: 0; }
}

.rp-branch { position: relative; padding: 1.5rem; box-shadow: none; }
.rp-branch.is-plan   { background: #eaeef2; }
.rp-branch.is-urgent { background: #fde3da; }
.rp-branch-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem; }
.rp-branch-head h3 { margin: 0 0 .25rem; font-size: 1.35rem; }
.rp-branch-head p { margin: 0; font-size: .98rem; }

/* service rows (reuse .rp-index-card: whole row is clickable + hover glow) */
.rp-svcs { display: grid; gap: .75rem; }
.rp-svc { align-items: center; gap: .9rem; padding: .8rem 1rem; border: 0; border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.rp-svc h3 { margin: 0; font-size: 1.05rem; }
.rp-svc .rp-emoji { width: 2.75rem; min-width: 2.75rem; height: 2.75rem; padding: 0; border-radius: 50%; background: var(--foreground); color: #fff; }
.is-urgent .rp-svc .rp-emoji { background: var(--primary); }
.rp-emoji .ic { width: 1.3rem; height: 1.3rem; }

/* 5 nav tabs: keep the header from overflowing between 1024px and 1199px */
@media (min-width: 1024px) and (max-width: 1199px) {
  .main-nav { gap: .5rem; margin-inline-start: 1rem; }
  .main-nav .nav-tab { padding: .35rem .65rem; font-size: .8rem; }
  .rp-header .btn-label { display: none; }
  .rp-header .btn-sm { width: 2.5rem; padding: 0; }
  .rp-header .btn-sm svg { width: 1.1rem; height: 1.1rem; }
}
/* ---------- How to book: steps ---------- */
.rp-steps { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); margin: 0 0 1.5rem; padding: 0; list-style: none; counter-reset: none; }
.rp-step { position: relative; padding: 1.4rem 1.25rem 1.25rem; text-align: left; }
.rp-step .rp-emoji { width: 3rem; height: 3rem; margin-bottom: .9rem; border-radius: 50%; background: var(--foreground); color: #fff; }
.rp-step:nth-child(2) .rp-emoji { background: var(--g-excellent); }   /* WhatsApp step is green */
.rp-step h3 { font-size: 1.05rem; }
.rp-num {
  position: absolute; top: .9rem; right: .9rem;
  display: flex; align-items: center; justify-content: center;
  width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: .8rem; font-weight: 700;
}
.rp-emoji .ic, .rp-why .ic { width: 1.3rem; height: 1.3rem; }

/* arrow between steps (wide screens) */
@media (min-width: 1100px) {
  .rp-step:not(:last-child)::after {
    content: ""; position: absolute; top: 2.9rem; right: -1.25rem; width: 1.25rem; height: 2px;
    background: repeating-linear-gradient(90deg, #aebcc4 0 5px, transparent 5px 9px);
  }
}

.rp-skip { max-width: 46rem; margin: 0 auto 2.5rem; text-align: center; border-inline-start: 0; border-top: 4px solid var(--primary); }

/* ---------- WhatsApp example ---------- */
.rp-howto { align-items: stretch; }
.rp-phone { padding: 0; overflow: hidden; max-width: 34rem; width: 100%; margin-inline: auto; }
.rp-wa-bar { display: flex; align-items: center; gap: .75rem; padding: .8rem 1.1rem; background: var(--g-excellent); color: #fff; }
.rp-wa-bar img { border-radius: 50%; background: #fff; }
.rp-wa-bar div { flex: 1; line-height: 1.2; }
.rp-wa-bar b { display: block; font-size: 1rem; }
.rp-wa-bar small { font-size: .78rem; opacity: .9; }
.rp-wa-bar .rp-tag { background: rgba(255,255,255,.2); border-color: transparent; color: #fff; }
.rp-wa-body { display: flex; flex-direction: column; gap: .9rem; padding: 1.25rem 1rem 1.5rem; background: #efeae2; min-height: 21rem; }

.rp-msg { display: flex; align-items: center; gap: .6rem; }
.rp-msg.rp-out { justify-content: flex-end; }
.rp-msg.rp-sys { justify-content: center; }
.rp-bubble { max-width: 82%; padding: .6rem .85rem .35rem; border-radius: .9rem; background: #fff; box-shadow: 0 1px 1px rgba(16,24,40,.12); font-size: .92rem; line-height: 1.45; display: flex; flex-direction: column; gap: .15rem; }
.rp-out .rp-bubble { background: #d9fdd3; border-top-right-radius: .2rem; }
.rp-in  .rp-bubble { border-top-left-radius: .2rem; }
.rp-bubble span { color: var(--muted-foreground); }
.rp-bubble strong { color: var(--foreground); }
.rp-bubble em { align-self: flex-end; font-size: .7rem; font-style: normal; color: #8696a0; }
.rp-file { flex-direction: row; align-items: center; gap: .7rem; padding-bottom: .6rem; }
.rp-file .ic { flex-shrink: 0; width: 2.2rem; height: 2.2rem; padding: .35rem; border-radius: .5rem; background: #fde3da; color: var(--primary); }
.rp-file span { display: flex; flex-direction: column; font-size: .88rem; word-break: break-word; }
.rp-file small { font-size: .74rem; }
.rp-chip-sys { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .8rem .3rem .35rem; background: rgba(255,255,255,.75); border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--muted-foreground); }
.rp-badge { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--primary); color: #fff; font-size: .75rem; font-weight: 700; }

/* messages appear one after another when the chat scrolls into view */
.rp-js .rp-phone .rp-msg { opacity: 0; }
.rp-js .rp-phone.rp-in .rp-msg { animation: rpUp .6s cubic-bezier(.2,.7,.2,1) calc(var(--i) * .8s + .5s) both; }

/* ---------- Why one thread works ---------- */
.rp-why { display: grid; gap: 1rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.rp-why li { display: flex; gap: .75rem; align-items: flex-start; line-height: 1.55; color: var(--muted-foreground); }
.rp-why .ic { flex-shrink: 0; margin-top: .1rem; padding: .25rem; border-radius: 50%; background: var(--g-excellent); color: #fff; }

/* ============================================================
   RESPONSIVE ADDITIONS — phones & tablets
   (added during reorganization; layout safety only)
   ============================================================ */
@media (max-width: 1023px) {
  .rp-rail, .rp-progress { display: none !important; }
  .rp-table-wrap { -webkit-overflow-scrolling: touch; }
  .rp-steps { grid-template-columns: 1fr; }
  .rp-step:not(:last-child)::after { display: none; }
  .rp-branch-head .btn { width: 100%; }
}
@media (max-width: 640px) {
  .rp-q { padding: 1rem 1.25rem; margin-bottom: 2.5rem; }
  .rp-wa-body { min-height: auto; }
  .rp-stat strong { font-size: 1.6rem; }
  .rp-table { min-width: 34rem; }
  .rp-meta div { flex-direction: column; gap: .1rem; }
  .rp-meta span { text-align: start; }
}
