/* ============================================================
   overlay-contact.css — Modal de contacto QuVi
   Nomenclatura: cq-* (ContactoQuvi)
   Z-index: --z-modal (2000) / --z-modal-panel (2001)
   ============================================================ */

/* ─── Backdrop ────────────────────────────────────────────── */
.cq-backdrop {
  position: fixed; inset: 0;
  z-index: var(--z-modal, 2000);
  background: rgba(15,20,34,.28);
  opacity: 0; pointer-events: none;
  transition: opacity .22s var(--motion-ease, ease);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .cq-backdrop {
    background: rgba(15,20,34,.16);
    -webkit-backdrop-filter: saturate(110%) blur(3px);
    backdrop-filter: saturate(110%) blur(3px);
  }
}
.cq-backdrop.is-open { opacity: 1; pointer-events: auto; }

/* ─── Container ───────────────────────────────────────────── */
.cq-wrap {
  position: fixed; inset: 0;
  z-index: var(--z-modal-panel, 2001);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  padding: 16px;
}
.cq-wrap.is-open { pointer-events: auto; }

/* ─── Dialog ──────────────────────────────────────────────── */
.cq-dialog {
  position: relative;
  background: var(--surface, #fff);
  border-radius: 24px;
  width: min(560px, 100%);
  max-height: calc(100dvh - 80px);
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow:
    0 24px 64px rgba(2,6,23,.18),
    0 4px 16px rgba(2,6,23,.08);
  transform: scale(.96) translateY(8px);
  opacity: 0;
  transition:
    transform .28s cubic-bezier(.22,.61,.36,1),
    opacity .22s ease;
  outline: none;
}
.cq-wrap.is-open .cq-dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* ─── Header ──────────────────────────────────────────────── */
.cq-head {
  background: linear-gradient(135deg, #0a5fd1 0%, #2279e8 100%);
  padding: 20px 20px 16px;
  flex: 0 0 auto;
  display: flex; flex-direction: column; gap: 12px;
}
.cq-head__top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.cq-head__brand {
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: rgba(255,255,255,.7);
}
.cq-head__close {
  appearance: none; border: 0;
  background: rgba(255,255,255,.18); color: #fff;
  border-radius: 50%; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; line-height: 0; flex: 0 0 auto;
  transition: background .15s ease;
}
.cq-head__close:hover { background: rgba(255,255,255,.28); }
.cq-head__close:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(255,255,255,.8); }
.cq-head__close i, .cq-head__close svg { width: 16px; height: 16px; display: block; }

.cq-head__copy { display: flex; flex-direction: column; gap: 3px; }
.cq-head__title {
  font-size: 19px; font-weight: 700; line-height: 1.15;
  color: #fff; margin: 0;
}
.cq-head__sub {
  font-size: 13px; line-height: 1.5;
  color: rgba(255,255,255,.72); margin: 0;
}

/* ─── Step progress ───────────────────────────────────────── */
.cq-steps {
  display: flex; align-items: center; gap: 5px;
}
.cq-step {
  height: 3px; border-radius: 99px;
  background: rgba(255,255,255,.25);
  flex: 1;
  transition: background .28s ease;
}
.cq-step.is-active { background: #fff; }
.cq-step.is-done   { background: rgba(255,255,255,.55); }

/* ─── Body ────────────────────────────────────────────────── */
.cq-body {
  flex: 1 1 auto; overflow-y: auto; min-height: 0;
  overscroll-behavior: contain;
  padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.cq-body::-webkit-scrollbar { width: 4px; }
.cq-body::-webkit-scrollbar-track { background: transparent; }
.cq-body::-webkit-scrollbar-thumb {
  background: var(--separator, #e6eaf0);
  border-radius: 2px;
}

/* ─── Footer / actions ────────────────────────────────────── */
.cq-foot {
  border-top: 1px solid var(--separator, #e6eaf0);
  padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex: 0 0 auto;
  background: var(--surface, #fff);
}
.cq-foot--end { justify-content: flex-end; }

/* ─── Buttons ─────────────────────────────────────────────── */
.cq-btn {
  appearance: none; border: 0;
  font: 600 13.5px/1.2 var(--font, system-ui);
  padding: 9px 18px; border-radius: 99px;
  cursor: pointer; white-space: nowrap;
  transition: all .14s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.cq-btn i, .cq-btn svg { width: 14px; height: 14px; display: block; }

.cq-btn--ghost {
  background: var(--fill, #f4f6fa);
  color: var(--secondary, #6b7280);
}
.cq-btn--ghost:hover {
  background: var(--separator, #e6eaf0);
  color: var(--label, #111827);
}
.cq-btn--primary {
  background: var(--brand, #0d99ff);
  color: #fff;
}
.cq-btn--primary:hover { filter: brightness(1.07); }
.cq-btn--primary:disabled {
  background: var(--tint-disabled, #b3d9ff);
  cursor: not-allowed;
  filter: none;
}
.cq-btn--primary.is-loading { opacity: .7; cursor: wait; }

/* ─── Section label ───────────────────────────────────────── */
.cq-section-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--secondary, #6b7280); margin: 0;
}

/* ─── Intent badge ────────────────────────────────────────── */
.cq-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; line-height: 1;
  padding: 5px 11px; border-radius: 99px;
  background: color-mix(in oklch, var(--brand, #0d99ff) 10%, var(--surface, #fff) 90%);
  color: var(--brand, #0d99ff);
  border: 1px solid color-mix(in oklch, var(--brand, #0d99ff) 22%, transparent 78%);
}
.cq-badge i, .cq-badge svg { width: 11px; height: 11px; display: block; }

/* ─── Intent grid (step 1) ────────────────────────────────── */
.cq-intents {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.cq-intent {
  appearance: none;
  border: 1.5px solid var(--separator, #e6eaf0);
  background: var(--surface, #fff);
  border-radius: var(--rad-lg, 16px);
  padding: 13px 13px 11px;
  cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color .14s ease, background .14s ease,
              box-shadow .14s ease, transform .14s ease;
}
.cq-intent:hover {
  border-color: var(--brand, #0d99ff);
  background: color-mix(in oklch, var(--brand, #0d99ff) 5%, var(--surface, #fff) 95%);
  box-shadow: 0 2px 12px color-mix(in oklch, var(--brand, #0d99ff) 20%, transparent 80%);
  transform: translateY(-1px);
}
.cq-intent.is-selected {
  border-color: var(--brand, #0d99ff);
  background: color-mix(in oklch, var(--brand, #0d99ff) 7%, var(--surface, #fff) 93%);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--brand, #0d99ff) 18%, transparent 82%);
}
.cq-intent__icon {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto;
  background: var(--fill, #f4f6fa);
  display: flex; align-items: center; justify-content: center;
  transition: background .14s ease;
}
.cq-intent:hover .cq-intent__icon,
.cq-intent.is-selected .cq-intent__icon {
  background: color-mix(in oklch, var(--brand, #0d99ff) 14%, white 86%);
}
.cq-intent__icon i, .cq-intent__icon svg {
  width: 16px; height: 16px; display: block;
  color: var(--brand, #0d99ff);
}
.cq-intent__label {
  font-size: 12.5px; font-weight: 600; line-height: 1.3;
  color: var(--label, #111827);
}
.cq-intent__desc {
  font-size: 11px; line-height: 1.5;
  color: var(--secondary, #6b7280);
}

/* ─── Suggestion chips (step 2) ──────────────────────────── */
.cq-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.cq-chip {
  appearance: none;
  border: 1px solid var(--separator, #e6eaf0);
  background: var(--fill, #f4f6fa);
  color: var(--label, #111827);
  font: 500 12px/1 var(--font, system-ui);
  padding: 7px 12px; border-radius: 99px; cursor: pointer;
  transition: all .12s ease;
  text-align: left;
}
.cq-chip:hover {
  background: color-mix(in oklch, var(--brand, #0d99ff) 8%, var(--surface, #fff) 92%);
  border-color: var(--brand, #0d99ff);
  color: var(--brand, #0d99ff);
}
.cq-chip.is-active {
  background: color-mix(in oklch, var(--brand, #0d99ff) 10%, var(--surface, #fff) 90%);
  border-color: var(--brand, #0d99ff);
  color: var(--brand, #0d99ff);
  font-weight: 600;
}

/* ─── Fields ──────────────────────────────────────────────── */
.cq-fields { display: flex; flex-direction: column; gap: 12px; }
.cq-fields--row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.cq-field { display: flex; flex-direction: column; gap: 5px; }
.cq-field label {
  font-size: 13px; font-weight: 600; color: var(--label, #111827);
}
.cq-field label .cq-opt {
  font-weight: 400; color: var(--secondary, #6b7280); font-size: 12px;
}
.cq-field input,
.cq-field textarea {
  appearance: none;
  background: var(--fill, #f4f6fa);
  border: 1.5px solid var(--separator, #e6eaf0);
  border-radius: var(--rad-md, 12px);
  padding: 10px 13px;
  font: 400 14px/1.4 var(--font, system-ui);
  color: var(--label, #111827);
  width: 100%; box-sizing: border-box;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
  outline: none;
}
.cq-field input::placeholder,
.cq-field textarea::placeholder { color: var(--secondary, #6b7280); }
.cq-field input:focus,
.cq-field textarea:focus {
  border-color: var(--brand, #0d99ff);
  background: var(--surface, #fff);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--brand, #0d99ff) 14%, transparent 86%);
}
.cq-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
.cq-field select:focus {
  border-color: var(--brand, #0d99ff);
  background-color: var(--surface, #fff);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--brand, #0d99ff) 14%, transparent 86%);
}
.cq-field textarea {
  resize: vertical; min-height: 110px; max-height: 240px; line-height: 1.55;
}
.cq-field--error input,
.cq-field--error textarea { border-color: var(--error, #f87171); }
.cq-field__err {
  font-size: 11.5px; color: var(--error-ink, #dc2626); display: none;
}
.cq-field--error .cq-field__err { display: block; }

.cq-char {
  font-size: 11px; color: var(--secondary, #6b7280);
  text-align: right; margin-top: 4px;
}
.cq-char.is-warn { color: var(--warn-ink, #b45309); }

/* ─── Consent ─────────────────────────────────────────────── */
.cq-consent {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  background: var(--fill, #f4f6fa);
  border-radius: var(--rad-md, 12px);
}
.cq-consent input[type="checkbox"] {
  flex: 0 0 auto; margin-top: 1px;
  width: 15px; height: 15px; cursor: pointer;
  accent-color: var(--brand, #0d99ff);
}
.cq-consent label {
  font-size: 12px; line-height: 1.55; color: var(--secondary, #6b7280); cursor: pointer;
}
.cq-consent label a { color: var(--brand, #0d99ff); text-decoration: none; }
.cq-consent label a:hover { text-decoration: underline; }

/* ─── Error message bar ───────────────────────────────────── */
.cq-err {
  display: none; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--error-ink, #dc2626);
  padding: 10px 13px; border-radius: var(--rad-md, 12px);
  background: var(--error-bg, #fef2f2);
  border: 1px solid color-mix(in oklch, var(--error, #f87171) 28%, transparent 72%);
}
.cq-err.is-visible { display: flex; }
.cq-err i, .cq-err svg { width: 13px; height: 13px; display: block; flex: 0 0 auto; }

/* ─── Honeypot ────────────────────────────────────────────── */
.cq-hp {
  position: absolute; left: -9999px; width: 1px; height: 1px;
  overflow: hidden; opacity: 0; pointer-events: none;
}

/* ─── Success ─────────────────────────────────────────────── */
.cq-success {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 28px 24px 24px; gap: 10px;
}
.cq-success__ring {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--success-bg, #f0fdf4);
  display: flex; align-items: center; justify-content: center;
  color: var(--success, #22c55e);
  box-shadow: 0 0 0 8px color-mix(in oklch, var(--success, #22c55e) 10%, transparent 90%);
}
.cq-success__ring i, .cq-success__ring svg { width: 28px; height: 28px; display: block; }
.cq-success__title {
  font-size: 18px; font-weight: 700; color: var(--label, #111827);
  margin: 6px 0 0;
}
.cq-success__sub {
  font-size: 14px; line-height: 1.55; color: var(--secondary, #6b7280);
  margin: 0; max-width: 340px;
}
.cq-success__note {
  font-size: 12px; color: var(--secondary, #6b7280);
  padding: 10px 16px;
  background: var(--fill, #f4f6fa);
  border-radius: var(--rad-md, 12px);
  margin-top: 8px;
}

/* ─── Mobile ──────────────────────────────────────────────── */
@media (max-width: 599px) {
  .cq-wrap {
    padding: 0;
    align-items: flex-end;
  }
  .cq-dialog {
    width: 100%;
    max-height: 94dvh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    opacity: 1;
  }
  .cq-wrap.is-open .cq-dialog { transform: translateY(0); }
  .cq-intents { grid-template-columns: 1fr; }
  .cq-fields--row { grid-template-columns: 1fr; }
}

/* ─── Dark mode ───────────────────────────────────────────── */
body.oscuro .cq-dialog {
  box-shadow: 0 24px 64px rgba(0,0,0,.5), 0 4px 16px rgba(0,0,0,.3);
}
