/* =========================================================
   COTIZADOR INTERACTIVO — Ideas Con Arte
   Estilos autocontenidos con prefijo qz- (no colisionan
   con style.css, al que complementan vía sus variables).
   ========================================================= */

/* ---------- Botón CTA del menú de navegación ---------- */
.nav-cta {
  display: inline-flex;
  align-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
}

.nav-cta:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
}

.nav-link.active {
  color: var(--accent);
  font-weight: 700;
}

/* ---------- Layout general ---------- */
.qz-main {
  padding: 9.5rem 0 4rem;
  background: var(--bg-alt);
  min-height: 100vh;
}

.qz-container {
  width: 90%;
  max-width: 780px;
  margin: 0 auto;
}

.qz-head {
  text-align: center;
  margin-bottom: 2rem;
}

.qz-head h1 {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.qz-head p {
  color: var(--text-muted);
  font-size: 1rem;
}

.qz-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

/* ---------- Aviso de error (query param ?error=) ---------- */
.qz-notice {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.qz-notice.show {
  display: block;
}

/* ---------- Barra de progreso ---------- */
.qz-progress {
  margin-bottom: 2rem;
}

.qz-progress-track {
  height: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.qz-progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.qz-progress-steps {
  display: flex;
  justify-content: space-between;
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.qz-progress-steps span.active {
  color: var(--accent);
  font-weight: 700;
}

.qz-progress-steps span.done {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Pasos ---------- */
.qz-step {
  display: none;
}

.qz-step.active {
  display: block;
  animation: qzFade 0.35s ease;
}

@keyframes qzFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.qz-step-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.qz-step-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* ---------- Tarjetas de opción (radio) ---------- */
.qz-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.9rem;
}

.qz-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.qz-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  cursor: pointer;
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  min-height: 64px;
}

.qz-card:hover {
  border-color: #f9a8b8;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.qz-card.selected,
.qz-card input:checked + .qz-card-body,
.qz-card:has(input:checked) {
  border-color: var(--accent);
  background: #fff5f7;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12);
}

.qz-card-icon {
  width: 34px;
  height: 34px;
  color: var(--accent);
  flex-shrink: 0;
}

.qz-card-icon svg {
  width: 100%;
  height: 100%;
}

.qz-card-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
  line-height: 1.3;
}

.qz-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ---------- Chips de opción (checkbox) ---------- */
.qz-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.qz-check {
  position: relative;
}

.qz-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.qz-check span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 0.6rem 1.05rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  background: var(--surface);
  transition: all var(--transition);
  user-select: none;
}

.qz-check span::before {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  transition: all var(--transition);
}

.qz-check:hover span {
  border-color: #f9a8b8;
}

.qz-check input:checked + span {
  border-color: var(--accent);
  background: #fff5f7;
  color: var(--text);
}

.qz-check input:checked + span::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px #fff;
}

.qz-check input:focus-visible + span,
.qz-card input:focus-visible + .qz-card-body,
.qz-card:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Grupos de campos ---------- */
.qz-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 1.75rem;
}

.qz-fieldset:last-child {
  margin-bottom: 0;
}

.qz-legend {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.85rem;
  display: block;
}

.qz-legend .qz-req {
  color: var(--accent);
}

.qz-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  display: block;
  margin-top: 0.3rem;
}

/* ---------- Grupos condicionales del paso 3 ---------- */
.qz-group {
  display: none;
}

.qz-group.active {
  display: block;
}

/* ---------- Campos de texto ---------- */
.qz-field {
  margin-bottom: 1.25rem;
}

.qz-field label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.qz-field input,
.qz-field select,
.qz-field textarea {
  width: 100%;
  padding: 0.95rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color var(--transition);
  min-height: 52px;
}

.qz-field textarea {
  min-height: 110px;
  resize: vertical;
}

.qz-field input:focus,
.qz-field select:focus,
.qz-field textarea:focus {
  border-color: var(--accent);
}

.qz-field input::placeholder,
.qz-field textarea::placeholder {
  color: #9ca3af;
}

.qz-field.invalid input,
.qz-field.invalid select,
.qz-field.invalid textarea {
  border-color: #f87171;
}

.qz-error {
  display: block;
  color: #dc2626;
  font-size: 0.82rem;
  margin-top: 0.35rem;
  min-height: 1em;
}

.qz-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Checkbox de aceptación */
.qz-accept {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.qz-accept input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.qz-accept a {
  color: var(--accent);
  text-decoration: underline;
  font-weight: 600;
}

/* Honeypot: invisible para humanos */
.qz-hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 0;
  width: 0;
  overflow: hidden;
}

/* ---------- Navegación entre pasos ---------- */
.qz-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 2.25rem;
  flex-wrap: wrap;
}

.qz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.9rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition), opacity var(--transition);
  min-height: 52px;
}

.qz-btn-primary {
  background: var(--accent);
  color: #fff;
}

.qz-btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.qz-btn-secondary {
  background: #16a34a;
  color: #fff;
}

.qz-btn-secondary:hover {
  background: #15803d;
  transform: translateY(-2px);
}

.qz-btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 2px solid var(--border);
}

.qz-btn-ghost:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.qz-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.qz-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: qzSpin 0.8s linear infinite;
}

@keyframes qzSpin {
  to { transform: rotate(360deg); }
}

/* ---------- Resumen (paso 6) ---------- */
.qz-summary-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
  background: var(--bg-alt);
}

.qz-summary-group h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.qz-modify {
  background: none;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-transform: none;
  letter-spacing: 0;
  padding: 0;
}

.qz-summary-group dl {
  margin: 0;
}

.qz-summary-group dt {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.qz-summary-group dd {
  font-size: 0.95rem;
  color: var(--text);
  margin: 0.1rem 0 0;
  line-height: 1.5;
  word-break: break-word;
}

/* ---------- Confirmación (renderizada por cotizar.php) ---------- */
.qz-confirm {
  text-align: center;
}

.qz-confirm-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  color: #16a34a;
}

.qz-confirm-icon svg {
  width: 100%;
  height: 100%;
}

.qz-ref {
  display: inline-block;
  background: #fff5f7;
  border: 2px dashed var(--accent);
  color: var(--accent);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  border-radius: var(--radius);
  padding: 0.6rem 1.4rem;
  margin: 1rem 0 1.5rem;
}

.qz-confirm .qz-summary-group {
  text-align: left;
}

.qz-mail-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  font-size: 0.92rem;
  margin: 1.25rem 0;
  text-align: center;
}

.qz-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .qz-main {
    padding-top: 7.5rem;
  }

  .qz-cards {
    grid-template-columns: 1fr;
  }

  .qz-field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .qz-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .qz-actions .qz-btn {
    width: 100%;
  }

  .qz-progress-steps span {
    font-size: 0.65rem;
  }

  .logo img {
    height: 60px;
  }
}
