/* Hoja C2 — pensado para un celular, a pleno sol, con guantes.
   Tokens de marca de design-system/DESIGN_SYSTEM.md seccion 11. */

@font-face {
  font-family: 'Comaco Text';
  src: url('fuentes/comaco-text-regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Comaco Text';
  src: url('fuentes/comaco-text-bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --c-esmeralda: #00879b;
  --c-esmeralda-dark: #006375;
  --c-esmeralda-25: #bfe1e6;
  --c-lima: #cdeb00;
  --c-coral: #f06e64;
  --c-ink: #1a2226;
  --c-graphite: #4a565c;
  --c-stone: #8b969c;
  --c-mist: #dde3e5;
  --c-paper: #f4f6f7;
  --c-white: #fff;

  --f: 'Comaco Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* 48 px es el minimo comodo para un dedo con guante. */
  --toque: 48px;
  --radio: 10px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--f);
  font-size: 17px;
  line-height: 1.4;
  color: var(--c-ink);
  background: var(--c-paper);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ------------------------------------------------------------------ cabecera */

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--c-esmeralda);
  color: var(--c-white);
  padding: 10px 14px calc(10px + env(safe-area-inset-top));
  padding-top: calc(10px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 15%);
}

header h1 {
  font-size: 18px;
  margin: 0;
  flex: 1;
  font-weight: 700;
}

header .sub {
  font-size: 13px;
  opacity: 0.85;
  font-weight: 400;
}

.chip {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgb(255 255 255 / 22%);
  white-space: nowrap;
}

.chip.sin-red {
  background: var(--c-coral);
  color: var(--c-white);
  font-weight: 700;
}

.chip.pendientes {
  background: var(--c-lima);
  color: var(--c-ink);
  font-weight: 700;
}

/* ------------------------------------------------------------------ botones */

button {
  font-family: var(--f);
  font-size: 17px;
  min-height: var(--toque);
  border: 0;
  border-radius: var(--radio);
  padding: 0 18px;
  background: var(--c-esmeralda);
  color: var(--c-white);
  font-weight: 700;
  cursor: pointer;
}

button:active {
  background: var(--c-esmeralda-dark);
}

button[disabled] {
  background: var(--c-stone);
  opacity: 0.7;
}

button.secundario {
  background: var(--c-white);
  color: var(--c-esmeralda);
  border: 2px solid var(--c-esmeralda);
}

button.ancho {
  width: 100%;
}

button.icono {
  min-width: var(--toque);
  padding: 0 12px;
  background: transparent;
  color: var(--c-white);
  font-size: 22px;
}

/* -------------------------------------------------------------------- vistas */

main {
  padding: 14px;
  max-width: 720px;
  margin: 0 auto;
}

.vista[hidden] {
  display: none !important;
}

.tarjeta {
  background: var(--c-white);
  border: 1px solid var(--c-mist);
  border-radius: var(--radio);
  padding: 14px;
  margin-bottom: 12px;
}

.aviso {
  background: #fff8e1;
  border-left: 4px solid var(--c-lima);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 15px;
  margin-bottom: 12px;
}

.aviso.error {
  background: #fdecea;
  border-left-color: var(--c-coral);
}

.aviso.ok {
  background: #e8f5f7;
  border-left-color: var(--c-esmeralda);
}

/* --------------------------------------------------------------- lista de OT */

.buscador {
  width: 100%;
  min-height: var(--toque);
  font-size: 17px;
  font-family: var(--f);
  padding: 0 14px;
  border: 2px solid var(--c-mist);
  border-radius: var(--radio);
  margin-bottom: 12px;
  background: var(--c-white);
}

.ot {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--c-white);
  color: var(--c-ink);
  border: 1px solid var(--c-mist);
  border-radius: var(--radio);
  padding: 12px 14px;
  margin-bottom: 8px;
  font-weight: 400;
  min-height: var(--toque);
}

.ot:active {
  background: var(--c-paper);
}

.ot .linea1 {
  font-weight: 700;
  font-size: 17px;
}

.ot .linea2 {
  font-size: 14px;
  color: var(--c-graphite);
}

.ot .etiqueta {
  float: right;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--c-lima);
  color: var(--c-ink);
  font-weight: 700;
}

/* ----------------------------------------------------------------- grupos */

fieldset {
  border: 1px solid var(--c-mist);
  border-radius: var(--radio);
  background: var(--c-white);
  margin: 0 0 12px;
  padding: 0;
}

legend {
  font-weight: 700;
  font-size: 15px;
  color: var(--c-esmeralda);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0 8px;
  margin-left: 8px;
}

.campo {
  padding: 10px 14px;
  border-top: 1px solid var(--c-paper);
}

fieldset .campo:first-of-type {
  border-top: 0;
}

.campo > label {
  display: block;
  font-size: 15px;
  color: var(--c-graphite);
  margin-bottom: 6px;
}

.campo.requerido > label::after {
  content: ' *';
  color: var(--c-coral);
  font-weight: 700;
}

.campo input:not([type='checkbox']),
.campo select,
.campo textarea {
  width: 100%;
  min-height: var(--toque);
  font-size: 17px;
  font-family: var(--f);
  padding: 8px 12px;
  border: 2px solid var(--c-mist);
  border-radius: 8px;
  background: var(--c-white);
  color: var(--c-ink);
}

.campo textarea {
  min-height: 90px;
  resize: vertical;
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
  outline: 0;
  border-color: var(--c-esmeralda);
}

/* Botones Bueno/Malo, Realizado/No Realizado: un toque, sin desplegable. */
.opciones {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.opciones button {
  flex: 1 1 40%;
  background: var(--c-white);
  color: var(--c-graphite);
  border: 2px solid var(--c-mist);
  font-weight: 400;
}

.opciones button[aria-pressed='true'] {
  background: var(--c-esmeralda);
  border-color: var(--c-esmeralda);
  color: var(--c-white);
  font-weight: 700;
}

.campo > label.interruptor {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.interruptor input {
  width: 56px;
  height: 32px;
  accent-color: var(--c-esmeralda);
}

/* ------------------------------------------------------------ fotos y firmas */

.fotos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

.foto {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 2px dashed var(--c-mist);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--c-white);
  overflow: hidden;
  font-size: 28px;
  color: var(--c-stone);
}

.foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.foto .quitar {
  position: absolute;
  top: 4px;
  right: 4px;
  min-height: 32px;
  min-width: 32px;
  padding: 0;
  font-size: 16px;
  border-radius: 999px;
  background: rgb(0 0 0 / 55%);
  color: var(--c-white);
}

.firma {
  width: 100%;
  height: 160px;
  border: 2px solid var(--c-mist);
  border-radius: 8px;
  background: var(--c-white);
  touch-action: none;
  display: block;
}

/* --------------------------------------------------------------- pendientes */

.pendiente {
  background: var(--c-white);
  border: 1px solid var(--c-mist);
  border-left: 4px solid var(--c-lima);
  border-radius: var(--radio);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.pendiente.enviado {
  border-left-color: var(--c-esmeralda);
}

.pendiente.error {
  border-left-color: var(--c-coral);
}

.barra {
  height: 8px;
  background: var(--c-mist);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 4px;
}

.barra > div {
  height: 100%;
  background: var(--c-esmeralda);
  transition: width 0.2s;
}

.detalle {
  font-size: 13px;
  color: var(--c-graphite);
}

/* ------------------------------------------------------------------ pie fijo */

.pie {
  position: sticky;
  bottom: 0;
  background: var(--c-paper);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--c-mist);
  display: flex;
  gap: 8px;
}

.pie button {
  flex: 1;
}

.vacio {
  text-align: center;
  color: var(--c-stone);
  padding: 40px 20px;
}
