/* ═══════════════════════════════════════════════════════════════════════
   Lazzo Bienestar · Cliente — Cuestionario cifrado (C5)
   Layout flex column robusto + sticky bottom (mismo patrón que resumen).
   Scope `.bcl-cu-*`. z-index 1090 entre intro (1100) y resumen (1080).
   ═══════════════════════════════════════════════════════════════════════ */

.bcl-cu-overlay {
  position: fixed; inset: 0;
  z-index: 1090;
  background: var(--bcl-bg, #fdf6f0);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.bcl-cu-overlay.open { transform: translateX(0); pointer-events: auto; }

.bcl-cu-inner {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  color: var(--bcl-txt);
}
.bcl-cu-content-grow { flex: 1 0 auto; }

/* ── Topbar ─────────────────────────────────────────────────────────────── */
.bcl-cu-topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 14px 18px 8px;
  background: linear-gradient(180deg, var(--bcl-bg) 70%, transparent 100%);
}
.bcl-cu-back {
  width: 38px; height: 38px;
  border: 0; border-radius: 50%;
  background: rgba(255,255,255,.85);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 1px 6px -2px rgba(0,0,0,.10);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--bcl-txt);
  flex-shrink: 0;
}
.bcl-cu-back i { width: 18px; height: 18px; }
.bcl-cu-back:active { transform: scale(.95); }
.bcl-cu-title {
  flex: 1;
  text-align: center;
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
  font-size: 18px;
  color: var(--bcl-txt);
}

/* ── Intro ──────────────────────────────────────────────────────────────── */
.bcl-cu-intro {
  margin: 0 18px 16px;
  padding: 0 4px;
}
.bcl-cu-intro .t1 {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--bcl-txt);
}
.bcl-cu-intro .t2 {
  margin-top: 8px;
  display: flex; gap: 8px; align-items: center;
  font-size: 12.5px;
  color: var(--bcl-muted);
}
.bcl-cu-intro .t2 i {
  width: 14px; height: 14px;
  color: var(--bcl-c1-d, #7858b6);
  flex-shrink: 0;
}

/* ── Countdown warn (solo cuando <3min) ─────────────────────────────────── */
.bcl-cu-cd-warn {
  margin: 0 18px 14px;
  padding: 11px 14px;
  display: flex; gap: 10px; align-items: center;
  background: #fff4d6;
  border: 1px solid #f1d985;
  border-radius: 12px;
  font-size: 13px;
  color: #6b5616;
  animation: bcl-cu-warn-pulse 1.6s ease-in-out infinite;
}
.bcl-cu-cd-warn i { width: 18px; height: 18px; flex-shrink: 0; color: #c89510; }
.bcl-cu-cd-warn strong {
  font-variant-numeric: tabular-nums;
  color: #7e3030;
}
@keyframes bcl-cu-warn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231,168,40,0); }
  50%      { box-shadow: 0 0 0 6px rgba(231,168,40,.15); }
}

/* ── Lista preguntas ────────────────────────────────────────────────────── */
.bcl-cu-preguntas {
  display: flex; flex-direction: column; gap: 14px;
  padding: 0 18px;
}
.bcl-cu-q {
  background: white;
  border: 1px solid var(--bcl-line);
  border-radius: 16px;
  padding: 16px 16px 14px;
}
.bcl-cu-q-label {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--bcl-txt);
  margin-bottom: 12px;
  line-height: 1.45;
}
.bcl-cu-req {
  color: #c1393b;
  margin-left: 4px;
}
.bcl-cu-opt {
  font-weight: 400;
  font-size: 12px;
  color: var(--bcl-muted);
  margin-left: 6px;
}
.bcl-cu-loading {
  margin: 24px 18px;
  padding: 24px;
  text-align: center;
  color: var(--bcl-muted);
  font-size: 14px;
  background: white;
  border: 1px dashed var(--bcl-line);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.bcl-cu-loading i { width: 18px; height: 18px; }
.bcl-cu-spin { animation: bcl-cu-spin 1s linear infinite; }
@keyframes bcl-cu-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Textarea ──────────────────────────────────────────────────────────── */
.bcl-cu-textarea {
  width: 100%;
  border: 1.5px solid var(--bcl-line);
  border-radius: 12px;
  padding: 11px 13px;
  background: var(--bcl-bg-soft, #fff8f3);
  font: inherit;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--bcl-txt);
  resize: vertical;
  min-height: 60px;
  outline: none;
  transition: border-color .15s, background .15s;
  -webkit-appearance: none;
}
.bcl-cu-textarea:focus {
  border-color: var(--bcl-c1, #9b7fd4);
  background: white;
}
.bcl-cu-textarea::placeholder { color: var(--bcl-muted); }
.bcl-cu-textarea.hidden { display: none; }
.bcl-cu-counter {
  margin-top: 6px;
  text-align: right;
  font-size: 11.5px;
  color: var(--bcl-muted);
  font-variant-numeric: tabular-nums;
}

/* ── Escala 1-10 ────────────────────────────────────────────────────────── */
.bcl-cu-scale-wrap {
  display: flex; flex-direction: column; gap: 8px;
}
.bcl-cu-scale-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}
.bcl-cu-scale-btn {
  padding: 10px 0;
  border: 1.5px solid var(--bcl-line);
  border-radius: 10px;
  background: white;
  color: var(--bcl-txt);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s, border-color .15s, background .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
}
.bcl-cu-scale-btn:hover {
  border-color: var(--bcl-c1, #9b7fd4);
}
.bcl-cu-scale-btn:active { transform: scale(.94); }
.bcl-cu-scale-btn.selected {
  background: var(--bcl-grad);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px -4px rgba(155,127,212,.5);
}
.bcl-cu-scale-leyenda {
  display: flex; justify-content: space-between;
  font-size: 11.5px;
  color: var(--bcl-muted);
  padding: 0 2px;
}

/* ── Sí / No ────────────────────────────────────────────────────────────── */
.bcl-cu-yesno {
  display: flex; gap: 10px;
  margin-bottom: 8px;
}
.bcl-cu-yn-btn {
  flex: 1;
  padding: 12px 14px;
  border: 1.5px solid var(--bcl-line);
  border-radius: 12px;
  background: white;
  color: var(--bcl-txt);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s, border-color .15s, background .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.bcl-cu-yn-btn:hover { border-color: var(--bcl-c1, #9b7fd4); }
.bcl-cu-yn-btn:active { transform: scale(.97); }
.bcl-cu-yn-btn.selected {
  background: var(--bcl-grad);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px -4px rgba(155,127,212,.5);
}
.bcl-cu-snt-extra { margin-top: 4px; }

/* ── Consentimiento ─────────────────────────────────────────────────────── */
.bcl-cu-consent-card {
  margin: 22px 18px 14px;
  padding: 18px 18px 14px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--bcl-c1, #9b7fd4) 8%, white),
    white 65%);
  border: 1px solid color-mix(in srgb, var(--bcl-c1, #9b7fd4) 22%, var(--bcl-line));
  border-radius: 18px;
}
.bcl-cu-consent-card h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 19px;
  font-weight: 400;
  color: var(--bcl-c1-d, #7858b6);
  margin: 0 0 8px;
}
.bcl-cu-consent-intro {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--bcl-txt);
  margin-bottom: 12px;
}
.bcl-cu-consent-link a {
  display: inline-flex; gap: 6px; align-items: center;
  color: var(--bcl-c1-d, #7858b6);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  margin: 0 0 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--bcl-c1, #9b7fd4) 30%, transparent);
  padding-bottom: 1px;
}
.bcl-cu-consent-link a i { width: 14px; height: 14px; }
.bcl-cu-consent-link a:hover {
  border-bottom-color: var(--bcl-c1-d, #7858b6);
}

.bcl-cu-checkbox {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 0;
  cursor: pointer;
  user-select: none;
}
.bcl-cu-checkbox + .bcl-cu-checkbox {
  border-top: 1px solid color-mix(in srgb, var(--bcl-c1, #9b7fd4) 12%, transparent);
}
.bcl-cu-checkbox input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 22px; height: 22px;
  border: 2px solid var(--bcl-line);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  position: relative;
  transition: border-color .15s, background .15s;
}
.bcl-cu-checkbox input[type="checkbox"]:hover {
  border-color: var(--bcl-c1, #9b7fd4);
}
.bcl-cu-checkbox input[type="checkbox"]:checked {
  background: var(--bcl-grad);
  border-color: transparent;
}
.bcl-cu-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 6px; top: 2px;
  width: 6px; height: 11px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.bcl-cu-cb-text {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--bcl-txt);
}

/* ── Footer CTA ─────────────────────────────────────────────────────────── */
.bcl-cu-cta {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;
  margin-top: 14px;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  background: rgba(253,246,240,.95);
  -webkit-backdrop-filter: blur(20px);
          backdrop-filter: blur(20px);
  border-top: 1px solid var(--bcl-line);
  box-shadow: 0 -8px 24px -16px rgba(0,0,0,.08);
}
.bcl-cu-btn-primary {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  border: 0; border-radius: 14px;
  padding: 13px 18px;
  background: var(--bcl-grad);
  color: white;
  font: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, opacity .15s;
  box-shadow: 0 6px 18px -8px rgba(155,127,212,.55);
}
.bcl-cu-btn-primary:hover { transform: translateY(-1px); }
.bcl-cu-btn-primary:active { transform: translateY(0); }
.bcl-cu-btn-primary:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.bcl-cu-btn-primary i { width: 16px; height: 16px; }

.bcl-cu-btn-secondary {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--bcl-line);
  border-radius: 14px;
  padding: 12px 16px;
  background: white;
  color: var(--bcl-txt);
  font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.bcl-cu-btn-secondary:hover {
  background: var(--bcl-bg-soft, #fff8f3);
}

@media (max-width: 380px) {
  .bcl-cu-cta { flex-direction: column-reverse; align-items: stretch; }
  .bcl-cu-btn-secondary { width: 100%; }
  .bcl-cu-scale-grid { grid-template-columns: repeat(5, 1fr); }
}
