/* Registro de residentes · Las Acacias — Axessar "Planilla" (claro).
   Mismos tokens que el panel de administración; pensado para celular primero. */
:root {
  color-scheme: light;
  --canvas: #e6ebed; --paper: #f5f7f8; --paper-2: #eef2f3; --paper-3: #e6ecee;
  --card: #ffffff;
  --ink: #13242b; --ink-2: #41545c; --ink-3: #5a6c74;
  --rule: #d3dce0; --rule-2: #bccad0;
  --teal: #2587a2; --teal-ink: #1a6880; --teal-wash: #e6f2f5;
  --sky: #38b6ff; --orange: #ff914d; --orange-hover: #f57c33; --orange-ink: #3b1a04;
  --ok: #1e7a4c; --ok-wash: #e5f3ea; --warn: #8f5500; --warn-wash: #fcf0dc; --warn-line: #d9a24a;
  --bad: #b2232e; --bad-wash: #fbe8e9;
  --font: "Inter", ui-sans-serif, system-ui, sans-serif;
  --radius: 8px;
  --shadow-pop: 0 8px 24px -8px rgba(19,36,43,.22), 0 2px 6px -2px rgba(19,36,43,.12);
  --ease: cubic-bezier(.16, 1, .3, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--canvas);
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
::selection { background: color-mix(in srgb, var(--sky) 30%, transparent); }
.ms { font-family: "Material Symbols Outlined"; font-weight: 400; font-style: normal; line-height: 1; display: inline-block;
  letter-spacing: normal; text-transform: none; white-space: nowrap; font-size: 20px; font-variation-settings: "FILL" 0, "wght" 450, "opsz" 24;
  -webkit-font-feature-settings: "liga"; font-feature-settings: "liga"; flex: none; }
[hidden] { display: none !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--sky) 65%, white); outline-offset: 2px; }

/* ---------- Cabecera y avance ---------- */
.top { background: var(--paper); border-bottom: 1px solid var(--rule); }
.top-in { max-width: 760px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top img { height: 34px; width: auto; display: block; }
.top .place { font-size: 13px; font-weight: 600; color: var(--ink-3); text-align: right; line-height: 1.25; }
.steps { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--rule); }
.steps ol { max-width: 760px; margin: 0 auto; padding: 0 16px; list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); }
.steps a { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 4px 10px; text-decoration: none; color: var(--ink-3);
  font-size: 13px; font-weight: 650; border-bottom: 3px solid transparent; }
.steps a .ms { font-size: 18px; }
.steps a.on { color: var(--teal-ink); border-bottom-color: var(--teal); }
.steps a.done { color: var(--ok); }
.steps a span.t { white-space: nowrap; }
@media (max-width: 460px) { .steps a span.t { display: none; } .steps a.on span.t { display: inline; } }

/* ---------- Estructura ---------- */
main { max-width: 760px; margin: 0 auto; padding: 24px 16px 140px; }
.intro h1 { margin: 8px 0 6px; font-size: clamp(26px, 5.2vw, 34px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 750; text-wrap: balance; }
.intro p { margin: 0 0 6px; color: var(--ink-2); max-width: 60ch; }
.intro .mini { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 14px; color: var(--ink-3); }
.intro .mini span { display: inline-flex; align-items: center; gap: 6px; }
.intro .mini .ms { color: var(--teal); font-size: 18px; }
.banner { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 0; padding: 12px 14px; border: 1.5px solid var(--bad); background: var(--bad-wash);
  color: var(--bad); border-radius: var(--radius); font-weight: 600; font-size: 15px; }
.banner[hidden] { display: none; }
.panel { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; margin-top: 20px; box-shadow: 0 1px 0 rgba(19,36,43,.03); }
.panel > header { padding: 18px 20px 4px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel h2 { margin: 0; font-size: 20px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
.panel header p { margin: 4px 0 0; color: var(--ink-3); font-size: 14px; max-width: 52ch; }
.panel .body { padding: 14px 20px 20px; }
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid.c2 { grid-template-columns: 1fr 1fr; } .grid.c3 { grid-template-columns: repeat(3, 1fr); } .span2 { grid-column: span 2; } }

/* ---------- Campos ---------- */
.f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.f .l { font-size: 14px; font-weight: 650; color: var(--ink-2); }
.f .l small { font-weight: 500; color: var(--ink-3); }
.f input, .f select { width: 100%; height: 48px; padding: 0 12px; font: inherit; font-size: 16px; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--rule-2); border-radius: var(--radius); transition: border-color .15s, box-shadow .15s, background .15s; appearance: none; -webkit-appearance: none; }
.f select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.f input::placeholder { color: var(--ink-3); opacity: .8; }
.f input:hover, .f select:hover { border-color: var(--ink-3); }
.f input:focus, .f select:focus { outline: 0; background: #fff; border-color: var(--sky); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sky) 22%, transparent); }
.f.bad input, .f.bad select { border-color: var(--bad); background: #fff; }
.f .err { color: var(--bad); font-size: 13.5px; font-weight: 600; min-height: 0; }
.f .err:empty { display: none; }
.f .hint { font-size: 13px; color: var(--ink-3); }
.f input.up { text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }

.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; padding: 12px 14px; border: 1.5px solid var(--rule-2); border-radius: var(--radius); background: var(--paper); }
.switch:hover { border-color: var(--ink-3); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { flex: none; width: 42px; height: 24px; border-radius: 99px; background: var(--rule-2); position: relative; margin-top: 2px; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--teal); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid color-mix(in srgb, var(--sky) 65%, white); outline-offset: 2px; }
.switch b { display: block; font-size: 15px; font-weight: 650; }
.switch small { display: block; color: var(--ink-3); font-size: 13.5px; margin-top: 2px; line-height: 1.35; }
.switch.on { border-color: var(--teal); background: var(--teal-wash); }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; font: inherit; font-size: 15px; font-weight: 650;
  color: var(--ink); background: var(--card); border: 1.5px solid var(--rule-2); border-radius: var(--radius); cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--paper-3); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: var(--orange-ink); }
.btn.primary:hover { background: var(--orange-hover); border-color: var(--orange-hover); }
.btn.teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.teal:hover { background: var(--teal-ink); border-color: var(--teal-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.sm { min-height: 40px; padding: 0 12px; font-size: 14px; }
.btn[disabled], .btn[aria-disabled=true] { opacity: .5; cursor: not-allowed; }
.btn.add { width: 100%; border-style: dashed; color: var(--teal-ink); background: var(--teal-wash); margin-top: 14px; }

/* ---------- Tarjetas de residente / vehículo ---------- */
.card { border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); padding: 16px; margin-top: 14px; animation: in .35s var(--ease); }
.card:first-child { margin-top: 0; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-h h3 { margin: 0; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-h h3 .ms { color: var(--teal); }
.card .rm { color: var(--ink-3); }
.pbody { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .pbody { grid-template-columns: 168px 1fr; align-items: start; } }

/* Bloque de foto */
.shot { display: flex; flex-direction: column; gap: 10px; }
.shot .frame { position: relative; aspect-ratio: 3 / 4; width: 100%; max-width: 168px; margin: 0 auto; border: 2px dashed var(--rule-2); border-radius: 10px; background: var(--card);
  overflow: hidden; display: grid; place-items: center; }
.shot .frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot .frame svg { width: 70%; height: auto; color: var(--rule-2); }
.shot.has .frame { border-style: solid; border-color: var(--ok); }
.shot.bad .frame { border-color: var(--bad); }
.shot .badge { position: absolute; right: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 6px; border-radius: 99px; background: var(--ok); color: #fff; font-size: 12px; font-weight: 700; }
.shot .badge .ms { font-size: 15px; }
.shot .acts { display: flex; flex-direction: column; gap: 8px; max-width: 168px; margin: 0 auto; width: 100%; }
.shot .req { font-size: 12.5px; text-align: center; font-weight: 650; color: var(--ink-3); }
.shot.need .req { color: var(--bad); }
.shot .err { color: var(--bad); font-size: 13.5px; font-weight: 600; text-align: center; max-width: 168px; margin: 0 auto; }
.shot .err:empty { display: none; }

/* Guía de la foto */
.tips { display: grid; gap: 14px; margin: 6px 20px 0; padding: 16px; border-radius: 10px; background: var(--teal-wash); border: 1px solid color-mix(in srgb, var(--teal) 25%, var(--rule)); }
.tips h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--teal-ink); display: flex; gap: 8px; align-items: center; }
.tips ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14.5px; color: var(--ink); }
.tips li { display: flex; gap: 10px; align-items: flex-start; }
.tips li .ms { color: var(--ok); font-size: 20px; margin-top: 1px; }
.tips li.no .ms { color: var(--bad); }
.tips .fig { display: none; }
@media (min-width: 640px) { .tips { grid-template-columns: 112px 1fr; align-items: center; } .tips .fig { display: block; } .tips .fig svg { width: 100%; height: auto; } }

/* ---------- Envío ---------- */
.consent { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1.5px solid var(--rule-2); border-radius: var(--radius); background: var(--paper); cursor: pointer; }
.consent input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--teal); flex: none; }
.consent span { font-size: 15px; }
.consent.bad { border-color: var(--bad); }
.consent small { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.sum { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; background: var(--paper-3); color: var(--ink-2); font-size: 13.5px; font-weight: 650; }
.chip .ms { font-size: 17px; }
.chip.ok { background: var(--ok-wash); color: var(--ok); }
.chip.warn { background: var(--warn-wash); color: var(--warn); }
.actions { display: flex; gap: 12px; margin-top: 18px; }
.actions .btn.primary { flex: 1; min-height: 54px; font-size: 16px; }
.bar { display: none; }
@media (max-width: 719px) {
  .actions { display: none; }
  .bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--paper) 96%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--rule); box-shadow: 0 -6px 18px -10px rgba(19,36,43,.3); }
  .bar .btn.primary { flex: 1; min-height: 52px; font-size: 16px; }
}
.spin { animation: giro 1s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }

/* ---------- Cámara ---------- */
dialog.cam { border: 0; padding: 0; background: #0b1216; color: #fff; width: min(100vw, 480px); max-width: 100vw; max-height: 100dvh; border-radius: 0; margin: auto; overflow: hidden; }
@media (min-width: 560px) { dialog.cam { border-radius: 16px; max-height: 94dvh; } }
dialog.cam::backdrop { background: rgba(8, 18, 23, .72); backdrop-filter: blur(3px); }
.cam-in { display: flex; flex-direction: column; max-height: 100dvh; }
.cam-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; }
.cam-top h3 { margin: 0; font-size: 16px; font-weight: 700; }
.cam .x { color: #fff; background: rgba(255,255,255,.12); border: 0; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.cam .x:hover { background: rgba(255,255,255,.22); }
.stage { position: relative; aspect-ratio: 3 / 4; width: 100%; max-height: 62dvh; margin: 0 auto; background: #000; overflow: hidden; }
.stage video, .stage canvas.out, .stage img.out { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage video { transform: scaleX(-1); }
.stage .guide { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.guide .mask { fill: rgba(6, 16, 21, .66); }
.guide .oval { fill: none; stroke: #fff; stroke-width: 2.5; stroke-dasharray: 9 7; transition: stroke .2s; }
.guide .body { fill: none; stroke: rgba(255,255,255,.85); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 9 7; }
.guide.good .oval { stroke: #6fe3a3; stroke-dasharray: none; }
.stage .say { position: absolute; left: 12px; right: 12px; bottom: 12px; text-align: center; font-size: 14px; font-weight: 650; padding: 8px 12px; border-radius: 99px;
  background: rgba(8,20,26,.72); }
.stage .count { position: absolute; inset: 0; display: grid; place-items: center; font-size: 96px; font-weight: 800; color: #fff; text-shadow: 0 2px 20px rgba(0,0,0,.6); }
.stage .count[hidden], .stage .say[hidden], .stage video[hidden], .stage .out[hidden] { display: none; }
.cam-tips { list-style: none; margin: 0; padding: 12px 14px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; font-size: 13px; color: #d6e4e9; }
.cam-tips li { display: flex; gap: 6px; align-items: flex-start; line-height: 1.3; }
.cam-tips .ms { font-size: 17px; color: #6fe3a3; }
.cam-msg { margin: 10px 14px 0; padding: 10px 12px; border-radius: var(--radius); background: rgba(255,255,255,.1); font-size: 14px; }
.cam-msg[hidden] { display: none; }
.cam-acts { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px)); }
.cam .btn { color: #fff; border-color: rgba(255,255,255,.35); background: transparent; }
.cam .btn:hover { background: rgba(255,255,255,.12); }
.cam .btn.primary { background: var(--orange); border-color: var(--orange); color: var(--orange-ink); }
.cam .btn.primary:hover { background: var(--orange-hover); }
.shutter { width: 72px; height: 72px; border-radius: 50%; border: 4px solid #fff; background: var(--orange); cursor: pointer; padding: 0; box-shadow: 0 0 0 4px rgba(255,255,255,.18); transition: transform .1s; }
.shutter:active { transform: scale(.94); }
.shutter[disabled] { opacity: .4; }
.verdict { list-style: none; margin: 0; padding: 12px 14px 0; display: grid; gap: 8px; }
.verdict li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; padding: 8px 10px; border-radius: var(--radius); background: rgba(255,255,255,.08); }
.verdict li .ms { font-size: 19px; }
.verdict li.ok .ms { color: #6fe3a3; }
.verdict li.warn .ms { color: #ffcf6b; }
.verdict li.bad .ms { color: #ff8f96; }
.verdict[hidden] { display: none; }
.cam .opt { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #d6e4e9; cursor: pointer; }
.cam .opt input { accent-color: var(--sky); width: 18px; height: 18px; }

/* ---------- Gracias ---------- */
.thanks { max-width: 560px; margin: 8vh auto 0; text-align: center; background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 32px 24px; }
.thanks .big { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-wash); color: var(--ok); display: grid; place-items: center; margin: 0 auto 14px; }
.thanks .big .ms { font-size: 36px; }
.thanks h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: -0.02em; }
.thanks p { color: var(--ink-2); margin: 8px 0; }
.thanks .num { display: inline-block; margin-top: 6px; padding: 4px 12px; border-radius: 99px; background: var(--paper-3); font-weight: 700; font-variant-numeric: tabular-nums; }
.thanks ol { text-align: left; margin: 18px auto 20px; padding-left: 20px; max-width: 42ch; color: var(--ink-2); }
.thanks li { margin: 6px 0; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
