/* INSTALTERMES — the request wizard (solicitar.html). Built on the site's tokens and components in styles.css. */

.req-page { background: var(--bg); }

/* ---------- Hero ---------- */
.req-hero { position: relative; overflow: hidden; padding: 56px 0 36px; }
.req-hero .hero__grid-bg { -webkit-mask-image: radial-gradient(ellipse 70% 90% at 80% 0%, #000 10%, transparent 70%); mask-image: radial-gradient(ellipse 70% 90% at 80% 0%, #000 10%, transparent 70%); }
.req-hero .container { position: relative; }
.req-hero h1 { margin-top: 14px; font-size: clamp(2.3rem, 3.2vw + 1.2rem, 3.6rem); font-weight: 600; letter-spacing: -.026em; line-height: 1.05; }
.req-hero__lead { margin-top: 14px; max-width: 38em; color: var(--ink-2); font-size: clamp(1.0625rem, .4vw + 1rem, 1.25rem); text-wrap: pretty; }

/* ---------- Layout: the steps, and the summary beside them on desktop ---------- */
.req { display: grid; gap: 24px; align-items: start; padding-bottom: 96px; }
.req__main { min-width: 0; }
@media (min-width: 1024px) { .req { grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; } }

/* ---------- Progress: five stops on a rail that fills luz → agua → gas ---------- */
.req-progress { --p: 0; position: relative; display: grid; grid-template-columns: repeat(5, 1fr); margin-bottom: 20px; counter-reset: none; }
.req-progress::before, .req-progress::after { content: ""; position: absolute; left: 10%; right: 10%; top: 17px; height: 2px; border-radius: 2px; }
.req-progress::before { background: var(--line-2); }
.req-progress::after {
  right: auto; width: calc(80% * var(--p)); background: linear-gradient(90deg, var(--elec), var(--water) 45%, var(--gas) 75%, #2FD18F);
  transition: width var(--t-slow) var(--ease-out);
}
.req-progress[hidden] { display: none; }
.req-progress li { position: relative; z-index: 1; display: grid; justify-items: center; gap: 8px; text-align: center; }
.req-progress__n {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line-2); color: var(--ink-3); font-weight: 600; font-size: .95rem;
  transition: background-color var(--t-med) ease, border-color var(--t-med) ease, color var(--t-med) ease, transform var(--t-med) var(--ease-out);
}
.req-progress__t { font-size: .8125rem; font-weight: 500; color: var(--ink-3); transition: color var(--t-med) ease; }
.req-progress li.is-done { cursor: pointer; }
.req-progress li.is-done .req-progress__n { background: var(--primary); border-color: var(--primary); color: #fff; font-size: 0; }
.req-progress li.is-done .req-progress__n::before { content: ""; width: 12px; height: 7px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; rotate: -45deg; translate: 0 -2px; }
.req-progress li.is-done:hover .req-progress__n { transform: scale(1.08); }
.req-progress li[aria-current="step"] .req-progress__n { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 6px rgba(11, 95, 215, .12); }
.req-progress li[aria-current="step"] .req-progress__t, .req-progress li.is-done .req-progress__t { color: var(--ink); }
@media (max-width: 639px) {
  .req-progress__t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .req-progress li[aria-current="step"] .req-progress__t { position: static; width: auto; height: auto; clip-path: none; font-size: .75rem; }
}

/* ---------- The card that holds the steps ---------- */
.req-card { position: relative; padding: 26px 20px 0; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--sh-2), inset 0 0 0 1px var(--line); }
@media (min-width: 640px) { .req-card { padding: 40px 40px 0; } }
.req-card :focus-visible { outline-color: var(--primary); }
.req-step__title { font-size: clamp(1.5rem, 1vw + 1.2rem, 2rem); font-weight: 600; letter-spacing: -.02em; outline: none; }
.req-step__lead { margin: 8px 0 26px; color: var(--ink-3); max-width: 42em; }
.req-draft { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 22px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--primary-soft); color: var(--primary-ink); font-size: .95rem; font-weight: 500; }
.req-draft[hidden] { display: none; }
.req-link { padding: 0; border: 0; background: none; color: var(--primary); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* each step comes in from the side it is reached from */
.req-step[hidden] { display: none; }
.req-step.is-in { animation: reqIn .55s var(--ease-out) both; }
@keyframes reqIn { from { opacity: 0; transform: translateX(calc(var(--dir, 1) * 28px)); } }
@media (prefers-reduced-motion: reduce) { .req-step.is-in { animation: none; } }

/* ---------- Step 1: the catalogue, grouped by supply ---------- */
.req-group + .req-group { margin-top: 26px; }
.req-group__h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: .9375rem; font-weight: 600; color: var(--ink-2); }
.req-group__h .ic { width: 30px; height: 30px; padding: 6px; border-radius: 10px; background: var(--tone-soft); color: var(--tone-ink); }
.req-group[data-supply="elec"], .req-service[data-supply="elec"], .req-summary[data-supply="elec"] { --tone: var(--elec); --tone-ink: var(--elec-ink); --tone-soft: var(--elec-soft); }
.req-group[data-supply="water"], .req-service[data-supply="water"], .req-summary[data-supply="water"] { --tone: var(--water); --tone-ink: var(--water-ink); --tone-soft: var(--water-soft); }
.req-group[data-supply="gas"], .req-service[data-supply="gas"], .req-summary[data-supply="gas"] { --tone: var(--gas); --tone-ink: var(--gas-ink); --tone-soft: var(--gas-soft); }
.req-group__list { display: grid; gap: 12px; }
@media (min-width: 720px) { .req-group__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.req-service { position: relative; display: grid; gap: 6px; padding: 18px 18px 18px 20px; border-radius: var(--r-lg); background: var(--tint); cursor: pointer;
  box-shadow: inset 0 0 0 1.5px transparent; transition: background-color var(--t-med) ease, box-shadow var(--t-med) ease, transform var(--t-med) var(--ease-out); }
.req-service:hover { background: #EFEFF3; }
.req-service input { position: absolute; opacity: 0; pointer-events: none; }
.req-service__top { display: flex; align-items: center; gap: 8px; padding-right: 30px; }
.req-service__code { padding: 3px 9px; border-radius: 999px; background: var(--tone-soft); color: var(--tone-ink); font-size: .75rem; font-weight: 700; letter-spacing: .02em; }
.req-service__name { font-weight: 600; line-height: 1.25; }
.req-service__blurb { color: var(--ink-3); font-size: .9375rem; line-height: 1.4; }
.req-service__price { margin-top: 4px; font-size: .9375rem; font-weight: 600; color: var(--ink-2); }
.req-service__price small { font-weight: 500; color: var(--ink-3); }
.req-service::after {
  content: ""; position: absolute; top: 16px; right: 16px; width: 22px; height: 22px; border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--line-2); transition: background-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.req-service:has(input:checked) { background: var(--surface); box-shadow: inset 0 0 0 2px var(--tone), 0 14px 30px -18px rgba(11, 27, 51, .35); transform: translateY(-1px); }
.req-service:has(input:checked)::after { background: var(--tone) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 13px no-repeat; box-shadow: none; }
.req-service:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 3px; }

/* ---------- Chips for short choices ---------- */
.req-choice { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.req-choice legend { margin-bottom: 8px; padding: 0; font-weight: 600; font-size: .925rem; }
.req-choice legend span { color: var(--danger); }
.req-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.req-chip { position: relative; cursor: pointer; }
.req-chip input { position: absolute; opacity: 0; pointer-events: none; }
.req-chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px;
  background: var(--tint); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-2); font-weight: 500;
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.req-chip:hover span { background: #EDEDF1; }
.req-chip input:checked + span { background: var(--primary); box-shadow: none; color: #fff; }
.req-chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 3px; }
.field__hint { color: var(--ink-3); font-size: .875rem; }
.req-unit { position: relative; }
.req-unit input { padding-right: 52px !important; }
.req-unit::after { content: attr(data-unit); position: absolute; right: 16px; top: 50%; translate: 0 -50%; color: var(--ink-3); font-weight: 600; pointer-events: none; }
.req-questions:not(:empty) { margin-top: 10px; padding-top: 22px; border-top: 1px solid var(--line); }
.req-questions__h { margin-bottom: 16px; font-size: 1.0625rem; font-weight: 600; }

/* ---------- Step 4: files ---------- */
.req-drop {
  display: grid; justify-items: center; gap: 6px; padding: 34px 20px; border-radius: var(--r-lg); text-align: center; cursor: pointer;
  background: var(--tint); box-shadow: inset 0 0 0 2px var(--line-2); background-image: none;
  transition: background-color var(--t-med) ease, box-shadow var(--t-med) ease, transform var(--t-med) var(--ease-out);
}
.req-drop:hover, .req-drop.is-over { background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); }
.req-drop.is-over { transform: scale(1.01); }
.req-drop:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 3px; }
.req-drop__ic { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 4px; border-radius: 16px; background: var(--surface); color: var(--primary); box-shadow: var(--sh-1); }
.req-drop__t { font-weight: 600; }
.req-drop__t u { color: var(--primary); text-underline-offset: 3px; }
.req-drop__h { color: var(--ink-3); font-size: .875rem; }
.req-files { display: grid; gap: 10px; margin-top: 16px; }
.req-files:empty { display: none; }
@media (min-width: 560px) { .req-files { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.req-file { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 8px 8px 8px; border-radius: var(--r-md); background: var(--tint); animation: reqFile .4s var(--ease-out); }
@keyframes reqFile { from { opacity: 0; transform: translateY(8px); } }
.req-file__thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--surface); }
.req-file__pdf { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 12px; background: var(--surface); color: var(--danger); }
.req-file__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: .9375rem; }
.req-file__size { color: var(--ink-3); font-size: .8125rem; }
.req-file__rm { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--ink-3); cursor: pointer; }
.req-file__rm:hover { background: #E6E6EB; color: var(--ink); }
.req-file__rm .ic { width: 18px; height: 18px; }
.req-note { margin-top: 16px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--tint); color: var(--ink-2); font-size: .9375rem; }
.req-note[hidden] { display: none; }

/* ---------- Step 5: review ---------- */
.req-review { display: grid; gap: 12px; margin-bottom: 22px; }
.req-block { padding: 16px 18px; border-radius: var(--r-md); background: var(--tint); }
.req-block__h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.req-block__h h3 { font-size: 1rem; font-weight: 600; }
.req-block dl { display: grid; gap: 6px; }
.req-block dl div { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: 12px; font-size: .9375rem; }
.req-block dt { color: var(--ink-3); }
.req-block dd { overflow-wrap: anywhere; color: var(--ink); }

/* ---------- Back / continue: stuck to the bottom of the screen on phones ---------- */
.req-nav {
  position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 8px -20px 0; padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); border-radius: 0 0 var(--r-xl) var(--r-xl);
  background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
}
@media (min-width: 640px) { .req-nav { margin: 12px -40px 0; padding: 18px 40px; } }
.req-nav__count { color: var(--ink-3); font-size: .875rem; font-weight: 500; }
.req-nav__back[hidden] { display: inline-flex; visibility: hidden; }
@media (max-width: 479px) { .req-nav__count { display: none; } .req-nav .btn { padding-inline: 18px; } }

/* when the online send fails: the reason, and WhatsApp as the way out */
.req-send-fail { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; margin-top: 16px; }
.req-send-fail [hidden] { display: none; }
.req-send-fail .btn--link { padding-inline: 0; }

/* ---------- Sent ---------- */
.req-done { display: grid; justify-items: center; gap: 14px; padding: 56px 24px; text-align: center; animation: reqIn .6s var(--ease-out) both; }
.req-done[hidden] { display: none; }
.req-done__ic { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: #2FD18F; color: #fff; box-shadow: 0 0 0 10px rgba(47, 209, 143, .16); }
.req-done__ic .ic { width: 34px; height: 34px; stroke-width: 2.6; }
.req-done h2 { font-size: clamp(1.6rem, 1vw + 1.3rem, 2.2rem); font-weight: 600; letter-spacing: -.02em; outline: none; }
.req-done p { max-width: 34em; color: var(--ink-2); }
.req-done__ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 10px; }

/* ---------- Summary beside the steps ---------- */
.req-aside { display: none; }
@media (min-width: 1024px) { .req-aside { display: grid; gap: 14px; position: sticky; top: calc(var(--header-h) + 24px); } }
.req-summary { position: relative; overflow: hidden; padding: 24px; border-radius: var(--r-xl); background: var(--navy); color: #fff; }
.req-summary::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--tone, linear-gradient(90deg, var(--elec), var(--water), var(--gas))); transition: background-color var(--t-med) ease; }
.req-summary__k { color: #8EC0FF; font-size: .8125rem; font-weight: 600; }
.req-summary__name { margin-top: 8px; font-size: 1.1875rem; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.req-summary__price { margin-top: 10px; font-size: 1.75rem; font-weight: 600; letter-spacing: -.02em; }
.req-summary__price:empty { display: none; }
.req-summary__price small { font-size: .9375rem; font-weight: 500; color: #B5C3D8; }
.req-summary__note { margin-top: 10px; color: #B5C3D8; font-size: .8125rem; line-height: 1.45; }
.req-summary__steps { display: grid; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12); }
.req-summary__steps li { display: flex; align-items: center; gap: 10px; color: rgba(255, 255, 255, .55); font-size: .9375rem; transition: color var(--t-med) ease; }
.req-summary__steps li::before { content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .3); transition: background-color var(--t-med) ease, box-shadow var(--t-med) ease; }
.req-summary__steps li.is-done { color: #fff; }
.req-summary__steps li.is-done::before { background: #2FD18F url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B1B33' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat; box-shadow: none; }
.req-summary__steps li.is-now { color: #fff; font-weight: 600; }
.req-summary__steps li.is-now::before { box-shadow: inset 0 0 0 5px #8EC0FF; }
.req-help { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); text-decoration: none; font-size: .9375rem; transition: box-shadow var(--t-med) ease; }
.req-help:hover { box-shadow: inset 0 0 0 1px var(--primary); }
.req-help .ic { flex: none; width: 36px; height: 36px; padding: 8px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); }
.req-help strong { display: block; color: var(--ink); }

/* the spam trap: out of sight and out of reach for people, still in the form for bots */
.req-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
#r-privacy { margin: 18px 0 0; }
