/*
 * MARVEN — free demo: hero actions, multi-step configurator, mobile bar.
 * Loaded after main.css and built only from its tokens (--blue-*, --ink, --line…).
 * No inline styles are used anywhere, so the strict style-src CSP keeps working.
 */

/* ---------- Utilities ---------- */
.vh {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
html.demo-open { overflow: hidden; }
.btn--xl { min-height: 64px; padding: 0 34px; font-size: 1.1rem; gap: 12px; }

/* ---------- Header ---------- */
.header__demo .icon:first-child { width: 1em; height: 1em; }
@media (max-width: 540px) { .header__demo { display: none; } }

/* ---------- Hero actions ---------- */
.hero__demo .icon:first-child { color: var(--ink); }
.hero__actions { margin-top: 36px; }
.hero__offer-note { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; font-size: .92rem; font-weight: 500; color: var(--ink-2); }
.hero__offer-note .icon { width: 17px; height: 17px; padding: 3px; box-sizing: content-box; margin: -3px; border-radius: 50%; background: var(--blue-100); color: var(--blue-700); }
@media (max-width: 640px) {
  .hero__actions { margin-top: 30px; }
  .hero__actions .btn { width: 100%; padding: 0 22px; }
  .hero__offer-note { justify-content: center; width: 100%; }
}

/* ---------- Mobile sticky bar: demo + call ---------- */
.mobile-bar--demo { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 8px; padding: 7px; }
.mobile-bar--demo .mobile-bar__btn { min-height: 52px; }
.mobile-bar__btn--demo { font-size: 1rem; color: var(--ink); background: linear-gradient(180deg, #92cbf6, var(--blue-400)); border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55); }
.mobile-bar__btn--demo .icon { color: var(--ink); }
.mobile-bar__btn--call .icon { width: 1.2em; height: 1.2em; color: var(--blue-700); }
.mobile-bar__btn--call:active { background: var(--blue-100); }

/* ---------- Dialog ---------- */
.demo {
  width: min(940px, calc(100% - 48px)); height: min(780px, calc(100dvh - 48px)); max-height: none;
  margin: auto; padding: 0; overflow: hidden;
  border: 0; border-radius: var(--radius-xl);
  background: var(--white); color: var(--ink-2);
  box-shadow: 0 50px 120px -30px rgba(11, 26, 44, .45), 0 0 0 1px rgba(201, 228, 251, .6);
}
.demo[open] { display: block; animation: demoPop .5s var(--ease-out); }
.demo::backdrop { background: rgba(11, 26, 44, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.demo[open]::backdrop { animation: demoFade .35s ease-out; }
@keyframes demoPop { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes demoFade { from { opacity: 0; } to { opacity: 1; } }

.demo__shell { display: flex; flex-direction: column; height: 100%; min-height: 0; position: relative; }

.demo__head {
  position: relative; flex: none; padding: 24px clamp(20px, 4vw, 40px) 20px;
  background: linear-gradient(180deg, var(--blue-50), #fff);
  border-bottom: 1px solid var(--line);
}
.demo__headrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.demo__badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; border-radius: 999px;
  background: var(--blue-100); color: var(--blue-700); font-size: .8rem; font-weight: 640; letter-spacing: .08em; text-transform: uppercase;
}
.demo__badge .icon { width: 14px; height: 14px; }
.demo__title { margin-top: 12px; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); line-height: 1.1; letter-spacing: -.03em; }
.demo__intro { margin-top: 6px; font-size: .95rem; color: var(--muted); }

/* Progress */
.demo__progress { margin-top: 18px; }
.demo__stepinfo { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 10px; font-size: .84rem; font-weight: 600; color: var(--blue-700); }
.demo__stepname { color: var(--muted); font-weight: 500; }
.demo__stepname::before { content: "·"; margin-right: 10px; }
.demo__dots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.demo__dot { display: grid; gap: 8px; width: 100%; padding: 4px 0; text-align: left; border-radius: 8px; }
.demo__dotbar { display: block; height: 5px; border-radius: 99px; background: var(--line-strong); overflow: hidden; position: relative; }
.demo__dotbar::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-300)); transform: scaleX(0); transform-origin: left;
  transition: transform .5s var(--ease-out);
}
.demo__dotlabel { display: none; font-size: .76rem; font-weight: 560; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .3s; }
.demo__dot.is-done .demo__dotbar::after, .demo__dot.is-current .demo__dotbar::after { transform: none; }
.demo__dot.is-current .demo__dotlabel { color: var(--blue-700); }
.demo__dot.is-done .demo__dotlabel { color: var(--ink-2); }
.demo__dot:disabled { cursor: default; }
.demo__dot:not(:disabled):hover .demo__dotlabel { color: var(--blue-700); }
@media (min-width: 720px) { .demo__dotlabel { display: block; } }

/* Body and steps */
.demo__form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.demo__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 28px clamp(20px, 4vw, 40px) 12px; scroll-behavior: smooth; }
.demo__step { animation: demoStepIn .5s var(--ease-out) both; }
.demo__step[hidden] { display: none; }
.demo__step.is-back { animation-name: demoStepBack; }
@keyframes demoStepIn { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes demoStepBack { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
.demo__q { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); line-height: 1.15; letter-spacing: -.025em; outline: none; }
.demo__sub { margin: 34px 0 0; font-size: 1.1rem; letter-spacing: -.015em; color: var(--ink); font-weight: 560; }
.demo__hint { margin-top: 6px; margin-bottom: 20px; font-size: .96rem; color: var(--muted); }
.demo__hint--tight { margin-bottom: 14px; }
.demo__sub + .demo__grid { margin-top: 14px; }
.demo__grid { display: grid; gap: 12px; }
.demo__grid--biz { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.demo__grid--style { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.demo__grid--feat, .demo__grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.demo__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.demo__fields .field:nth-child(n + 3) { }
.demo__reveal { animation: demoStepIn .4s var(--ease-out) both; }
.demo__reveal[hidden] { display: none; }
.demo__reqnote { margin-top: 18px; font-size: .86rem; color: var(--muted); }

/* Selectable cards */
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.opt__body {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; height: 100%;
  padding: 18px 18px 16px; border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  background: var(--white);
  transition: border-color .25s, background-color .25s, box-shadow .3s var(--ease), transform .3s var(--ease);
}
.opt__icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px;
  background: var(--blue-50); color: var(--blue-600); transition: background-color .25s, color .25s;
}
.opt__icon svg { width: 22px; height: 22px; }
.opt__text { display: grid; gap: 4px; padding-right: 22px; }
.opt__label { font-size: 1rem; font-weight: 580; line-height: 1.25; letter-spacing: -.01em; color: var(--ink); }
.opt__desc { font-size: .86rem; line-height: 1.4; color: var(--muted); }
.opt__tick {
  position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); color: transparent; background: var(--white);
  transition: background-color .25s, border-color .25s, color .25s, transform .35s var(--ease-out);
}
.opt__tick svg { width: 13px; height: 13px; }
.opt--row .opt__body { flex-direction: row; align-items: center; gap: 12px; padding: 14px 16px; min-height: 58px; }
.opt--row .opt__text { flex: 1; padding-right: 30px; }
.opt--row .opt__tick { top: 50%; right: 14px; transform: translateY(-50%); }
@media (hover: hover) {
  .opt:hover .opt__body { border-color: var(--blue-300); transform: translateY(-2px); box-shadow: var(--shadow); }
  .opt--row:hover .opt__body { transform: none; }
}
.opt input:checked + .opt__body { border-color: var(--blue-500); background: linear-gradient(180deg, #fff, var(--blue-50)); box-shadow: 0 0 0 3px var(--blue-100); }
.opt input:checked + .opt__body .opt__icon { background: var(--blue-400); color: #fff; }
.opt input:checked + .opt__body .opt__tick { background: var(--blue-500); border-color: var(--blue-500); color: #fff; }
.opt input:focus-visible + .opt__body { outline: 2px solid var(--blue-600); outline-offset: 3px; }
.opt--row input:checked + .opt__body .opt__tick { transform: translateY(-50%) scale(1.08); }

/* Style previews */
.stylepv { display: grid; align-content: center; gap: 5px; width: 100%; height: 62px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; }
.stylepv i { display: block; height: 6px; border-radius: 4px; }
.stylepv i:nth-child(1) { width: 42%; }
.stylepv i:nth-child(2) { width: 78%; }
.stylepv i:nth-child(3) { width: 30%; height: 10px; border-radius: 99px; margin-top: 2px; }
.stylepv--modern { background: linear-gradient(135deg, var(--blue-100), var(--blue-300)); }
.stylepv--modern i { background: rgba(255, 255, 255, .85); }
.stylepv--modern i:nth-child(3) { background: var(--blue-600); }
.stylepv--minimal { background: #fff; }
.stylepv--minimal i { background: var(--line-strong); }
.stylepv--minimal i:nth-child(3) { background: var(--ink); }
.stylepv--luxury { background: linear-gradient(135deg, #0b1220, #1b2438); border-color: #0b1220; }
.stylepv--luxury i { background: rgba(255, 255, 255, .22); }
.stylepv--luxury i:nth-child(3) { background: #cfae5e; }
.stylepv--creative { background: linear-gradient(135deg, #ffe7ef, #e6e0ff 55%, #d6f0ff); }
.stylepv--creative i { background: rgba(255, 255, 255, .8); }
.stylepv--creative i:nth-child(3) { background: linear-gradient(90deg, #f27ca5, #7a5cc7); }
.stylepv--unsure { background: var(--tint); border-style: dashed; border-color: var(--blue-300); justify-items: center; }
.stylepv--unsure i { display: none; }
.stylepv--unsure::after { content: "?"; font-family: var(--font-serif); font-style: italic; font-size: 1.9rem; line-height: 1; color: var(--blue-500); }
.opt--style .opt__body { gap: 12px; }
.opt--style .opt__text { padding-right: 0; }
.opt--style .opt__tick { top: 22px; right: 22px; }

/* Colour swatches */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.swatch__body {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 16px 6px 7px;
  border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--white);
  font-size: .94rem; font-weight: 540; color: var(--ink);
  transition: border-color .25s, background-color .25s, box-shadow .3s var(--ease), transform .3s var(--ease);
}
.swatch__dot { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(11, 26, 44, .1); color: #fff; }
.swatch__dot svg { width: 16px; height: 16px; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .35s var(--ease-out); filter: drop-shadow(0 1px 1px rgba(11, 26, 44, .4)); }
.swatch__dot--blue { background: #7cbff4; }
.swatch__dot--navy { background: #14305a; }
.swatch__dot--black { background: #0b0b10; }
.swatch__dot--green { background: #3f8f6b; }
.swatch__dot--rose { background: #f0a6bd; }
.swatch__dot--gold { background: #c9a24a; }
.swatch__dot--terracotta { background: #c8683f; }
.swatch__dot--purple { background: #7a5cc7; }
@media (hover: hover) { .swatch:hover .swatch__body { border-color: var(--blue-300); transform: translateY(-1px); } }
.swatch input:checked + .swatch__body { border-color: var(--blue-500); background: var(--blue-50); box-shadow: 0 0 0 3px var(--blue-100); }
.swatch input:checked + .swatch__body .swatch__dot svg { opacity: 1; transform: none; }
.swatch input:focus-visible + .swatch__body { outline: 2px solid var(--blue-600); outline-offset: 3px; }

/* Fields */
.field { margin-top: 20px; }
.field--spaced { margin-top: 22px; }
.field__label { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; font-size: .94rem; font-weight: 580; color: var(--ink); }
.field__req { color: var(--blue-600); font-weight: 700; }
.field__opt { margin-left: auto; font-size: .78rem; font-weight: 500; color: var(--muted); }
.field__input {
  display: block; width: 100%; min-height: 54px; padding: 14px 16px;
  border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--white);
  font: inherit; font-size: 1rem; line-height: 1.4; color: var(--ink);
  transition: border-color .25s, box-shadow .25s, background-color .25s;
  -webkit-appearance: none; appearance: none;
}
.field__input--area { min-height: 96px; resize: vertical; }
.field__input::placeholder { color: #8b9aac; }
.field__input:hover { border-color: var(--blue-300); }
.field__input:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 4px var(--blue-100); background: #fff; }
.field.has-error .field__input { border-color: #d6455f; background: #fff8f9; }
.field.has-error .field__input:focus { box-shadow: 0 0 0 4px rgba(214, 69, 95, .14); }
.field__err { margin-top: 8px; font-size: .88rem; font-weight: 500; line-height: 1.4; color: #b4233f; }
.field__err[hidden] { display: none; }
.demo__body > .demo__step > .field__err { margin-top: 14px; }

/* Review */
.sum { display: grid; gap: 12px; }
.sum__group { border: 1px solid var(--line); border-radius: var(--radius); background: var(--tint); padding: 4px 18px 6px; }
.sum__row { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); gap: 4px 18px; padding: 12px 0; }
.sum__row + .sum__row { border-top: 1px solid var(--line); }
.sum__dt { font-size: .84rem; font-weight: 600; color: var(--muted); }
.sum__dd { font-size: .98rem; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; white-space: pre-line; }
.sum__dd--none { color: #8b9aac; font-weight: 400; }
.sum__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sum__chip { padding: 3px 11px; border-radius: 999px; background: var(--blue-100); color: var(--blue-700); font-size: .86rem; font-weight: 560; }
.sum__list { margin: 0; }
.sum__extra { display: block; margin-top: 6px; }
.sum__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0 2px; }
.sum__title { font-size: .76rem; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--blue-700); }
.sum__editbtn { padding: 4px 10px; margin-right: -10px; border-radius: 999px; font-size: .86rem; font-weight: 580; color: var(--blue-700); transition: background-color .2s; }
.sum__editbtn:hover { background: var(--blue-100); }
.demo__trust, .demo__privacy { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; font-size: .9rem; line-height: 1.5; }
.demo__trust { color: var(--ink); font-weight: 540; }
.demo__trust .icon { margin-top: 3px; width: 18px; height: 18px; color: var(--blue-600); }
.demo__privacy { color: var(--muted); }
.demo__privacy .icon { margin-top: 3px; width: 16px; height: 16px; color: var(--muted); }
.demo__privacy a { color: var(--blue-700); font-weight: 560; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--blue-300); }
.demo__privacy a:hover { text-decoration-color: currentColor; }

.demo__alert { margin-top: 18px; padding: 16px 18px; border: 1px solid #f0b8c2; border-radius: var(--radius); background: #fff6f7; animation: demoStepIn .4s var(--ease-out) both; outline: none; }
.demo__alert[hidden] { display: none; }
.demo__alert-title { font-weight: 640; color: #9d1d37; }
.demo__alert-text { margin-top: 4px; font-size: .92rem; line-height: 1.5; color: #5a2a33; }
.demo__alert-phone { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-weight: 620; color: var(--blue-700); }

.demo__trap { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Footer actions */
.demo__foot {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px clamp(20px, 4vw, 40px) calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: rgba(255, 255, 255, .96);
}
.demo__foot [hidden] { display: none !important; }
.demo__back-icon { transform: rotate(180deg); }
.demo__back:hover .demo__back-icon { transform: rotate(180deg) translateX(3px) !important; }
.demo__back[data-hidden="true"] { visibility: hidden; }
.demo__next, .demo__submit { margin-left: auto; min-width: 168px; }
.demo__submit { min-width: 220px; }
.demo__spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(11, 26, 44, .22); border-top-color: var(--ink); animation: demoSpin .7s linear infinite; }
.demo.is-sending .demo__spinner { display: inline-block; }
.demo.is-sending .demo__submit { pointer-events: none; opacity: .85; }
@keyframes demoSpin { to { transform: rotate(360deg); } }

/* Success */
.demo__done { flex: 1; display: grid; align-content: center; justify-items: center; gap: 14px; padding: 48px clamp(24px, 6vw, 72px); text-align: center; outline: none; }
.demo__done[hidden] { display: none; }
.demo.is-done .demo__head, .demo.is-done .demo__form { display: none; }
.demo.is-done .demo__shell { justify-content: center; }
.demo__done-icon { width: 96px; height: 96px; border-radius: 50%; background: var(--blue-50); display: grid; place-items: center; box-shadow: 0 0 0 10px rgba(227, 241, 253, .6); animation: demoPop .6s var(--ease-out) both; }
.demo__done-icon svg { width: 64px; height: 64px; }
.demo__done-ring { stroke: var(--blue-400); stroke-width: 2.5; stroke-dasharray: 145; stroke-dashoffset: 145; animation: demoDraw .8s var(--ease-out) .1s forwards; }
.demo__done-tick { stroke: var(--blue-600); stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: demoDraw .5s var(--ease-out) .6s forwards; }
@keyframes demoDraw { to { stroke-dashoffset: 0; } }
.demo__done-title { max-width: 22ch; font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.5rem); line-height: 1.1; letter-spacing: -.03em; }
.demo__done-text { max-width: 32rem; font-size: 1.08rem; line-height: 1.6; color: var(--muted); }
.demo__done .btn { margin-top: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .demo__grid--biz { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .demo__grid--style { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo__fields { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .demo { width: 100%; max-width: none; height: 100dvh; margin: 0; border-radius: 0; }
  .demo[open] { animation-name: demoSheet; }
  .demo__head { padding: calc(14px + env(safe-area-inset-top)) 18px 14px; }
  .demo__title { margin-top: 8px; font-size: 1.35rem; }
  .demo__intro { display: none; }
  .demo__progress { margin-top: 12px; }
  .demo__stepinfo { margin-bottom: 8px; }
  .demo__body { padding: 22px 18px 10px; }
  .demo__foot { padding-inline: 18px; }
  .demo__grid--biz { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opt__body { padding: 14px 14px 12px; gap: 10px; }
  .demo__grid--feat, .demo__grid--2 { grid-template-columns: 1fr; }
  .sum__row { grid-template-columns: 1fr; }
  .demo__next, .demo__submit { min-width: 0; flex: 1; }
  .demo__back span { display: none; }
  .demo__back { min-width: 52px; padding: 0 16px; }
  .demo__done { padding-block: 32px; }
}
@keyframes demoSheet { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@media (max-width: 380px) {
  .demo__grid--style { grid-template-columns: 1fr; }
}
@media (max-height: 560px) and (min-width: 641px) {
  .demo { height: calc(100dvh - 16px); }
  .demo__intro { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .demo__done-ring, .demo__done-tick { animation-duration: .001ms !important; stroke-dashoffset: 0; }
}
