/* Solution Roofing — conversion components (round 2)
   Loaded after site.css. Adds: inline forms, sticky bar enhancements,
   exit-intent, before/after slider, multi-step, three-route chooser,
   tool funnel breadcrumb, scroll-depth CTAs, lead magnet modal.
*/

/* === Inline 3-field quote form (hero, CTA bands) === */
.cv-form {
  display: grid;
  grid-template-columns: 2fr 1.4fr 1.2fr auto;
  gap: 8px;
  background: var(--sr-white);
  border: 1px solid var(--sr-border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 24px 60px -30px rgba(0,29,33,0.35);
  max-width: 720px;
}
.cv-form .field {
  display: flex; flex-direction: column;
  padding: 6px 14px;
  border-radius: 10px;
  background: var(--sr-white);
  transition: background 150ms ease;
}
.cv-form .field:focus-within { background: var(--sr-blue-soft); }
.cv-form label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--sr-meta);
}
.cv-form input {
  border: 0;
  padding: 4px 0;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: var(--sr-text);
  outline: none;
  width: 100%;
}
.cv-form input::placeholder { color: rgba(112,115,122,0.55); font-weight: 500; }
.cv-form button {
  background: var(--sr-blue);
  color: var(--sr-white);
  border-radius: 10px;
  padding: 0 22px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background 150ms ease, transform 150ms ease;
}
.cv-form button:hover { background: var(--sr-blue-hover); }
.cv-form button:active { transform: scale(0.98); }
.cv-form button svg { width: 14px; height: 14px; }

.cv-form.dark { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); }
.cv-form.dark .field { background: transparent; }
.cv-form.dark .field:focus-within { background: rgba(255,255,255,0.08); }
.cv-form.dark label { color: rgba(255,255,255,0.55); }
.cv-form.dark input { color: var(--sr-white); }
.cv-form.dark input::placeholder { color: rgba(255,255,255,0.4); }

.cv-trust-pill {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px 18px;
  margin-top: 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sr-meta);
}
.cv-trust-pill .star { color: #FBBC05; }
.cv-trust-pill .dot { width: 3px; height: 3px; background: var(--sr-border); border-radius: 50%; }
.cv-trust-pill.dark { color: rgba(255,255,255,0.7); }
.cv-trust-pill.dark .dot { background: rgba(255,255,255,0.2); }

@media (max-width: 640px) {
  .cv-form { grid-template-columns: 1fr; }
  .cv-form button { padding: 14px; justify-content: center; }
}

/* === Three-route chooser === */
.cv-chooser {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.cv-route {
  position: relative;
  display: block;
  border: 1px solid var(--sr-border);
  border-radius: 16px;
  padding: 32px 28px;
  background: var(--sr-white);
  transition: transform 200ms var(--ease-out), border-color 200ms ease, box-shadow 200ms ease;
  overflow: hidden;
}
.cv-route::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--sr-blue-soft) 0%, transparent 60%);
  opacity: 0; transition: opacity 250ms ease;
}
.cv-route:hover { transform: translateY(-4px); border-color: var(--sr-blue); box-shadow: 0 20px 40px -24px rgba(48,150,219,0.45); }
.cv-route:hover::before { opacity: 1; }
.cv-route > * { position: relative; }
.cv-route .num {
  font-size: 12px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--sr-blue); text-transform: uppercase;
  margin-bottom: 24px;
  display: flex; justify-content: space-between;
}
.cv-route .num .cost {
  font-size: 10px;
  color: var(--sr-meta);
  font-weight: 600;
}
.cv-route h3 { font-size: 26px; line-height: 1.1; margin-bottom: 12px; letter-spacing: -0.02em; }
.cv-route p { font-size: 14px; color: var(--sr-meta); line-height: 1.55; margin-bottom: 24px; }
.cv-route .arrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--sr-blue);
}
.cv-route.primary { background: var(--sr-dark); color: var(--sr-white); border-color: var(--sr-dark); }
.cv-route.primary h3 { color: var(--sr-white); }
.cv-route.primary p { color: rgba(255,255,255,0.65); }
.cv-route.primary .num { color: var(--sr-blue); }
.cv-route.primary .num .cost { color: rgba(255,255,255,0.5); }
.cv-route.primary::before { display: none; }

@media (max-width: 900px) { .cv-chooser { grid-template-columns: 1fr; } }

/* === Before/after slider === */
.cv-baslider {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  user-select: none;
  cursor: ew-resize;
  background: #000;
}
.cv-baslider .img { position: absolute; inset: 0; }
.cv-baslider .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cv-baslider .img.after { clip-path: inset(0 0 0 50%); transition: clip-path 80ms linear; }
.cv-baslider .label {
  position: absolute; top: 18px;
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 6px 12px; border-radius: 6px;
  background: rgba(0,0,0,0.55); color: white; backdrop-filter: blur(8px);
  transition: opacity 120ms linear;
}
.cv-baslider .label.is-hidden { opacity: 0; pointer-events: none; }
.cv-baslider .label.before { left: 18px; }
.cv-baslider .label.after { right: 18px; }
.cv-baslider .handle {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; background: white;
  pointer-events: none;
}
.cv-baslider .handle::after {
  content: "";
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 48px; height: 48px;
  border-radius: 50%; background-color: white;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23001D21' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><path d='M9 6l-5 6 5 6M15 6l5 6-5 6'/></svg>");
  background-size: 24px 24px;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.25), 0 6px 24px rgba(0,0,0,0.3);
}

/* === Multi-step form === */
.cv-multistep { max-width: 720px; }
.cv-progress {
  display: flex; gap: 6px; margin-bottom: 32px;
}
.cv-progress span {
  flex: 1; height: 4px; border-radius: 2px;
  background: var(--sr-border);
  overflow: hidden; position: relative;
}
.cv-progress span.done { background: var(--sr-blue); }
.cv-progress span.active::after {
  content: ""; position: absolute; inset: 0;
  background: var(--sr-blue);
  width: var(--p, 30%);
  transition: width 250ms ease;
}
.cv-step {
  display: none;
  animation: cvStepIn 250ms var(--ease-out);
}
.cv-step.active { display: block; }
@keyframes cvStepIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.cv-step .step-num {
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--sr-blue); margin-bottom: 12px;
}
.cv-step h2 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05; letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.cv-step .helper {
  color: var(--sr-meta); font-size: 16px;
  margin-bottom: 32px; max-width: 50ch;
}
.cv-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.cv-option {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px;
  border: 1.5px solid var(--sr-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 150ms ease;
}
.cv-option input { display: none; }
.cv-option:hover { border-color: var(--sr-text); }
.cv-option.active { border-color: var(--sr-blue); background: var(--sr-blue-soft); }
.cv-option .icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--sr-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-weight: 800; font-size: 16px;
}
.cv-option.active .icon { background: var(--sr-blue); color: white; }
.cv-option strong { display: block; font-size: 15px; font-weight: 700; }
.cv-option span { font-size: 13px; color: var(--sr-meta); }

.cv-input {
  width: 100%;
  padding: 18px 20px;
  border: 1.5px solid var(--sr-border);
  border-radius: 12px;
  font-size: 17px; font-weight: 500;
  font-family: inherit;
  transition: all 150ms ease;
  background: var(--sr-white);
}
.cv-input:focus {
  outline: none;
  border-color: var(--sr-blue);
  box-shadow: 0 0 0 4px rgba(48,150,219,0.12);
}

.cv-step-actions {
  display: flex; gap: 12px;
  margin-top: 32px;
}
.cv-step-actions .spacer { flex: 1; }

.cv-slider-wrap { padding: 32px 0; }
.cv-slider-wrap input[type="range"] { width: 100%; accent-color: var(--sr-blue); height: 6px; }
.cv-slider-val { font-size: 56px; font-weight: 800; letter-spacing: -0.03em; color: var(--sr-blue); margin-bottom: 8px; }
.cv-slider-val span { font-size: 22px; color: var(--sr-meta); margin-left: 6px; font-weight: 700; }

@media (max-width: 640px) { .cv-options { grid-template-columns: 1fr; } }

/* === Exit-intent overlay === */
.cv-exit {
  position: fixed; inset: 0;
  background: rgba(0,29,33,0.7);
  backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  z-index: 9000;
  opacity: 0; transition: opacity 200ms ease;
  padding: 24px;
}
.cv-exit.open { display: flex; opacity: 1; }
.cv-exit-card {
  background: var(--sr-white);
  border-radius: 18px;
  padding: 48px;
  max-width: 480px; width: 100%;
  position: relative;
  transform: scale(0.94);
  transition: transform 200ms var(--ease-out);
}
.cv-exit.open .cv-exit-card { transform: scale(1); }
.cv-exit-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--sr-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.cv-exit-card h3 { font-size: 28px; letter-spacing: -0.02em; margin-bottom: 12px; }
.cv-exit-card p { color: var(--sr-meta); margin-bottom: 24px; }
.cv-exit-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.cv-exit-form input { padding: 16px 18px; border: 1.5px solid var(--sr-border); border-radius: 10px; font-size: 16px; font-family: inherit; }
.cv-exit-form input:focus { outline: none; border-color: var(--sr-blue); }
.cv-exit-form button { padding: 0 24px; background: var(--sr-blue); color: white; border-radius: 10px; font-weight: 700; }

/* === Lead-magnet === */
.cv-leadmag {
  display: grid; grid-template-columns: 1.2fr 1fr;
  gap: 48px; align-items: center;
  background: var(--sr-light);
  border-radius: 16px;
  padding: 56px;
}
.cv-leadmag h3 { font-size: clamp(28px, 3.5vw, 40px); line-height: 1.05; margin-bottom: 16px; letter-spacing: -0.02em; }
.cv-leadmag h3 .accent { color: var(--sr-blue); }
.cv-leadmag p { color: var(--sr-meta); margin-bottom: 24px; }
.cv-leadmag-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.cv-leadmag-form input { padding: 16px 18px; border: 1.5px solid var(--sr-border); border-radius: 10px; font-size: 16px; font-family: inherit; background: white; }
.cv-leadmag-form input:focus { outline: none; border-color: var(--sr-blue); }
.cv-leadmag-form button { padding: 0 24px; background: var(--sr-dark); color: white; border-radius: 10px; font-weight: 700; }
.cv-leadmag-cover {
  aspect-ratio: 4/5;
  background: linear-gradient(160deg, #001D21 0%, #0a2a2e 100%);
  border-radius: 12px;
  padding: 32px;
  color: white;
  position: relative;
  box-shadow: 0 30px 60px -20px rgba(0,29,33,0.5);
  transform: rotate(-3deg);
  display: flex; flex-direction: column; justify-content: space-between;
}
.cv-leadmag-cover .badge { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; color: var(--sr-blue); }
.cv-leadmag-cover h4 { font-size: 28px; letter-spacing: -0.02em; line-height: 1.05; }
.cv-leadmag-cover .meta { font-size: 12px; color: rgba(255,255,255,0.5); font-weight: 600; }
@media (max-width: 900px) {
  .cv-leadmag { grid-template-columns: 1fr; padding: 32px; }
  .cv-leadmag-cover { aspect-ratio: 4/3; transform: none; }
}

/* === Tool funnel breadcrumb === */
.cv-funnel {
  display: flex; align-items: center; gap: 4px;
  padding: 12px 16px;
  border: 1px solid var(--sr-border);
  border-radius: 100px;
  background: var(--sr-white);
  width: fit-content;
  font-size: 12px;
  font-weight: 700;
}
.cv-funnel .step {
  padding: 6px 12px; border-radius: 100px;
  color: var(--sr-meta);
  display: flex; align-items: center; gap: 6px;
}
.cv-funnel .step.done { color: var(--sr-blue); }
.cv-funnel .step.current { background: var(--sr-blue); color: white; }
.cv-funnel .step.done::before { content: "✓"; font-size: 11px; }
.cv-funnel .sep { color: var(--sr-border); padding: 0 2px; }

/* === Funnel sidebar (your details so far) === */
.cv-side {
  position: sticky; top: 100px;
  background: var(--sr-white);
  border: 1px solid var(--sr-border);
  border-radius: 14px;
  padding: 28px;
  align-self: start;
}
.cv-side h5 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--sr-meta); margin-bottom: 20px; }
.cv-side-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 12px 0; border-bottom: 1px dashed var(--sr-border); font-size: 14px; gap: 12px; }
.cv-side-row:last-child { border-bottom: none; }
.cv-side-row .lbl { color: var(--sr-meta); font-weight: 600; }
.cv-side-row .val { font-weight: 700; text-align: right; color: var(--sr-text); }
.cv-side-row .val.empty { color: var(--sr-border); font-weight: 500; }

/* === Visualiser preview block === */
.cv-vp {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 64px; align-items: center;
}
.cv-vp h2 { font-size: clamp(40px, 5vw, 64px); line-height: 1.02; letter-spacing: -0.025em; margin-bottom: 20px; }
.cv-vp h2 .accent { color: var(--sr-blue); }
.cv-vp p { font-size: 17px; color: var(--sr-meta); margin-bottom: 28px; max-width: 50ch; }
@media (max-width: 900px) { .cv-vp { grid-template-columns: 1fr; gap: 32px; } }

/* === Estimator preview band === */
.cv-ep {
  background: var(--sr-light);
  border-radius: 16px;
  padding: 56px;
  display: grid; grid-template-columns: 1.2fr 1fr;
  gap: 48px; align-items: center;
}
.cv-ep h2 { font-size: clamp(32px, 4vw, 48px); line-height: 1.05; margin-bottom: 16px; letter-spacing: -0.02em; }
.cv-ep h2 .accent { color: var(--sr-blue); }
.cv-ep p { color: var(--sr-meta); margin-bottom: 24px; max-width: 46ch; }
.cv-ep-form {
  display: flex; gap: 8px;
  background: white; padding: 6px;
  border-radius: 12px; border: 1.5px solid var(--sr-border);
}
.cv-ep-form input { flex: 1; border: 0; padding: 14px 16px; background: transparent; outline: none; font-family: inherit; font-size: 15px; font-weight: 500; }
.cv-ep-form button {
  background: var(--sr-blue);
  color: var(--sr-white);
  border: 1.5px solid var(--sr-blue);
  padding: 14px 26px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.cv-ep-form button:hover { background: var(--sr-blue-hover); border-color: var(--sr-blue-hover); }
.cv-ep-form button svg { width: 14px; height: 14px; transition: transform 0.3s; }
.cv-ep-form button:hover svg { transform: translateX(4px); }
@media (max-width: 900px) { .cv-ep { grid-template-columns: 1fr; padding: 32px; } }

/* === Scroll-depth in-content blocks === */
.cv-incontent {
  margin: 48px 0;
  padding: 32px;
  border-left: 4px solid var(--sr-blue);
  background: var(--sr-light);
  border-radius: 0 12px 12px 0;
}
.cv-incontent .lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--sr-blue); margin-bottom: 8px; }
.cv-incontent h4 { font-size: 22px; letter-spacing: -0.015em; margin-bottom: 12px; }
.cv-incontent .row { display: flex; gap: 12px; align-items: center; }

/* === Reading progress === */
.cv-read-progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--sr-blue); z-index: 1000; transition: width 100ms linear; }

/* === Floating quote button (blog) === */
.cv-float-cta {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 800;
  background: var(--sr-blue);
  color: white;
  padding: 14px 22px;
  border-radius: 100px;
  font-weight: 700;
  box-shadow: 0 16px 40px -10px rgba(48,150,219,0.55);
  transform: translateY(120%);
  transition: transform 250ms var(--ease-out);
  display: inline-flex; align-items: center; gap: 8px;
}
.cv-float-cta.show { transform: translateY(0); }
@media (max-width: 768px) { .cv-float-cta { bottom: 80px; } }

/* === Result price card === */
.cv-result {
  background: linear-gradient(160deg, var(--sr-dark) 0%, var(--sr-dark-2) 100%);
  border-radius: 18px;
  padding: 48px;
  color: white;
  text-align: center;
}
.cv-result .lbl { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--sr-blue); margin-bottom: 12px; }
.cv-result .price {
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-bottom: 20px;
}
.cv-result .price .accent { color: var(--sr-blue); }
.cv-result .meta { color: rgba(255,255,255,0.6); margin-bottom: 32px; max-width: 50ch; margin-left: auto; margin-right: auto; }
.cv-breakdown { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: rgba(255,255,255,0.08); border-radius: 12px; overflow: hidden; margin-top: 32px; }
.cv-breakdown .cell { background: var(--sr-dark-2); padding: 20px 16px; text-align: center; }
.cv-breakdown .cell .pct { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: var(--sr-blue); }
.cv-breakdown .cell .nm { font-size: 11px; color: rgba(255,255,255,0.5); font-weight: 600; text-transform: uppercase; letter-spacing: 1.2px; margin-top: 4px; }
@media (max-width: 640px) { .cv-breakdown { grid-template-columns: 1fr 1fr; } }

/* === Colour swatches (visualiser) === */
.cv-swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.cv-swatch {
  aspect-ratio: 1;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  transition: transform 150ms var(--ease-out), border-color 150ms ease;
}
.cv-swatch:hover { transform: scale(1.04); }
.cv-swatch.active { border-color: var(--sr-blue); }
.cv-swatch span {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.6); color: white;
  font-size: 10px; font-weight: 700; padding: 4px 6px;
  text-transform: uppercase; letter-spacing: 1px;
}
@media (max-width: 768px) { .cv-swatches { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 480px) { .cv-swatches { grid-template-columns: repeat(3, 1fr); } }

/* === ?from=* welcome banner (round 3) === */
.cv-from-banner {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  background: var(--sr-blue); color: white;
  padding: 12px 18px 12px 12px;
  border-radius: 100px;
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 14px 32px rgba(48,150,219,0.32);
  z-index: 90;
  max-width: calc(100vw - 32px);
  animation: cvFromBanner 0.4s var(--ease-out, cubic-bezier(0.16,1,0.3,1));
}
@keyframes cvFromBanner { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.cv-from-banner-pill { background: rgba(255,255,255,0.16); padding: 4px 10px; border-radius: 100px; font-size: 10px; text-transform: uppercase; letter-spacing: 1.4px; font-weight: 700; flex-shrink: 0; }
.cv-from-banner-close { background: transparent; color: white; font-size: 22px; line-height: 1; padding: 0 4px; cursor: pointer; opacity: 0.7; transition: opacity 0.2s; flex-shrink: 0; }
.cv-from-banner-close:hover { opacity: 1; }
@media (max-width: 600px) {
  .cv-from-banner { font-size: 12px; padding: 10px 14px 10px 10px; }
  .cv-from-banner-pill { display: none; }
}
