/* ============================================================
   DANGOFE OS · «Mi foto» del técnico · 2026-10-21 · chat de Diseño
   Liquid glass, SIN sombras; «Noche azul» por [data-theme='dark'], [data-tono='medianoche'] o [data-tono='negro'].
   ============================================================ */
.pfo {
  --pfo-az: #03269b; --pfo-cel: #1d4ed8; --pfo-tinta: #0f172a; --pfo-tenue: #5b6478;
  --pfo-linea: rgba(3, 38, 155, .12); --pfo-campo: rgba(3, 38, 155, .05); --pfo-card: rgba(255, 255, 255, .88); --pfo-borde: rgba(255, 255, 255, .9);
  --pfo-velo: rgba(10, 22, 51, .46); --pfo-ok: #15803d; --pfo-mal: #b45309; --pfo-marco: #0b1230;
  position: fixed; inset: 0; z-index: 9500; color: var(--pfo-tinta);
  font-family: 'Plus Jakarta Sans', 'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
[data-theme='dark'] .pfo, [data-tono='medianoche'] .pfo, [data-tono='negro'] .pfo {
  --pfo-az: #9db9ff; --pfo-cel: #60a5fa; --pfo-tinta: #e8eefc; --pfo-tenue: #9aa8c7;
  --pfo-linea: rgba(141, 176, 255, .18); --pfo-campo: rgba(255, 255, 255, .06); --pfo-card: rgba(14, 24, 62, .92); --pfo-borde: rgba(140, 170, 255, .22);
  --pfo-velo: rgba(2, 8, 30, .62); --pfo-ok: #4ade80; --pfo-mal: #fbbf24;
}
.pfo *, .pfo *::before, .pfo *::after { box-sizing: border-box; }
.pfo-velo { position: absolute; inset: 0; background: var(--pfo-velo); animation: pfo-aparece .22s ease both; }
.pfo-hoja {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: auto;
  padding: 16px 18px 16px; border-radius: 26px; background: var(--pfo-card); border: 1px solid var(--pfo-borde);
  display: flex; flex-direction: column; gap: 12px; animation: pfo-crece .28s cubic-bezier(.2, .9, .25, 1) both;
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .pfo-hoja { -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5); }
}
.pfo-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pfo-cab h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.pfo-x { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--pfo-linea); background: transparent; color: var(--pfo-tenue); font: inherit; font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.pfo-x:focus-visible, .pfo-b:focus-visible { outline: 2px solid var(--pfo-cel); outline-offset: 2px; }
.pfo-cuerpo { display: flex; flex-direction: column; gap: 12px; }
.pfo-texto { margin: 0; font-size: 13.5px; color: var(--pfo-tenue); line-height: 1.45; text-align: center; }
.pfo-ver { display: grid; place-items: center; padding: 6px 0 2px; }
.pfo-ver .dav { outline: 3px solid var(--pfo-linea); outline-offset: 5px; }
.pfo-botones { display: flex; flex-direction: column; gap: 8px; }
.pfo-b {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--pfo-linea); background: var(--pfo-campo); color: var(--pfo-tinta);
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; -webkit-user-select: none; user-select: none; text-decoration: none;
}
.pfo-b svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.pfo-b--prim { background: linear-gradient(90deg, #03269b, #1d4ed8); color: #fff; border-color: transparent; }
.pfo-b--txt { background: transparent; border-color: transparent; color: var(--pfo-mal); height: 40px; }
.pfo-oculto { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); pointer-events: none; }
.pfo.is-guardando .pfo-b, .pfo.is-guardando .pfo-zoom { pointer-events: none; opacity: .55; }
.pfo-fila { display: flex; gap: 8px; }
.pfo-fila .pfo-b { flex: 1 1 0; min-width: 0; padding: 0 10px; }
.pfo-aviso { margin: 0; font-size: 13px; font-weight: 700; color: var(--pfo-mal); text-align: center; line-height: 1.35; }
.pfo-aviso.is-ok { color: var(--pfo-ok); }
.pfo-aviso:empty { display: none; }
.pfo-ayuda { margin: 0; font-size: 12px; color: var(--pfo-tenue); text-align: center; }

/* el marco del recorte: la foto se arrastra; el círculo blanco es lo que queda */
.pfo-marco {
  --f: 260px; position: relative; width: var(--f); height: var(--f); margin: 0 auto; border-radius: 18px; overflow: hidden;
  background: var(--pfo-marco); touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none;
}
.pfo-marco.is-arrastrando { cursor: grabbing; }
.pfo-marco__img { position: absolute; left: 0; top: 0; max-width: none; display: block; pointer-events: none; will-change: transform; }
.pfo-marco__mascara { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .9); outline: 400px solid rgba(5, 10, 30, .55); pointer-events: none; }
.pfo-zoom { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; color: var(--pfo-tenue); }
.pfo-zoom input { flex: 1 1 auto; min-width: 0; accent-color: #1d4ed8; }

/* la cara (mismas clases que dangofe-avatar.css, por si no está cargado) */
.pfo .dav { --c: #2563eb; --dav-tam: 132px; position: relative; display: inline-grid; place-items: center; width: var(--dav-tam); height: var(--dav-tam); border-radius: 50%; overflow: hidden; color: #fff; background: radial-gradient(120% 120% at 30% 18%, rgba(255, 255, 255, .30), rgba(255, 255, 255, 0) 56%), var(--c); }
.pfo .dav__fig { position: absolute; inset: 0; width: 100%; height: 100%; fill: rgba(255, 255, 255, .94); }
.pfo .dav__ini { position: relative; font-weight: 800; font-size: calc(var(--dav-tam) * .36); line-height: 1; }
.pfo .dav__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.pfo .dav.is-rota .dav__img { display: none; }

@keyframes pfo-aparece { from { opacity: 0; } to { opacity: 1; } }
@keyframes pfo-crece { from { opacity: 0; transform: translate(-50%, -50%) scale(.96); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@media (max-width: 420px) { .pfo-marco { --f: min(260px, calc(100vw - 76px)); } .pfo-hoja { padding: 14px 14px 14px; } }
@media (prefers-reduced-motion: reduce) { .pfo-velo, .pfo-hoja { animation: none; } }
