:root {
  --fondo: #0F1115;
  --tarjeta: #171A21;
  --borde: #262A34;
  --texto: #E8EAF0;
  --tenue: #9AA1B1;
  --acento: #3B82F6;
  --acento-osc: #2563EB;
  --ok: #22C55E;
  --error: #EF4444;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  min-height: 100%;
}

.contenedor {
  max-width: 520px;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 16px calc(24px + env(safe-area-inset-bottom));
}

.cabecera {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 0 20px;
}

.marca { display: flex; align-items: center; gap: 12px; }

.logo {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--acento);
  color: #fff;
  font-weight: 700;
  font-size: 20px;
}

.cabecera h1 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: .2px; }
.subtitulo { margin: 2px 0 0; font-size: 13px; color: var(--tenue); }

.tarjeta {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: 16px;
  padding: 20px;
}

.instruccion {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--tenue);
}

.zona-camara { display: block; }

.boton-camara {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 18px;
  border-radius: 14px;
  background: var(--acento);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, transform .08s ease;
}

.boton-camara:active { background: var(--acento-osc); transform: scale(.99); }
.boton-camara svg { width: 24px; height: 24px; fill: currentColor; }
.boton-camara.deshabilitado { background: #2A2F3A; color: var(--tenue); cursor: default; }

.lista-fotos {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}

.lista-fotos:empty { display: none; }

.lista-fotos li {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--borde);
  background: #0B0D11;
}

.lista-fotos img { width: 100%; height: 100%; object-fit: cover; display: block; }

.quitar {
  position: absolute;
  top: 4px; right: 4px;
  width: 26px; height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.66);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.estado {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #10131A;
  border: 1px solid var(--borde);
  font-size: 14px;
  color: var(--tenue);
}

.spinner {
  width: 16px; height: 16px;
  border: 2px solid #2A2F3A;
  border-top-color: var(--acento);
  border-radius: 50%;
  animation: girar .8s linear infinite;
  flex: 0 0 auto;
}

@keyframes girar { to { transform: rotate(360deg); } }

.mensaje {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
}

.mensaje.error { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.35); color: #FCA5A5; }
.mensaje.ok { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.35); color: #86EFAC; }

.primario {
  width: 100%;
  margin-top: 18px;
  padding: 16px;
  border: 0;
  border-radius: 14px;
  background: var(--acento);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
}

.primario:disabled { background: #2A2F3A; color: var(--tenue); cursor: default; }
.primario:not(:disabled):active { background: var(--acento-osc); }

.pie {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12px;
  color: #6B7280;
}

.error-fatal h2 { margin: 0 0 8px; font-size: 18px; }
.error-fatal p { margin: 0; font-size: 14px; color: var(--tenue); line-height: 1.5; }
