/* Grupo GIMSA — cotizador en ventana emergente */
html.qz-open { overflow: hidden; }
.qz { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; }
.qz[hidden] { display: none; }
.qz__overlay { position: absolute; inset: 0; background: rgba(5, 12, 28, .72); backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s; }
.qz__panel { position: relative; width: 100%; max-width: 780px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); display: flex; flex-direction: column; background: #fff; border-radius: 20px; box-shadow: 0 40px 80px rgba(0, 0, 0, .35); overflow: hidden; opacity: 0; transform: translateY(16px) scale(.98); transition: opacity .2s, transform .2s; }
.qz.is-open .qz__overlay { opacity: 1; }
.qz.is-open .qz__panel { opacity: 1; transform: none; }

.qz__head { display: flex; justify-content: space-between; gap: 1rem; padding: 1.6rem 1.8rem 1rem; background: linear-gradient(120deg, var(--blue-900), var(--blue)); color: rgba(255, 255, 255, .85); }
.qz__eyebrow { font: 600 .72rem var(--font-head); letter-spacing: .16em; text-transform: uppercase; color: #9cc0ff; margin: 0 0 .4rem; }
.qz__head h2 { color: #fff; font-size: clamp(1.4rem, 3vw, 1.8rem); margin: 0 0 .3rem; }
.qz__intro { margin: 0; font-size: .95rem; }
.qz__close { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.qz__close:hover { background: rgba(255, 255, 255, .22); }

.qz__steps { list-style: none; display: flex; margin: 0; padding: .9rem 1.8rem .6rem; gap: .4rem; background: var(--blue-900); background: linear-gradient(120deg, var(--blue-900), var(--blue)); }
.qz__steps li { flex: 1; display: flex; align-items: center; gap: .45rem; font-size: .78rem; color: rgba(255, 255, 255, .55); white-space: nowrap; }
.qz__steps b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .35); font: 700 .75rem var(--font-head); flex: none; }
.qz__steps li.is-current { color: #fff; }
.qz__steps li.is-current b { background: #fff; color: var(--blue); border-color: #fff; }
.qz__steps li.is-done b { background: rgba(255, 255, 255, .2); border-color: transparent; color: #fff; }
.qz__progress { height: 4px; background: #e3e8f0; }
.qz__progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .35s ease; }

.qz__body { flex: 1; overflow-y: auto; padding: 1.6rem 1.8rem; outline: none; overscroll-behavior: contain; }
.qz__h { font-size: 1.25rem; margin-bottom: 1.2rem; }

/* Paso 1: tipos */
.qz__types { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; }
.qz__type { display: grid; gap: .3rem; justify-items: start; text-align: left; padding: 1.1rem 1.1rem 1.2rem; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; font: inherit; color: var(--text); transition: border-color .2s, box-shadow .2s, transform .2s; }
.qz__type:hover { border-color: var(--blue); box-shadow: 0 8px 20px rgba(15, 79, 184, .12); transform: translateY(-2px); }
.qz__type[aria-pressed="true"] { border-color: var(--blue); background: #f2f7ff; }
.qz__type b { font: 700 .98rem/1.25 var(--font-head); color: var(--ink); }
.qz__type small { font-size: .82rem; color: var(--steel); }
.qz__type-ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: #e7effc; margin-bottom: .4rem; }
.qz__type-ico svg { width: 22px; height: 22px; fill: none; stroke: var(--blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Preguntas */
.qz__q { border: 0; padding: 0; margin: 0 0 1.5rem; min-width: 0; }
.qz__q legend { font: 600 .95rem var(--font-head); color: var(--ink); margin-bottom: .6rem; padding: 0; }
.qz__q.is-error legend { color: #b42318; }
.qz__q.is-error .qz__pills { outline: 2px dashed #f3b0aa; outline-offset: 6px; border-radius: 8px; }
.qz__hint { display: block; font-size: .8rem; color: var(--steel); margin: -.3rem 0 .6rem; }
.qz__pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.qz__pill { border: 1.5px solid #d3dbe7; background: #fff; color: var(--ink); border-radius: 999px; padding: .6rem 1rem; font: 500 .9rem var(--font-body); cursor: pointer; transition: .15s; }
.qz__pill:hover { border-color: var(--blue); }
.qz__pill[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.qz__q select, .qz__q input, .qz__q textarea, .qz__form input { width: 100%; font: 400 1rem var(--font-body); padding: .8rem 1rem; border: 1px solid #d3dbe7; border-radius: 10px; color: var(--ink); background: #fff; }
.qz__q select:focus, .qz__q input:focus, .qz__q textarea:focus, .qz__form input:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: transparent; }
.qz__form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.qz__form label { display: grid; gap: .35rem; font: 600 .85rem var(--font-head); color: var(--ink); }
.qz__form label:first-child { grid-column: 1 / -1; }
.qz__check { display: flex; gap: .7rem; align-items: flex-start; font-size: .88rem; cursor: pointer; }
.qz__check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--blue); flex: none; }
.qz .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Resumen */
.qz__summary { margin: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.qz__summary div { display: grid; grid-template-columns: 200px 1fr; gap: 1rem; padding: .75rem 1.1rem; }
.qz__summary div:nth-child(odd) { background: var(--bg-alt); }
.qz__summary dt { font-size: .85rem; color: var(--steel); }
.qz__summary dd { margin: 0; color: var(--ink); font-weight: 500; }
.qz__edit { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: 1rem 0 0; }
.qz__link { background: none; border: 0; padding: 0; color: var(--blue); font: 600 .85rem var(--font-body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.qz__fail { margin: 1.2rem 0 .8rem; color: #b42318; font-weight: 600; }

/* Éxito */
.qz__done { text-align: center; display: grid; justify-items: center; gap: .6rem; padding: 1rem 0 .5rem; }
.qz__done-ico { width: 72px; height: 72px; border-radius: 50%; background: #e3f5ea; display: grid; place-items: center; animation: qzPop .4s ease; }
.qz__done-ico svg { width: 36px; height: 36px; fill: none; stroke: #147a3d; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.qz__done h3 { font-size: 1.5rem; margin: .4rem 0 0; }
.qz__done p { margin: 0; max-width: 46ch; }
.qz__folio { font: 700 .9rem var(--font-head); letter-spacing: .08em; color: var(--blue); background: #e7effc; padding: .35rem .8rem; border-radius: 999px; }
.qz__done .btn { margin-top: .4rem; }
@keyframes qzPop { from { transform: scale(.6); opacity: 0; } }

.qz__foot { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.8rem; border-top: 1px solid var(--line); background: #fff; }
.qz__error { flex: 1; text-align: center; color: #b42318; font-size: .88rem; font-weight: 600; }
.qz__next { min-width: 170px; }

@media (max-width: 640px) {
  .qz { padding: 0; place-items: end stretch; }
  .qz__panel { max-width: none; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .qz__head { padding: 1.2rem 16px .8rem; }
  .qz__steps { padding: .7rem 16px .5rem; }
  .qz__steps span { display: none; }
  .qz__steps li { flex: none; }
  .qz__steps li.is-current span { display: inline; }
  .qz__body { padding: 1.2rem 16px; }
  .qz__foot { padding: .8rem 16px; flex-wrap: wrap; }
  .qz__error { order: -1; flex-basis: 100%; }
  .qz__next { flex: 1; min-width: 0; }
  .qz__form { grid-template-columns: 1fr; }
  .qz__summary div { grid-template-columns: 1fr; gap: .1rem; }
  .qz__types { grid-template-columns: 1fr 1fr; }
  .qz__type { padding: .9rem; }
}
@media (max-width: 380px) { .qz__types { grid-template-columns: 1fr; } }
.qz [hidden] { display: none !important; }
@media (max-height: 720px) {
  .qz__intro { display: none; }
  .qz__head { padding-top: 1rem; padding-bottom: .6rem; }
}
.qz { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.qz__panel { min-width: 0; }
.qz__types { grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); }
.qz__type { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .qz { justify-items: stretch; }
  .qz__types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 380px) { .qz__types { grid-template-columns: minmax(0, 1fr); } }
