/* Escáner de piel — diagnostico-pro.html */
.dx { padding: 40px 0 72px; min-height: calc(100vh - 140px); background:
  radial-gradient(900px 500px at 85% -10%, var(--color-accent-soft), transparent 60%),
  radial-gradient(700px 500px at -10% 110%, var(--color-bg-alt), transparent 60%); }
.dx-grid { display: grid; grid-template-columns: 380px 1fr; gap: 40px; align-items: start; }

/* ---------- Escáner ---------- */
.dx-scanner { position: sticky; top: 96px; background: var(--color-bg-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-soft); }
.dx-face-wrap { position: relative; width: 190px; margin: 0 auto 20px; }
.dx-face { width: 100%; display: block; overflow: visible; }
.dx-face-fill { fill: var(--color-accent-soft); }
.dx-face-line { stroke: var(--color-primary); stroke-width: 1.5; }
.dx-mesh path { stroke: var(--color-primary-light); stroke-width: .6; opacity: .7; }
.dx-zone circle { fill: var(--color-border); transition: fill .4s, r .4s; }
.dx-zone.on circle { fill: var(--color-accent); r: 7; animation: dxPulse 1.6s ease-out infinite; }
.dx-beam { animation: dxScan 3.2s ease-in-out infinite; opacity: .85; filter: drop-shadow(0 0 6px var(--color-accent)); }
.dx-ring-label { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); background: var(--color-white);
  border: 1px solid var(--color-border); border-radius: var(--radius-pill); padding: 6px 16px; text-align: center; white-space: nowrap; box-shadow: var(--shadow-card); }
.dx-ring-label span { font-family: var(--font-heading); font-size: 1.1rem; color: var(--color-primary-dark); margin-right: 6px; }
.dx-ring-label small { color: var(--color-text-light); font-size: .75rem; }

.dx-metrics { margin-top: 36px; }
.dx-metrics h2 { font-size: 1rem; margin-bottom: 14px; color: var(--color-text); }
.dx-metric { display: grid; grid-template-columns: 1fr 120px; gap: 12px; align-items: center; margin-bottom: 12px; font-size: .85rem; color: var(--color-text-light); }
.dx-metric i { display: block; height: 8px; background: var(--color-bg-alt); border-radius: var(--radius-pill); overflow: hidden; }
.dx-metric b { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--color-primary-light), var(--color-accent)); transition: width .8s cubic-bezier(.2,.8,.2,1); }

/* ---------- Panel ---------- */
.dx-panel { background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: 44px; box-shadow: var(--shadow-soft); min-height: 560px; display: flex; flex-direction: column; justify-content: center; }
.dx-panel [hidden] { display: none !important; }
.dx-panel h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); line-height: 1.15; margin: 10px 0 16px; }
.dx-panel h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.2; }
.dx-intro p { color: var(--color-text-light); max-width: 52ch; margin-bottom: 22px; }
.dx-bullets { list-style: none; padding: 0; margin: 0 0 30px; display: grid; gap: 10px; }
.dx-bullets li { display: flex; align-items: center; gap: 10px; color: var(--color-text); }
.dx-bullets svg { width: 20px; height: 20px; fill: none; stroke: var(--color-accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; padding: 3px; background: var(--color-accent-soft); border-radius: 50%; }
.dx-start { padding: 16px 36px; font-size: 1.02rem; }

/* Top bar */
.dx-top { display: flex; align-items: center; gap: 16px; margin-bottom: 34px; }
.dx-back { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--color-border); background: var(--color-white); cursor: pointer; display: grid; place-items: center; transition: background .2s, opacity .2s; }
.dx-back:hover { background: var(--color-bg-alt); }
.dx-back[disabled] { opacity: .35; cursor: default; }
.dx-back svg { width: 18px; height: 18px; fill: none; stroke: var(--color-primary-dark); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dx-bar { flex: 1; height: 8px; background: var(--color-bg-alt); border-radius: var(--radius-pill); overflow: hidden; }
.dx-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--color-primary), var(--color-accent)); border-radius: inherit; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.dx-count { font-size: .85rem; color: var(--color-text-light); min-width: 34px; text-align: right; }

/* Pregunta */
.dx-question { animation: dxIn .45s cubic-bezier(.2,.8,.2,1); }
.dx-question.back { animation-name: dxInBack; }
.dx-question .eyebrow { display: block; margin-bottom: 8px; }
.dx-question > p { color: var(--color-text-light); margin: 8px 0 24px; }
.dx-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dx-opt { position: relative; text-align: left; background: var(--color-bg); border: 1.5px solid var(--color-border); border-radius: var(--radius-md);
  padding: 18px 18px 18px 18px; cursor: pointer; font: inherit; color: inherit; display: flex; gap: 14px; align-items: flex-start;
  transition: transform .2s, border-color .2s, box-shadow .2s, background .2s; }
.dx-opt:hover { transform: translateY(-3px); border-color: var(--color-primary-light); box-shadow: var(--shadow-card); background: var(--color-white); }
.dx-opt:focus-visible { outline: 3px solid var(--color-accent-light); outline-offset: 2px; }
.dx-opt.selected { border-color: var(--color-accent); background: var(--color-accent-soft); box-shadow: var(--shadow-card); }
.dx-emoji { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px; background: var(--color-white); display: grid; place-items: center; font-size: 1.4rem; border: 1px solid var(--color-border); }
.dx-opt h3 { font-family: var(--font-body); font-size: 1rem; font-weight: 600; margin: 0 0 4px; }
.dx-opt p { font-size: .83rem; line-height: 1.4; color: var(--color-text-light); margin: 0; }
.dx-key { position: absolute; top: 10px; right: 12px; font-size: .7rem; color: var(--color-text-light); border: 1px solid var(--color-border); border-radius: 5px; padding: 0 6px; background: var(--color-white); }
.dx-hint { margin: 24px 0 0; font-size: .8rem; color: var(--color-text-light); text-align: center; }

/* Análisis */
.dx-analyzing { text-align: center; }
.dx-spinner { width: 84px; height: 84px; margin: 0 auto 22px; border-radius: 50%; border: 4px solid var(--color-bg-alt); border-top-color: var(--color-accent); border-right-color: var(--color-primary); animation: dxSpin 1s linear infinite; }
.dx-log { list-style: none; padding: 0; margin: 22px auto 0; max-width: 340px; text-align: left; display: grid; gap: 10px; }
.dx-log li { opacity: 0; transform: translateY(6px); transition: all .4s; color: var(--color-text-light); font-size: .92rem; display: flex; gap: 10px; align-items: center; }
.dx-log li.show { opacity: 1; transform: none; }
.dx-log li::before { content: '✓'; width: 20px; height: 20px; border-radius: 50%; background: var(--color-accent-soft); color: var(--color-accent); display: grid; place-items: center; font-size: .72rem; font-weight: 700; flex: none; }

/* Resultado */
.dx-result { animation: dxIn .6s cubic-bezier(.2,.8,.2,1); }
.dx-result > p { color: var(--color-text-light); margin: 10px 0 24px; max-width: 60ch; }
.dx-result-grid { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; margin-bottom: 26px; }
.dx-score { display: flex; align-items: center; gap: 16px; }
.dx-score svg { width: 104px; height: 104px; transform: rotate(-90deg); }
.dx-score circle { fill: none; stroke-width: 9; }
.dx-score .bg { stroke: var(--color-bg-alt); }
.dx-score .fg { stroke: var(--color-accent); stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 327; transition: stroke-dashoffset 1.4s cubic-bezier(.2,.8,.2,1); }
.dx-score strong { display: block; font-family: var(--font-heading); font-size: 2rem; color: var(--color-primary-dark); line-height: 1; }
.dx-score small { color: var(--color-text-light); font-size: .78rem; }
.dx-chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 220px; }
.dx-chip { background: var(--color-bg-alt); border-radius: var(--radius-pill); padding: 7px 14px; font-size: .82rem; color: var(--color-text); }
.dx-chip b { color: var(--color-primary-dark); font-weight: 600; }

.dx-routine { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 26px; }
.dx-prod { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 12px; text-align: center; opacity: 0; transform: translateY(10px); animation: dxIn .5s forwards; }
.dx-prod img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; margin-bottom: 8px; background: var(--color-white); }
.dx-prod span { display: block; font-size: .7rem; color: var(--color-accent); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.dx-prod strong { display: block; font-size: .85rem; font-weight: 500; margin-top: 2px; }
.dx-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.dx-disclaimer { margin: 18px 0 0; font-size: .76rem; color: var(--color-text-light); }

@keyframes dxScan { 0%, 100% { transform: translateY(8px); } 50% { transform: translateY(236px); } }
@keyframes dxPulse { 0% { filter: drop-shadow(0 0 0 rgba(169,74,97,.6)); } 100% { filter: drop-shadow(0 0 10px rgba(169,74,97,0)); } }
@keyframes dxIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes dxInBack { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes dxSpin { to { transform: rotate(360deg); } }

@media (max-width: 920px) {
  .dx { padding: 20px 0 48px; }
  .dx-grid { grid-template-columns: 1fr; gap: 20px; }
  .dx-scanner { position: static; display: grid; grid-template-columns: 120px 1fr; gap: 20px; align-items: center; padding: 18px; }
  .dx-face-wrap { width: 100px; margin: 0; }
  .dx-ring-label { display: none; }
  .dx-metrics { margin-top: 0; }
  .dx-metrics h2 { display: none; }
  .dx-metric { margin-bottom: 8px; grid-template-columns: 1fr 70px; font-size: .75rem; }
  .dx-panel { padding: 26px 20px; min-height: 0; }
}
@media (max-width: 560px) {
  .dx-options { grid-template-columns: 1fr; }
  .dx-key { display: none; }
  .dx-hint { display: none; }
  .dx-scanner { grid-template-columns: 96px minmax(0, 1fr); }
  .dx-metric { grid-template-columns: minmax(0, 1fr) 56px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .dx-beam, .dx-spinner, .dx-zone.on circle { animation: none; }
  .dx-question, .dx-result, .dx-prod { animation: none; opacity: 1; transform: none; }
}

/* Portada del test: escáner vivo a la izquierda, bienvenida y beneficios a la derecha. */
.dx-grid:has(.dx-intro:not([hidden])) { display: grid; grid-template-columns: minmax(380px,.88fr) minmax(0,1.12fr); gap: 22px; align-items: stretch; max-width: 1400px; }
.dx-grid:has(.dx-intro:not([hidden])) .dx-scanner { display: block; position: relative; top: auto; align-self: stretch; padding: 24px; background: rgba(255,253,250,.94); }
.dx-grid:has(.dx-intro:not([hidden])) .dx-panel { min-height: 0; padding: clamp(34px,4.4vw,64px); border-color: rgba(182,137,93,.25); background: rgba(255,253,250,.96); }
.dx-intro:not([hidden]) { display: block; }
.dx-intro-copy { align-self: center; }
.dx-intro-copy .eyebrow { color: #ad3f48; letter-spacing: .18em; }
.dx-intro-copy h1 { max-width: 700px; margin: 9px 0 16px; color: #4f3022; font-size: clamp(2.4rem,4vw,4rem); line-height: 1.06; letter-spacing: -.035em; }
.dx-intro-copy h1 em { color: #875638; font-weight: 500; }
.dx-intro-copy > p { max-width: 62ch; color: #5f554d; font-size: 1rem; line-height: 1.65; }
.dx-intro-copy .dx-bullets { margin: 20px 0 22px; gap: 10px; }
.dx-intro-copy .dx-bullets li { display: flex; align-items: center; gap: 13px; color: #504238; font-size: .9rem; }
.dx-intro-copy .dx-bullets svg { width: 38px; height: 38px; flex: 0 0 38px; padding: 9px; border: 1px solid #e4cdb6; border-radius: 50%; background: #f8ece3; color: #a53f48; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dx-intro-copy .dx-bullets strong, .dx-intro-copy .dx-bullets small { display: block; }
.dx-intro-copy .dx-bullets strong { color: #553a2b; font-family: var(--font-heading); font-size: 1.02rem; font-weight: 500; }
.dx-intro-copy .dx-bullets small { margin-top: 2px; color: #685d54; font-size: .82rem; line-height: 1.4; }
.dx-intro-copy .dx-start { min-width: 280px; min-height: 54px; justify-content: center; border-radius: 99px; background: #965e3e; box-shadow: 0 10px 24px rgba(115,76,46,.18); }
.dx-intro-copy .dx-start:hover { background: #70482f; }
.dx-intro-disclaimer { margin: 17px 0 0; padding-top: 13px; border-top: 1px solid #eadfd3; color: #766a60; font-size: .75rem; }
.dx-face-photo { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; object-position: center; }
.dx-photo-zones { position: absolute; z-index: 1; inset: 0; pointer-events: none; }
.dx-photo-zone { position: absolute; width: 14px; height: 14px; transform: translate(-50%,-50%); border: 1px solid rgba(167,116,72,.45); border-radius: 50%; background: rgba(201,151,109,.34); transition: background .35s, box-shadow .35s, transform .35s; }
.dx-photo-zone[data-zone="frente"] { left: 50%; top: 28%; }
.dx-photo-zone[data-zone="mejillaI"] { left: 38.5%; top: 60.5%; }
.dx-photo-zone[data-zone="mejillaD"] { left: 61.5%; top: 60.5%; }
.dx-photo-zone[data-zone="mentón"] { left: 50%; top: 84%; }
.dx-photo-zone.on { transform: translate(-50%,-50%) scale(1.14); border-color: #a7653d; background: #b77d51; box-shadow: 0 0 0 5px rgba(183,125,81,.18),0 0 14px rgba(164,98,56,.42); }
.dx-scanner .dx-face-wrap { width: 100%; max-width: 440px; margin: 0 auto 20px; }
.dx-photo-caption { display: none; }
.dx-grid:has(.dx-intro:not([hidden])) .dx-face-wrap { position: relative; width: 100%; max-width: none; margin: 0 auto 25px; overflow: hidden; border-radius: 8px; background: #f1e4d7; }
.dx-grid:has(.dx-intro:not([hidden])) .dx-face-photo { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; object-position: center; }
.dx-grid:has(.dx-intro:not([hidden])) .dx-face { display: none; }
.dx-grid:has(.dx-intro:not([hidden])) .dx-ring-label { bottom: -13px; z-index: 2; }
.dx-grid:has(.dx-intro:not([hidden])) .dx-metrics { margin-top: 31px; }
.dx-grid:has(.dx-intro:not([hidden])) .dx-metrics h2 { display: block; margin-bottom: 15px; color: #4e392b; font-family: var(--font-heading); font-size: 1.35rem; font-weight: 500; }

/* Preguntas: barra segmentada y opciones con selección más evidente. */
.dx-panel:has(.dx-quiz:not([hidden])) { background: rgba(255,253,250,.97); }
.dx-top { gap: 13px; margin-bottom: 32px; }
.dx-bar { height: 10px; position: relative; background: repeating-linear-gradient(90deg,#eadfd3 0 calc(20% - 3px),#fffdfa calc(20% - 3px) 20%); }
.dx-bar::after { content: ""; position: absolute; z-index: 2; inset: 0; pointer-events: none; background: linear-gradient(90deg,transparent 19.5%,#fffdfa 19.5% 20%,transparent 20% 39.5%,#fffdfa 39.5% 40%,transparent 40% 59.5%,#fffdfa 59.5% 60%,transparent 60% 79.5%,#fffdfa 79.5% 80%,transparent 80%); }
.dx-bar i { position: relative; z-index: 1; background: linear-gradient(90deg,#9f704c,#c28c5b); }
.dx-count { min-width: 48px; padding: 6px 10px; border-radius: 99px; background: #f4e9dc; color: #705238; font-weight: 600; }
.dx-question > .eyebrow { display: inline-flex; margin-bottom: 9px; padding: 7px 12px; border-radius: 99px; background: #f6ede3; color: #966d47; letter-spacing: .12em; }
.dx-question h2 { max-width: 700px; color: #4f3d30; font-size: clamp(1.85rem,3.1vw,2.7rem); }
.dx-question > p { margin: 9px 0 25px; color: #75665a; font-size: .98rem; }
.dx-options { gap: 12px; }
.dx-opt { min-height: 112px; align-items: center; padding: 17px 20px; border: 1px solid #eadfd3; border-radius: 5px; background: linear-gradient(135deg,#fffdfa,#f8f2eb); }
.dx-opt:hover { transform: translateY(-2px); border-color: #bd946d; background: #fff; box-shadow: 0 12px 26px rgba(77,58,41,.1); }
.dx-opt.selected { border: 2px solid #a77850; background: #f7eee5; box-shadow: 0 8px 22px rgba(134,91,53,.14); }
.dx-opt.selected::after { content: "✓"; position: absolute; top: 10px; right: 12px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #8d6141; color: #fff; font-size: .75rem; }
.dx-emoji { width: 48px; height: 48px; flex-basis: 48px; border-radius: 50%; color: #926b48; background: #f2e5d8; border-color: #e5d4c1; }
.dx-opt h3 { padding-right: 18px; color: #4d3d31; font-size: .98rem; }
.dx-opt p { color: #72645a; font-size: .82rem; }
.dx-opt { min-height: 126px; padding: 19px 23px; border-radius: 6px; background: linear-gradient(145deg,#fffdfa,#f8f1e9); }
.dx-opt:hover { transform: translateY(-3px); border-color: #b9895f; box-shadow: 0 13px 28px rgba(89,62,39,.12); }
.dx-opt.selected { border-color: #94633e; background: linear-gradient(140deg,#f5e7d9,#fffaf4); box-shadow: 0 9px 24px rgba(117,76,43,.16), inset 0 0 0 1px #94633e; }
.dx-opt { min-height: 142px; padding: 19px 23px; gap: 17px; border-radius: 10px; }
.dx-opt.selected { border-color: #c86f57; background: linear-gradient(140deg,#fff4ec,#fffdfa); box-shadow: 0 8px 22px rgba(172,94,67,.14), inset 0 0 0 1px #c86f57; }
.dx-opt.selected::after { display: none; }
.dx-emoji { display: grid; place-items: center; width: 68px; height: 68px; flex: 0 0 68px; border-radius: 50%; border: 1px solid #ead8c5; background: linear-gradient(145deg,#fffdfa,#f1e3d4); color: #986743; font-size: 1rem; }
.dx-emoji svg { width: 31px; height: 31px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.dx-opt.selected .dx-emoji { border-color: #d8ae88; background: #f9e8db; color: #935938; }
.dx-opt h3 { margin-bottom: 6px; padding-right: 16px; color: #4b392d; font-size: 1.18rem; font-weight: 600; letter-spacing: -.01em; }
.dx-opt p { max-width: 34ch; color: #5f544a; font-size: .98rem; line-height: 1.42; }
.dx-opt.selected .dx-opt p { color: #55483d; }
.dx-key { top: 12px; right: 12px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border-color: #eadfd3; border-radius: 50%; color: #76665a; background: #fffdfa; font-size: .78rem; }
.dx-opt.selected .dx-key { border-color: #bc7d60; background: #fff7f0; color: #945b3c; }
.dx-hint { margin-top: 18px; color: #8b7969; }
.dx-back { border-radius: 4px; }

/* Cierre del test */
.dx-analyzing { padding: 26px; }
.dx-analyzing h2 { color: #503c2e; }
.dx-result > .eyebrow { padding: 8px 13px; border-radius: 99px; background: #f3e6d8; color: #906744; }
.dx-result > h2 { margin-top: 12px; color: #503c2e; font-size: clamp(1.9rem,3vw,2.6rem); }
.dx-result > p { color: #716155; line-height: 1.65; }
.dx-result-grid { gap: 22px; padding: 18px; border: 1px solid #eee2d6; border-radius: 7px; background: linear-gradient(120deg,#fffdfa,#f7eee5); }
.dx-score strong { color: #845a3b; }
.dx-chips { gap: 8px; }
.dx-chip { border: 1px solid #eadfd3; background: #fffdfa; }
.dx-prod { border-radius: 5px; background: #fffdfa; }
.dx-prod img { border-radius: 4px; }
.dx-cta .btn { border-radius: 4px; }

@media (max-width: 920px) {
  .dx-grid:has(.dx-intro:not([hidden])) { grid-template-columns: 1fr; max-width: 760px; }
  .dx-grid:has(.dx-intro:not([hidden])) .dx-scanner { position: static; padding: 20px; }
  .dx-grid:has(.dx-intro:not([hidden])) .dx-face-wrap { max-width: 600px; }
  .dx-grid:has(.dx-intro:not([hidden])) .dx-face-photo { aspect-ratio: 1; object-fit: contain; }
  .dx-grid:has(.dx-intro:not([hidden])) .dx-metrics { margin-top: 23px; }
}
@media (max-width: 560px) {
  .dx-grid:has(.dx-intro:not([hidden])) { gap: 14px; }
  .dx-grid:has(.dx-intro:not([hidden])) .dx-scanner { padding: 15px; }
  .dx-grid:has(.dx-intro:not([hidden])) .dx-face-photo { aspect-ratio: 1; object-fit: contain; }
  .dx-intro-copy h1 { font-size: clamp(2.05rem,9vw,2.8rem); }
  .dx-intro-copy > p { font-size: .92rem; }
  .dx-intro-copy .dx-bullets small { font-size: .76rem; }
  .dx-intro-copy .dx-start { width: 100%; min-width: 0; }
  .dx-grid:has(.dx-intro:not([hidden])) .dx-metrics { margin-top: 20px; }
  .dx-panel:has(.dx-quiz:not([hidden])) { padding: 23px 17px; }
  .dx-opt { min-height: 105px; padding: 13px; gap: 10px; }
  .dx-emoji { width: 48px; height: 48px; flex-basis: 48px; }
  .dx-emoji svg { width: 24px; height: 24px; }
  .dx-opt h3 { font-size: .99rem; }
  .dx-opt p { font-size: .82rem; }
}

/* ---------- Fase 3: hábitos y selección múltiple ---------- */
.dx-options[role="group"] { grid-template-columns: 1fr 1fr; }
.dx-opt[role="checkbox"].selected .dx-emoji { background: var(--color-accent-soft); border-color: var(--color-accent); }
.dx-continue { margin-top: 22px; align-self: flex-start; padding: 13px 30px; }

.dx-habitos { display: grid; gap: 14px; }
.dx-habito { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md); background: var(--color-bg); cursor: pointer; transition: border-color .2s, background .2s; }
.dx-habito:hover { border-color: var(--color-primary-light); background: var(--color-white); }
.dx-habito input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--color-accent); flex: none; }
.dx-habito strong { display: block; font-weight: 600; font-size: .95rem; }
.dx-habito small { color: var(--color-text-light); font-size: .82rem; }
.dx-preferencia { border: 1.5px solid var(--color-border); border-radius: var(--radius-md); padding: 16px 18px; margin: 0; }
.dx-preferencia legend { font-weight: 600; font-size: .95rem; padding: 0 6px; }
.dx-preferencia label { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--color-text); margin-top: 8px; cursor: pointer; }
.dx-preferencia input { accent-color: var(--color-accent); width: 17px; height: 17px; }

@media (max-width: 560px) {
  .dx-options[role="group"] { grid-template-columns: 1fr; }
}

/* ============================================================
   Mockup visual — escáner con rostro SVG animado
   ============================================================ */
.dx-face-svg { width: 100%; display: block; }
.dx-face-wrap { position: relative; width: 210px; margin: 0 auto 26px; }

/* Línea de escaneo que recorre el rostro */
.dx-scan-line {
  position: absolute; left: 8%; right: 8%; top: 12%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent, #B88B4A), transparent);
  box-shadow: 0 0 12px 2px rgba(184,139,74,.45);
  opacity: 0; pointer-events: none; border-radius: 2px;
}
.dx-face-wrap.scanning .dx-scan-line { opacity: 1; animation: dxScanLine 2.2s ease-in-out infinite; }
@keyframes dxScanLine {
  0%   { top: 12%; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { top: 78%; opacity: 0; }
}

/* Zonas del rostro: se iluminan al avanzar (CSS targeting de los id del SVG) */
.dx-face-svg .scan-zone .zone-fill {
  fill: #D8C4A7; fill-opacity: .12; stroke: #B99A72; stroke-dasharray: 4 5;
  transition: fill-opacity .5s ease, stroke .5s ease;
}
.dx-face-svg .scan-zone.on .zone-fill {
  fill: #B88B4A; fill-opacity: .38; stroke: #8B6B45; stroke-dasharray: none;
  animation: dxZonePulse 1.8s ease-out infinite;
}
@keyframes dxZonePulse {
  0%   { fill-opacity: .38; }
  50%  { fill-opacity: .55; }
  100% { fill-opacity: .38; }
}
@media (prefers-reduced-motion: reduce) {
  .dx-scan-line, .dx-face-svg .scan-zone.on .zone-fill { animation: none !important; }
}

/* ============================================================
   Mockup visual — iconos propios y micro-interacciones
   ============================================================ */
.dx-emoji img { width: 40px; height: 40px; display: block; }
.dx-opt.selected .dx-emoji { background: var(--color-accent-soft, #f3e6d8); border-color: var(--color-accent, #B88B4A); }
.dx-opt.selected .dx-emoji img { filter: none; }

/* Check animado al seleccionar */
.dx-opt.selected::after {
  content: '✓'; position: absolute; top: 10px; right: 12px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--color-accent, #B88B4A); color: #fff;
  display: grid; place-items: center; font-size: .72rem; font-weight: 700;
  animation: dxCheckIn .3s cubic-bezier(.2,.8,.2,1);
}
.dx-opt.selected .dx-key { display: none; }
@keyframes dxCheckIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Contador de seleccionadas (Q2) */
.dx-selected-count {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px;
  font-size: .82rem; color: var(--color-primary-dark, #503c2e);
  background: var(--color-accent-soft, #f3e6d8); padding: 5px 12px; border-radius: 99px;
}
.dx-selected-count b { font-weight: 700; }

/* Entrada suave de las preguntas */
.dx-question { animation: dxIn .45s cubic-bezier(.2,.8,.2,1); }

/* Rostro inline */
.dx-face-svg-inline { width: 100%; }
.dx-face-svg-inline svg { width: 100%; height: auto; display: block; }

/* ============================================================
   Fix: tamaño del rostro SVG y etiqueta del perfil
   ============================================================ */
.dx-face-wrap { width: 190px; max-width: 190px; margin: 0 auto 30px; }
.dx-face-svg-inline { width: 190px; max-width: 190px; margin: 0 auto; }
.dx-face-svg-inline svg {
  width: 190px !important; height: auto !important; max-width: 100%;
  display: block; overflow: visible;
}
/* La etiqueta debe verse completa, sin cortes */
.dx-ring-label {
  left: 50%; bottom: -16px; transform: translateX(-50%);
  white-space: nowrap; width: auto; min-width: max-content;
  padding: 7px 18px; z-index: 2;
}
.dx-ring-label span { font-size: 1rem; }
.dx-ring-label small { font-size: .72rem; }

/* ============================================================
   Fix definitivo: rostro SVG y etiqueta del perfil (mockup)
   ============================================================ */
/* En la portada el wrap tenía overflow:hidden y recortaba la etiqueta. */
.dx-grid:has(.dx-intro:not([hidden])) .dx-face-wrap { overflow: visible; background: transparent; }

/* El SVG inline respeta el ancho del contenedor en todos los casos. */
.dx-face-svg-inline { width: 100%; max-width: 100%; margin: 0 auto; display: block; }
.dx-face-svg-inline svg { display: block; width: 100% !important; height: auto !important; max-width: 100%; }

/* Portada: el rostro no debe crecer más que el panel. */
.dx-grid:has(.dx-intro:not([hidden])) .dx-face-svg-inline { max-width: 300px; }
.dx-grid:has(.dx-intro:not([hidden])) .dx-face-svg-inline svg { max-width: 300px; }

/* Etiqueta del perfil: siempre completa y visible. */
.dx-ring-label {
  position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%);
  display: inline-flex; align-items: baseline; gap: 6px;
  white-space: nowrap; width: auto; max-width: none; min-width: 0;
  padding: 7px 18px; z-index: 3; overflow: visible;
}
.dx-ring-label span { margin-right: 0; }
.dx-grid:has(.dx-intro:not([hidden])) .dx-ring-label { bottom: -16px; }

/* ============================================================
   Fix: foto del rostro y etiqueta del perfil (sin recortes)
   ============================================================ */
/* El wrap recortaba la etiqueta que va en bottom negativo. */
.dx-face-wrap { overflow: visible !important; }
.dx-grid:has(.dx-intro:not([hidden])) .dx-face-wrap { overflow: visible !important; }

/* Etiqueta siempre completa y visible. */
.dx-ring-label {
  display: inline-flex !important; align-items: baseline; gap: 6px;
  white-space: nowrap; width: auto !important; min-width: max-content;
  padding: 7px 18px; bottom: -16px !important; z-index: 3; overflow: visible;
}
.dx-grid:has(.dx-intro:not([hidden])) .dx-ring-label { bottom: -16px !important; }

/* ============================================================
   Zonas ajustadas a rostro-zonas.jpg
   ============================================================ */
.dx-photo-zone[data-zone="frente"]   { left: 50%;   top: 22%; }
.dx-photo-zone[data-zone="mejillaI"] { left: 36%;   top: 55%; }
.dx-photo-zone[data-zone="mejillaD"] { left: 64%;   top: 55%; }
.dx-photo-zone[data-zone="mentón"]   { left: 50%;   top: 79%; }

/* ============================================================
   Móvil muy estrecho (<=380px): test y resultado sin desborde
   ============================================================ */
@media (max-width: 480px) {
  /* Escáner: la foto y el panel se salían a 392px. */
  .dx-scanner { padding: 14px !important; }
  .dx-face-wrap,
  .dx-face-svg-inline { max-width: 100% !important; width: 100% !important; }
  .dx-face-photo,
  .dx-face-svg-inline svg { max-width: 100% !important; width: 100% !important; height: auto !important; }
  .dx-grid:has(.dx-intro:not([hidden])) .dx-face-wrap { max-width: 100% !important; }
  .dx-grid:has(.dx-intro:not([hidden])) .dx-face-photo { aspect-ratio: auto; object-fit: contain; }
  .dx-panel { padding: 20px 14px !important; }
  .dx-opt { padding: 12px !important; gap: 10px !important; }
  .dx-emoji { flex: 0 0 38px !important; width: 38px !important; height: 38px !important; }
  .dx-emoji img { width: 32px !important; height: 32px !important; }
  .dx-opt h3 { font-size: .92rem !important; }
  .dx-opt p { font-size: .78rem !important; }
  .dx-metric { grid-template-columns: 1fr 70px !important; font-size: .75rem !important; }
  /* Resultado: tarjetas y hero a una columna. */
  .rp-hero, .rp-insight, .rp-card { grid-template-columns: 1fr !important; }
  .rp-card { padding: 12px !important; gap: 12px !important; }
  .rp-card img, .rp-media img { width: 100% !important; height: auto !important; max-width: 140px !important; }
  .rp-side { justify-items: start !important; text-align: left !important; }
  .rp-routine, .rp-indicators { padding: 18px 12px !important; }
  .rp-indicators-grid { grid-template-columns: 1fr !important; }
  .rp-buybar-in { flex-direction: column; align-items: stretch; gap: 10px; }
  .rp-buyactions { flex-direction: column; }
  .rp-buyactions .btn { width: 100%; justify-content: center; }
}

/* <=380px: el grid del escáner móvil (96px + 1fr) desbordaba.
   Se apila en una sola columna. */
@media (max-width: 480px) {
  .dx-grid,
  .dx-grid:has(.dx-intro:not([hidden])) { grid-template-columns: minmax(0, 1fr) !important; }
  .dx-scanner { display: block !important; grid-template-columns: none !important; }
  .dx-scanner .dx-face-wrap { margin: 0 auto 24px !important; }
  .dx-metrics { margin-top: 18px !important; }
  .dx-metrics h2 { display: block !important; }
  .dx-metric { grid-template-columns: 1fr 80px !important; }
}
