:root {
  --purple: #3c1a5b;
  --purple-dark: #27103d;
  --purple-soft: #f1edf5;
  --yellow: #ffd42a;
  --ink: #1c1621;
  --muted: #6f6775;
  --line: #e5dfe9;
  --paper: #fff;
  --bg: #f5f3f6;
  --frame: #383e42;
  --radius: 20px;
  --shadow: 0 24px 70px rgba(40, 17, 59, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: "DM Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, label, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.topbar { height: 96px; padding: 0 max(24px, calc((100vw - 1280px)/2)); display: flex; align-items: center; justify-content: space-between; background: var(--purple); border-bottom: 1px solid rgba(255,255,255,.11); }
.brand { display: flex; align-items: center; color: white; text-decoration: none; }
.official-logo-crop { display: block; width: 220px; height: 88px; overflow: hidden; position: relative; flex: 0 0 auto; }
.official-logo-crop img { position: absolute; width: 380px; height: auto; max-width: none; left: -84px; top: -175px; }
.top-actions { display: flex; align-items: center; gap: 17px; }
.private-pill { background: var(--yellow); color: var(--purple); border-radius: 999px; padding: 7px 11px; font-weight: 800; font-size: 12px; }
.language-switch { background: rgba(255,255,255,.12); padding: 3px; border-radius: 10px; display: flex; }
.language-switch button { border: 0; color: rgba(255,255,255,.67); padding: 7px 9px; background: transparent; border-radius: 7px; font-weight: 800; font-size: 11px; }
.language-switch button.active { color: var(--purple); background: white; box-shadow: 0 2px 8px rgba(36, 13, 53, .1); }

.hero { min-height: 230px; padding: 49px max(24px, calc((100vw - 1280px)/2)) 55px; background: radial-gradient(circle at 73% 20%, rgba(255,212,42,.13), transparent 23%), linear-gradient(125deg, #2d1146 0%, #3c1a5b 55%, #4a206f 100%); color: white; display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; overflow: hidden; position: relative; }
.hero::after { content:""; position: absolute; width: 280px; height: 280px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; right: 5%; top: -120px; box-shadow: 0 0 0 38px rgba(255,255,255,.025), 0 0 0 80px rgba(255,255,255,.018); }
.hero-copy { max-width: 750px; position: relative; z-index: 1; }
.eyebrow, .section-kicker { font-size: 11px; letter-spacing: .17em; font-weight: 800; }
.eyebrow { color: var(--yellow); }
.hero h1 { font: 800 clamp(34px, 4vw, 58px)/1.05 "Manrope", sans-serif; margin: 12px 0 12px; letter-spacing: -.045em; }
.hero p { color: #dfd4e6; margin: 0; font-size: 16px; line-height: 1.6; max-width: 680px; }
.hero .slogan { color: white; font: 700 16px/1.2 "Manrope", sans-serif; white-space: nowrap; position: relative; z-index: 1; margin-bottom: 8px; }
.slogan span { display: block; width: 72%; height: 4px; background: var(--yellow); margin-top: 8px; border-radius: 4px; }

.config-shell { max-width: 1280px; margin: -20px auto 48px; padding: 0 24px; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(390px, .88fr); gap: 18px; position: relative; z-index: 3; }
.config-panel, .preview-panel { background: var(--paper); border: 1px solid rgba(64,27,88,.09); border-radius: var(--radius); box-shadow: var(--shadow); }
.config-panel { padding: 30px; min-height: 720px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-kicker { color: var(--purple); }
.panel-head h2 { font: 800 25px/1.2 "Manrope", sans-serif; letter-spacing: -.025em; margin: 7px 0 0; }
.reset-btn { border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; padding: 7px 0; text-decoration: underline; text-underline-offset: 4px; }
.reset-btn:hover { color: var(--purple); }

.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin: 30px 0 36px; position: relative; }
.steps::before { content:""; height: 2px; position: absolute; left: 9%; right: 9%; top: 16px; background: var(--line); }
.step { border: 0; background: transparent; display: grid; place-items: center; gap: 7px; color: #9b929f; position: relative; z-index: 1; padding: 0; }
.step span { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 50%; background: #f0edf2; border: 2px solid white; box-shadow: 0 0 0 1px var(--line); font-weight: 800; font-size: 12px; transition: .25s; }
.step b { font-size: 11px; font-weight: 700; }
.step.active, .step.done { color: var(--purple); }
.step.active span { background: var(--purple); color: white; box-shadow: 0 0 0 4px #ece5f2; }
.step.done span { background: var(--yellow); color: var(--purple-dark); box-shadow: 0 0 0 1px var(--yellow); }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.form-step { display: none; min-height: 420px; animation: showStep .3s ease; }
.form-step.active { display: block; }
@keyframes showStep { from { opacity: 0; transform: translateY(7px); } to { opacity:1; transform: none; } }
legend { font: 800 21px/1.25 "Manrope", sans-serif; letter-spacing: -.025em; padding: 0; }
.field-help { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 8px 0 25px; }
.dimension-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.number-field { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; transition: .2s; }
.number-field:focus-within { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
.number-field > span, .label-title, .textarea-field > span, .contact-grid label > span, .side-grid label > span { display:block; font-size: 12px; font-weight: 700; color: #645c69; margin-bottom: 8px; }
.number-field div { display: flex; align-items: baseline; }
.number-field input { width: 100%; min-width: 0; border: 0; outline: 0; font: 800 26px/1 "Manrope", sans-serif; color: var(--ink); }
.number-field em { font-style: normal; color: #827887; font-size: 12px; }
.number-field small { display: block; margin-top: 8px; font-size: 10px; color: #a29aa6; }
.number-field.error { border-color: #d13c52; }
.market-block { margin-top: 25px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); background: #f1eef3; padding: 4px; border-radius: 12px; gap: 3px; }
.segmented.two { grid-template-columns: repeat(2, 1fr); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { min-height: 42px; display: flex; align-items: center; justify-content: center; padding: 8px 10px; border-radius: 9px; color: #716878; font-size: 12px; font-weight: 700; text-align: center; cursor: pointer; }
.segmented input:checked + span { background: white; color: var(--purple); box-shadow: 0 3px 10px rgba(51,24,67,.1); }
.segmented label:has(input:disabled) span { opacity: .42; cursor: not-allowed; }

.option-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.option-card { min-height: 128px; border: 1.5px solid var(--line); border-radius: 14px; padding: 13px 15px; display: grid; grid-template-columns: 42px 1fr; grid-template-rows: auto auto 1fr; column-gap: 11px; align-items: start; position: relative; cursor: pointer; transition: .2s; }
.option-card:hover { border-color: #b8a5c7; }
.option-card:has(input:checked), .option-card.selected { border-color: var(--purple); background: #fbf9fc; box-shadow: inset 0 0 0 1px var(--purple), 0 5px 15px rgba(60,26,91,.07); }
.option-card input { position: absolute; opacity: 0; }
.option-card strong { font: 700 13px/1.25 "Manrope", sans-serif; margin-top: 4px; }
.option-card small { color: var(--muted); font-size: 11px; line-height: 1.3; grid-column: 2; }
.recommended { color: var(--purple); background: var(--yellow); border-radius: 5px; padding: 4px 6px; font-size: 8px; font-weight: 800; letter-spacing: .06em; position: absolute; right: 9px; bottom: 9px; }
.card-icon { width: 41px; height: 41px; background: var(--purple-soft); border-radius: 10px; grid-row: 1 / 4; position: relative; overflow: hidden; }
.card-icon::before, .card-icon::after, .card-icon i { content:""; display: block; position: absolute; }
.card-icon::before { width: 28px; height: 5px; background: var(--purple); left: 7px; top: 11px; transform: skewY(-8deg); }
.card-icon::after { width: 4px; height: 20px; background: var(--purple); left: 8px; top: 14px; box-shadow: 24px -3px 0 var(--purple); }
.roof-retract i { width: 22px; height: 12px; left: 10px; top: 14px; background: repeating-linear-gradient(90deg, #fff 0 4px, #d0c1da 4px 6px); transform: skewY(-8deg); }
.roof-louver i { width: 24px; height: 13px; left: 9px; top: 14px; background: repeating-linear-gradient(90deg, transparent 0 3px, var(--purple) 3px 5px); transform: skewY(-8deg); }
.roof-glass i { width: 24px; height: 13px; left: 9px; top: 14px; background: rgba(85,183,209,.35); border: 1px solid #82b4c4; transform: skewY(-8deg); }
.roof-panel i { width: 24px; height: 13px; left: 9px; top: 14px; background: #79727d; box-shadow: inset 0 3px rgba(255,255,255,.2); transform: skewY(-8deg); }
.two-col { display: grid; grid-template-columns: 1fr 1.3fr; gap: 18px; }
.compact-fields { margin-top: 21px; }
.swatches { display: flex; gap: 10px; }
.swatches label { cursor: pointer; display: grid; justify-items: center; gap: 4px; }
.swatches input { position: absolute; opacity: 0; }
.swatches label > span { width: 31px; height: 31px; border-radius: 50%; background: var(--swatch); border: 3px solid white; box-shadow: 0 0 0 1px #d8d1db; display: grid; place-items: center; color: white; font-weight: 800; }
.swatches label > span.light { border-color: #f8f8f8; }
.swatches input:checked + span { box-shadow: 0 0 0 2px var(--purple), 0 3px 8px rgba(31,14,43,.16); }
.swatches small { color: #827887; font-size: 9px; }
#roofColorBlock { margin-top: 20px; }
.roof-colors { grid-template-columns: repeat(4, 1fr); }

.side-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.side-grid label { padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; }
.side-grid select { width: 100%; appearance: none; border: 0; outline: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%233c1a5b' stroke-width='2'/%3E%3C/svg%3E") no-repeat right center; color: var(--purple); font-weight: 700; font-size: 13px; padding-right: 18px; }
.context-note, .final-note { margin-top: 18px; padding: 13px 14px; border-radius: 12px; background: var(--purple-soft); display: flex; gap: 12px; align-items: center; }
.context-note > span, .final-note > span { flex: 0 0 auto; width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; color: white; background: var(--purple); font-weight: 800; }
.context-note p, .final-note p { margin: 0; color: #5f5069; font-size: 12px; line-height: 1.45; }
#rearSide.hidden { opacity: .38; pointer-events: none; }

.toggle-list { display: grid; gap: 9px; }
.toggle-row { border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; display: grid; grid-template-columns: 34px 1fr 41px; align-items: center; gap: 10px; cursor: pointer; }
.toggle-row:hover { border-color: #c4b5cf; }
.toggle-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: var(--purple-soft); color: var(--purple); font-size: 15px; font-weight: 800; }
.toggle-row strong { display: block; font-size: 12px; }
.toggle-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.toggle-row input { position: absolute; opacity: 0; }
.toggle-row > i { width: 39px; height: 23px; background: #d8d2db; border-radius: 999px; position: relative; transition: .2s; }
.toggle-row > i::after { content:""; width: 17px; height: 17px; position: absolute; top: 3px; left: 3px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,.17); transition: .2s; }
.toggle-row input:checked + i { background: var(--purple); }
.toggle-row input:checked + i::after { transform: translateX(16px); background: var(--yellow); }
.toggle-row.disabled { opacity: .45; pointer-events: none; }
.textarea-field { display: block; margin-top: 16px; }
.textarea-field textarea { width: 100%; min-height: 80px; resize: vertical; border: 1px solid var(--line); border-radius: 12px; padding: 12px; outline: none; font-size: 12px; }
.textarea-field textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.contact-grid .wide { grid-column: 1 / -1; }
.contact-grid input { width: 100%; height: 47px; border: 1px solid var(--line); border-radius: 11px; padding: 0 12px; outline: none; font-size: 13px; }
.contact-grid input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
.contact-grid input.invalid { border-color: #d13c52; }
.consent { display: flex; align-items: flex-start; gap: 9px; margin-top: 15px; color: #665d6b; font-size: 11px; line-height: 1.4; }
.consent input { width: 17px; height: 17px; accent-color: var(--purple); margin: 0; flex: 0 0 auto; }
.consent.invalid { color: #b32d43; }
.final-note p { display: grid; }
.final-note strong { color: var(--purple); font-size: 12px; }
.final-note small { color: #75697d; font-size: 10px; }

.form-actions { margin-top: 28px; padding-top: 19px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.button { min-height: 48px; border-radius: 11px; padding: 0 22px; border: 0; font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 23px; transition: .2s; }
.button.primary { background: var(--purple); color: white; margin-left: auto; min-width: 142px; }
.button.primary:hover { background: #4d2272; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(60,26,91,.23); }
.button.primary.whatsapp { background: #138a4d; }
.button.primary.whatsapp:hover { background: #0f7842; }
.button.secondary { background: #eeeaf1; color: var(--purple); }
.button:disabled { opacity: .38; pointer-events: none; }

.preview-panel { overflow: hidden; align-self: start; position: sticky; top: 16px; }
.preview-head { padding: 20px 21px 15px; display: flex; justify-content: space-between; align-items: center; }
.preview-head > div { display: flex; gap: 8px; align-items: center; color: var(--purple); font-size: 10px; letter-spacing: .12em; font-weight: 800; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #19a866; box-shadow: 0 0 0 4px rgba(25,168,102,.12); }
#systemBadge { font-size: 9px; font-weight: 800; background: var(--yellow); color: var(--purple-dark); padding: 5px 8px; border-radius: 5px; }
.pergola-stage { position: relative; height: 345px; background: linear-gradient(#e9eef2 0%, #f5f4f4 61%, #dfdadd 61%, #f3eff1 100%); overflow: hidden; }
.pergola-stage::before { content:""; position: absolute; width: 100%; height: 32%; top: 29%; left: 0; background: linear-gradient(90deg, rgba(255,255,255,.9), rgba(245,241,247,.5)); border-top: 1px solid rgba(60,26,91,.05); border-bottom: 1px solid rgba(60,26,91,.07); }
.scene-sun { position: absolute; width: 50px; height: 50px; border-radius: 50%; background: rgba(255,218,73,.55); top: 38px; right: 43px; box-shadow: 0 0 45px 18px rgba(255,221,96,.17); }
.pergola-stage svg { width: 100%; height: 100%; position: relative; z-index: 1; }
.frame-lines { stroke: var(--frame); }
.dimension-line path { stroke: var(--purple); stroke-width: 1.5; fill: none; }
.dimension-line text { fill: var(--purple); font: 700 13px "DM Sans", sans-serif; }
.view-label { position: absolute; left: 14px; bottom: 12px; z-index: 2; padding: 5px 8px; border-radius: 5px; background: rgba(255,255,255,.8); backdrop-filter: blur(6px); color: #807585; font-size: 9px; font-weight: 700; }
.summary-card { margin: 16px; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.summary-title { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 11px; }
.summary-title h3 { margin: 0; font: 800 15px/1.2 "Manrope", sans-serif; }
.summary-title span { color: var(--purple); font-size: 10px; font-weight: 800; background: var(--purple-soft); border-radius: 999px; padding: 5px 8px; }
.summary-card dl { margin: 12px 0; display: grid; gap: 8px; max-height: 170px; overflow: auto; }
.summary-card dl div { display: grid; grid-template-columns: 41% 1fr; gap: 8px; font-size: 11px; }
.summary-card dt { color: #887e8e; }
.summary-card dd { margin: 0; color: #392c41; font-weight: 700; text-align: right; }
.price-row { border-top: 1px solid var(--line); padding-top: 12px; display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: #7b7180; }
.price-row strong { color: var(--purple); font-size: 12px; }
.trust-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 13px; padding: 0 17px 20px; color: #776d7c; }
.trust-row span { font-size: 9px; }
.trust-row span::first-letter { color: #168f53; }

footer { max-width: 1280px; margin: 0 auto; min-height: 100px; padding: 26px 24px 35px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 28px; color: #776d7d; font-size: 12px; }
footer div { display: grid; margin-right: auto; }
footer strong { color: var(--purple); letter-spacing: .05em; }
footer a { color: var(--purple); text-decoration: none; font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); background: #251430; color: white; padding: 11px 17px; border-radius: 9px; font-size: 12px; z-index: 20; opacity: 0; pointer-events: none; transition: .25s; box-shadow: 0 10px 35px rgba(0,0,0,.25); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) {
  .hero { padding-bottom: 45px; }
  .config-shell { grid-template-columns: 1fr; max-width: 760px; }
  .preview-panel { position: static; order: -1; display: grid; grid-template-columns: 1.2fr .8fr; }
  .preview-head { grid-column: 1 / -1; }
  .pergola-stage { height: 325px; }
  .summary-card { margin: 0 14px 12px 10px; align-self: center; }
  .trust-row { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .topbar { height: 82px; padding: 0 14px; }
  .official-logo-crop { width: 184px; height: 76px; }
  .official-logo-crop img { width: 320px; left: -72px; top: -147px; }
  .private-pill { display: none; }
  .top-actions { gap: 7px; }
  .hero { min-height: 230px; padding: 38px 18px 48px; align-items: flex-start; }
  .hero h1 { font-size: 37px; max-width: 340px; }
  .hero p { font-size: 14px; line-height: 1.5; }
  .hero .slogan { display: none; }
  .config-shell { margin-top: -22px; padding: 0 10px; gap: 10px; }
  .preview-panel { display: block; border-radius: 16px; }
  .preview-head { padding: 15px 15px 10px; }
  .pergola-stage { height: 255px; }
  .summary-card { margin: 11px; }
  .summary-card dl { max-height: 118px; }
  .trust-row { padding: 0 12px 15px; }
  .config-panel { padding: 21px 16px; border-radius: 16px; min-height: 0; }
  .panel-head h2 { font-size: 20px; }
  .steps { margin: 24px 0 30px; }
  .steps::before { left: 8%; right: 8%; top: 14px; }
  .step span { width: 29px; height: 29px; }
  .step b { display: none; }
  .form-step { min-height: 0; }
  legend { font-size: 19px; }
  .field-help { margin-bottom: 19px; }
  .dimension-grid { grid-template-columns: 1fr; }
  .number-field { display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
  .number-field > span { margin: 0; }
  .number-field div { justify-self: end; width: 110px; }
  .number-field input { font-size: 22px; text-align: right; }
  .number-field small { grid-column: 1 / -1; }
  .segmented span { font-size: 10px; padding: 7px 4px; }
  .option-cards { grid-template-columns: 1fr; }
  .option-card { min-height: 92px; grid-template-rows: auto auto; }
  .recommended { bottom: auto; top: 9px; }
  .two-col { grid-template-columns: 1fr; }
  .swatches { justify-content: space-between; }
  .roof-colors { grid-template-columns: repeat(2, 1fr); }
  .side-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-grid .wide { grid-column: auto; }
  .form-actions { position: sticky; bottom: 0; z-index: 4; background: rgba(255,255,255,.93); backdrop-filter: blur(8px); margin-left: -16px; margin-right: -16px; margin-bottom: -21px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); border-radius: 0 0 16px 16px; }
  footer { min-height: 140px; padding: 24px 20px 35px; align-items: flex-start; flex-wrap: wrap; gap: 10px 18px; }
  footer div { flex: 1 0 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
