@font-face {
  font-family: "Nunito";
  src: url("/fonts/nunito-variable.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Marca */
  --fe-teal-dark: #10756B;
  --fe-teal:      #14A494;
  --fe-teal-hero: #21A198;
  --fe-teal-menu: #36ADA3;
  --fe-green:     #1B866F;
  --fe-mint:      #C8EEE2;
  --fe-orange:    #F16C29;

  /* Neutros y funcionales */
  --fe-bg:         #F6F6F6;
  --fe-surface:    #FFFFFF;
  --fe-text:       #211918;
  --fe-text-muted: #5B6B6A;
  --fe-border:     #D5DEDD;
  --fe-danger:     #C62828;
  --fe-warning-bg: #FFF3CD;
  --fe-warning:    #8A4B00;

  /* Tipografía */
  --font-title: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Forma */
  --radius-card: 20px;
  --radius-field: 14px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(16, 117, 107, .08), 0 4px 12px rgba(16, 117, 107, .06);

  /* Espaciado y tacto */
  --space: 8px;
  --tap-min: 48px;
}

* { box-sizing: border-box; }
html { background: var(--fe-bg); color: var(--fe-text); font-family: var(--font-body); font-size: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fe-bg); line-height: 1.5; }
h1, h2, h3 { font-family: var(--font-title); margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }

.screen-header {
  background: var(--fe-teal-dark);
  color: #fff;
  padding: calc(16px + env(safe-area-inset-top)) 16px 28px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-title); font-weight: 800; font-size: 17px; }
.brand img { background: #fff; border-radius: 10px; padding: 3px; }
.eyebrow { margin-top: 20px; color: var(--fe-mint); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.screen-header h1 { margin-top: 6px; font-size: 26px; line-height: 1.2; font-weight: 800; }

main { max-width: 560px; margin: -12px auto 0; padding: 0 16px calc(32px + env(safe-area-inset-bottom)); }

.card {
  background: var(--fe-surface);
  border: 1px solid var(--fe-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px 16px;
  margin-top: 16px;
  display: grid;
  gap: 14px;
}
.card h2 { font-size: 19px; line-height: 1.3; font-weight: 700; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.muted { color: var(--fe-text-muted); font-size: 15px; }
.hint { color: var(--fe-text-muted); font-size: 14px; line-height: 1.4; min-height: 1.4em; }
.hint.ok { color: var(--fe-green); font-weight: 500; }
.hint.error { color: var(--fe-danger); font-weight: 500; }

.badge {
  background: var(--fe-mint);
  color: var(--fe-green);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
.kv dt { color: var(--fe-text-muted); }
.kv dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  flex: 1 1 160px;
  min-height: 56px;
  border-radius: var(--radius-pill);
  font: 600 17px/1.2 var(--font-body);
  padding: 0 20px;
  cursor: pointer;
  border: 2px solid var(--fe-teal-dark);
}
.btn-primary { background: var(--fe-teal-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--fe-teal-dark); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .photo-empty:focus-visible, .check-row:focus-within { outline: 3px solid var(--fe-teal); outline-offset: 2px; }

.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--tap-min);
  padding: 10px 14px;
  border: 1px solid var(--fe-border);
  border-radius: var(--radius-field);
  cursor: pointer;
}
.check-row:has(input:checked) { border-color: var(--fe-teal-dark); background: #EEF9F5; }
.check-row input { width: 22px; height: 22px; accent-color: var(--fe-teal-dark); flex: none; margin: 0; }

.rec-status { display: flex; align-items: center; gap: 8px; color: var(--fe-danger); font-weight: 700; letter-spacing: .08em; font-size: 14px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--fe-danger); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }

.timer { font-family: var(--font-title); font-weight: 800; font-size: 56px; line-height: 1; font-variant-numeric: tabular-nums; text-align: center; color: var(--fe-text); }

.photo-zone {
  border: 2px dashed var(--fe-teal);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #fff;
  min-height: 200px;
  display: grid;
  place-items: center;
}
.photo-zone video, .photo-zone img { width: 100%; display: block; }
.photo-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 100%;
  min-height: 200px;
  background: none;
  border: 0;
  color: var(--fe-teal-dark);
  font: 600 16px var(--font-body);
  cursor: pointer;
}

.log { list-style: none; margin: 0; padding: 0; font-size: 13px; line-height: 1.4; max-height: 320px; overflow-y: auto; display: grid; gap: 4px; }
.log li { display: grid; grid-template-columns: 64px 1fr; gap: 8px; padding: 4px 0; border-bottom: 1px solid #EEF2F1; }
.log time { color: var(--fe-text-muted); font-variant-numeric: tabular-nums; }
.log .warn { color: var(--fe-warning); }
.log .error { color: var(--fe-danger); }
