/* Fichas de salud, consentimientos y "Mi evolución" — web de clientas. Usa las variables del portal (portal.css). */
body.fm-abierto { overflow: hidden; }
.fm-pant { position: fixed; inset: 0; z-index: 9500; background: var(--ivory); display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.fm-pant[hidden] { display: none; }
.fm-head { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) var(--gutter) 10px; border-bottom: 1px solid var(--line); background: var(--ivory); }
.fm-head h2 { flex: 1; margin: 0; font-size: 17px; font-weight: 500; line-height: 1.25; color: var(--choc); }
.fm-back { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--beige); color: var(--choc); font-size: 22px; line-height: 1; cursor: pointer; flex: 0 0 auto; }
.fm-cuerpo { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px var(--gutter) 24px; }
.fm-col { max-width: var(--page-max); margin: 0 auto; }
.fm-pie { flex: 0 0 auto; border-top: 1px solid var(--line); background: var(--ivory); padding: 10px var(--gutter) calc(10px + var(--safe-b)); }
.fm-pie .fm-col { display: flex; gap: 10px; }
.fm-pie .btn { flex: 1; }
.fm-pie .btn.fm-chico { flex: 0 0 auto; }
.fm-pie:empty { display: none; }
.fm-sin-guardar { font-size: 12px; color: var(--warn); background: var(--warn-bg); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.fm-sin-guardar[hidden] { display: none; }
.fm-prog { height: 6px; border-radius: 6px; background: var(--beige-2); overflow: hidden; margin: 0 0 6px; }
.fm-prog > i { display: block; height: 100%; background: var(--mink); border-radius: 6px; transition: width .25s; }
.fm-paso-n { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.fm-h { font-size: 22px; font-weight: 400; line-height: 1.25; margin: 0 0 6px; color: var(--choc); }
.fm-ayuda { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.fm-nota { background: var(--beige); border-radius: var(--r); padding: 12px 14px; font-size: 13.5px; color: var(--mink-2); margin: 0 0 16px; }
.fm-preg { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 0 0 12px; }
.fm-preg.fm-err { border-color: var(--err); }
.fm-preg label.fm-q, .fm-preg .fm-q { display: block; font-size: 15px; font-weight: 500; line-height: 1.4; margin: 0 0 10px; color: var(--choc); }
.fm-opc { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-opc.fm-lista { flex-direction: column; }
.fm-op { min-height: 46px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--white); color: var(--choc); font-size: 15px; cursor: pointer; text-align: left; display: inline-flex; align-items: center; gap: 10px; flex: 0 1 auto; }
.fm-opc:not(.fm-lista) .fm-op { flex: 1 1 90px; justify-content: center; text-align: center; }
.fm-op[aria-pressed="true"], .fm-op[aria-checked="true"] { background: var(--choc); border-color: var(--choc); color: var(--ivory); }
.fm-op .fm-tick { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid currentColor; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.fm-detalle { margin-top: 10px; }
.fm-detalle textarea, .fm-preg textarea { width: 100%; min-height: 84px; resize: vertical; }
.fm-error { color: var(--err); font-size: 13px; margin: 6px 0 0; }
.fm-doc { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; max-height: 46vh; overflow-y: auto; white-space: pre-wrap; font-size: 14.5px; line-height: 1.6; color: var(--choc); -webkit-overflow-scrolling: touch; }
.fm-leyendo { font-size: 13px; color: var(--muted); margin: 8px 0 14px; }
.fm-acepto { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--white); margin: 14px 0; font-size: 15px; cursor: pointer; }
.fm-acepto input { width: 22px; height: 22px; margin-top: 1px; flex: 0 0 auto; accent-color: var(--choc); }
.fm-acepto.fm-off { opacity: .5; cursor: not-allowed; }
.fm-firma-caja { position: relative; border: 1.5px dashed var(--line-2); border-radius: var(--r); background: #fff; overflow: hidden; }
.fm-firma-caja canvas { display: block; width: 100%; height: auto; aspect-ratio: 8 / 3; touch-action: none; cursor: crosshair; }
.fm-firma-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #b9aea5; font-size: 14px; pointer-events: none; }
.fm-firma-ph[hidden] { display: none; }
.fm-firma-barra { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 8px 0 4px; }
.fm-aviso-firma { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.fm-tareas { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.fm-tarea { border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px 14px; background: var(--white); text-align: left; }
.fm-tarea h3 { margin: 0 0 4px; font-size: 15px; font-weight: 500; color: var(--choc); display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.fm-tarea p { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); }
.fm-tarea .btn { min-height: 40px; }
.fm-tarea.fm-hecha { background: var(--ok-bg); border-color: transparent; }
.badge.b-prog { background: var(--beige); color: var(--mink-2); }
.fm-evo-card { border-radius: var(--r-lg); background: linear-gradient(180deg, var(--white), var(--beige)); border: 1px solid var(--line); padding: 18px 16px; }
.fm-evo-card h3 { font-size: 19px; font-weight: 400; margin: 0 0 6px; }
.fm-evo-card p { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.fm-sesion { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 0 0 12px; }
.fm-sesion h3 { margin: 0 0 2px; font-size: 16px; font-weight: 500; }
.fm-sesion .fm-sub { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.fm-fotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fm-foto { position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: var(--beige); cursor: pointer; }
.fm-foto img { width: 100%; height: 100%; object-fit: cover; }
.fm-foto span { position: absolute; left: 4px; bottom: 4px; background: rgba(43,32,26,.7); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 999px; }
.fm-visor { position: fixed; inset: 0; z-index: 9700; background: rgba(20,14,10,.96); display: flex; flex-direction: column; color: #fff; }
.fm-visor[hidden] { display: none; }
.fm-visor header { display: flex; justify-content: space-between; align-items: center; padding: calc(10px + var(--safe-t)) 14px 10px; gap: 10px; }
.fm-visor .fm-x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 20px; cursor: pointer; }
.fm-visor .fm-img { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 8px; }
.fm-visor .fm-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fm-visor footer { padding: 10px 16px calc(14px + var(--safe-b)); font-size: 14px; color: #e9e2db; text-align: center; }
.fm-comp { position: relative; width: 100%; max-width: 560px; aspect-ratio: 3 / 4; max-height: 100%; background: #000; overflow: hidden; border-radius: 12px; }
.fm-comp img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.fm-comp .fm-despues { clip-path: inset(0 0 0 50%); }
.fm-comp .fm-tag { position: absolute; top: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 3px 9px; border-radius: 999px; }
.fm-comp-rango { width: min(560px, 92%); margin: 14px auto 0; display: block; accent-color: #fff; }
.fm-resumen-fila { display: flex; flex-direction: column; padding: 10px 0; border-bottom: 1px solid var(--line); }
.fm-resumen-fila:last-child { border-bottom: 0; }
.fm-resumen-fila small { color: var(--muted); font-size: 12.5px; }
.fm-resumen-fila b { font-weight: 500; font-size: 14.5px; }
.fm-toggle-par { display: flex; gap: 8px; margin-top: 10px; }
.fm-toggle-par .btn { flex: 1; }
.fm-cargando { text-align: center; color: var(--muted); padding: 40px 0; }
@media (min-width: 720px) {
  .fm-pant { align-items: center; background: rgba(43,32,26,.45); }
  .fm-pant > * { width: 100%; max-width: 680px; background: var(--ivory); }
  .fm-pant > .fm-head { border-radius: 20px 20px 0 0; margin-top: 4vh; }
  .fm-pant > .fm-cuerpo { max-height: 78vh; }
  .fm-pant > .fm-pie { border-radius: 0 0 20px 20px; margin-bottom: 4vh; }
}

/* Visor de fotos con flechas y puntitos (también se desliza con el dedo) */
.fm-visor .fm-img { position: relative; touch-action: pan-y; }
.fm-visor .fm-img img { user-select: none; -webkit-user-drag: none; }
.fm-visor .fm-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.2); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding-bottom: 4px; }
.fm-visor .fm-nav.izq { left: 8px; } .fm-visor .fm-nav.der { right: 8px; }
.fm-visor .fm-dots { display: flex; justify-content: center; gap: 7px; margin-top: 10px; }
.fm-visor .fm-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.35); }
.fm-visor .fm-dots i.on { background: #fff; }
