@font-face { font-family: 'Montserrat'; font-weight: 400; font-display: swap; src: url(/public/fonts/montserrat-400.woff2) format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 600; font-display: swap; src: url(/public/fonts/montserrat-600.woff2) format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 700; font-display: swap; src: url(/public/fonts/montserrat-700.woff2) format('woff2'); }

:root {
  color-scheme: dark;
  --acento: #10B981; --acento-hover: #34D399; --acento-claro: #6EE7B7; --acento-osc: #047857;
  --fondo: #000; --seccion: #050505; --tarjeta: #0A0A0A; --campo: #111; --campo-hover: #161616;
  --linea: rgba(255, 255, 255, .09); --linea-fuerte: rgba(255, 255, 255, .16); --linea-acento: rgba(16, 185, 129, .35);
  --texto: #F5F5F5; --gris: #B0B0B0; --gris-alt: #8A8A8A;
  --radio: 14px; --radio-campo: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--fondo); color: var(--gris);
  font-family: 'Montserrat', sans-serif; font-size: 15px; line-height: 1.55;
  background-image: radial-gradient(120% 60% at 50% -10%, rgba(16, 185, 129, .13), transparent 60%);
  background-repeat: no-repeat;
}
::selection { background: rgba(16, 185, 129, .35); color: #fff; }

/* Estructura */
.contenedor { max-width: 760px; margin: 0 auto; padding: 0 16px 48px; }
.barra {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 0; margin-bottom: 20px; border-bottom: 1px solid var(--linea);
}
.barra form { margin: 0; }
.firma-app { display: flex; align-items: center; gap: 10px; color: var(--texto); text-decoration: none; min-width: 0; }
.firma-app span { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.firma-app span b { color: var(--acento); font-weight: 600; }

/* Marca: el logo es un cuadrado oscuro; se recorta al isotipo como ícono de app */
.marca {
  display: block; flex: none; width: 36px; height: 36px; border-radius: 9px;
  background: #0A0D14 url(/public/logo.png) no-repeat 50% 31% / 353%;
  border: 1px solid var(--linea-fuerte); box-shadow: 0 0 0 4px rgba(16, 185, 129, .06);
}
.marca.grande {
  width: 104px; height: 104px; border-radius: 24px; margin: 0 auto 28px;
  background-position: 50% 45.5%; background-size: 190%;
  box-shadow: 0 0 0 6px rgba(16, 185, 129, .07), 0 20px 60px -20px rgba(16, 185, 129, .45);
}

/* Títulos */
.encabezado { margin: 8px 0 24px; }
.sobretitulo { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--acento); }
h1 { margin: 0; color: #fff; font-size: clamp(1.75rem, 6vw, 2.25rem); line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.bajada { margin: 8px 0 0; max-width: 52ch; }
h2 {
  display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px;
  color: #fff; font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em;
}
.numerada { counter-reset: seccion; }
.numerada .tarjeta > h2::before {
  counter-increment: seccion; content: counter(seccion, decimal-leading-zero);
  font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--acento);
}

/* Tarjetas */
.tarjeta {
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 120px), var(--tarjeta);
  border: 1px solid var(--linea); border-radius: var(--radio); padding: 20px 16px 18px; margin-bottom: 14px;
  text-align: left;
}
@media (min-width: 600px) { .tarjeta { padding: 24px 24px 22px; } }

/* Campos */
label { display: block; margin-bottom: 16px; color: var(--gris); font-size: 14px; font-weight: 600; }
label small { font-weight: 400; color: var(--gris-alt); }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; min-height: 48px;
  font: inherit; font-size: 16px; font-weight: 400; color: var(--texto);
  background: var(--campo); border: 1px solid var(--linea); border-radius: var(--radio-campo);
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.55; min-height: 120px; field-sizing: content; max-height: 60vh; }
textarea[name="contenido"] { min-height: 240px; }
input::placeholder, textarea::placeholder { color: #6B6B6B; }
input:hover, select:hover, textarea:hover { border-color: var(--linea-fuerte); background: var(--campo-hover); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--acento); box-shadow: 0 0 0 3px rgba(16, 185, 129, .25); background: var(--campo);
}
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.8); cursor: pointer; }
select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23B0B0B0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
select option { background: #111; color: var(--texto); }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dos label { min-width: 0; }

/* Subida del PDF anterior */
.subida {
  padding: 16px; border: 1px dashed var(--linea-fuerte); border-radius: var(--radio-campo);
  background: rgba(255, 255, 255, .015);
}
.subida input[type="file"] { min-height: 0; padding: 0; border: 0; background: none; color: var(--gris); font-size: 14px; margin-top: 12px; }
.subida input[type="file"]:focus { box-shadow: none; }
.subida input[type="file"]::file-selector-button {
  font: inherit; font-size: 14px; font-weight: 600; color: var(--texto); margin-right: 12px; cursor: pointer;
  padding: 10px 14px; border-radius: 8px; border: 1px solid var(--linea-fuerte); background: var(--campo-hover);
}
.subida:focus-within { border-color: var(--acento); }

/* Filas editables (repaso y accionables) */
.fila {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 10px 10px 10px 12px; margin-bottom: 10px;
  border: 1px solid var(--linea); border-left: 3px solid var(--linea-fuerte); border-radius: var(--radio-campo);
  background: rgba(255, 255, 255, .015);
}
.fila > :first-child { grid-column: 1 / -1; }
.fila input, .fila select { margin-top: 0; }
.repaso .fila { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.fila:has(option[value="cumplido"]:checked) { border-left-color: var(--acento); }
.fila:has(option[value="parcial"]:checked) { border-left-color: #F59E0B; }
.fila:has(option[value="no_cumplido"]:checked) { border-left-color: #EF4444; }
.fila:has(option[value="empresa"]:checked) { border-left-color: var(--acento); }
.fila:has(option[value="synte"]:checked) { border-left-color: #A0A0A0; }
@media (max-width: 600px) {
  .fila, .repaso .fila { grid-template-columns: minmax(0, 1fr); }
  .fila [data-quitar] { justify-self: end; margin-top: -4px; }
}

/* Botones */
button, .boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none;
  border: 0; border-radius: 12px; padding: 12px 22px; color: #021A10;
  background: linear-gradient(135deg, #34D399, #10B981 55%, #059669);
  box-shadow: 0 8px 24px -10px rgba(16, 185, 129, .7), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .12s, box-shadow .15s, filter .15s;
}
button:hover { filter: brightness(1.08); box-shadow: 0 10px 28px -10px rgba(52, 211, 153, .85), inset 0 1px 0 rgba(255, 255, 255, .3); }
button:active { transform: translateY(1px); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--acento-hover); outline-offset: 3px; }
.secundario {
  color: var(--texto); background: transparent; border: 1px solid var(--linea-fuerte); box-shadow: none;
}
.secundario:hover { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .28); box-shadow: none; filter: none; }
.agregar { width: 100%; margin-top: 4px; border-style: dashed; color: var(--acento-claro); }
.agregar:hover { border-color: var(--linea-acento); background: rgba(16, 185, 129, .06); }
.enlace {
  display: inline-flex; align-items: center; min-height: 44px; padding: 4px 6px;
  background: none; box-shadow: none; border: 0; color: var(--gris);
  font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: rgba(176, 176, 176, .4);
}
.enlace:hover { background: none; box-shadow: none; filter: none; color: #fff; text-decoration-color: var(--acento); }
.fila .enlace { min-height: 40px; font-size: 13px; }

.acciones { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.acciones > * { flex: 1 1 180px; }

/* Barra fija de revisar */
.fijas {
  position: sticky; bottom: 0; z-index: 5; margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, .78); border-top: 1px solid var(--linea);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.fijas > * { flex: 1 1 0; }
@media (min-width: 792px) {
  .fijas { margin: 0; padding: 12px; border: 1px solid var(--linea); border-bottom: 0; border-radius: 16px 16px 0 0; }
}

/* Mensajes */
.error, .aviso { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radio-campo); margin: 0 0 14px; font-size: 14px; }
.error::before, .aviso::before { flex: none; font-weight: 700; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; margin-top: 1px; }
.error { background: #1A0808; border: 1px solid #7F1D1D; color: #FCA5A5; }
.error::before { content: '!'; background: #7F1D1D; color: #FEE2E2; }
.aviso { background: #04160F; border: 1px solid #065F46; color: #A7F3D0; }
.aviso::before { content: 'i'; background: #065F46; color: #D1FAE5; }
.aviso .enlace { min-height: 0; padding: 0 0 0 4px; color: #A7F3D0; }
.ayuda { color: var(--gris-alt); font-size: 13px; font-weight: 400; margin: -4px 0 14px; }

/* Login */
.acceso { max-width: 400px; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; text-align: center; padding-top: 32px; padding-bottom: 48px; }
.acceso h1 { margin-bottom: 6px; }
.acceso .bajada { margin: 0 auto 28px; }
.acceso button { width: 100%; margin-top: 4px; }
.pie { margin-top: 24px; font-size: 12px; color: #7A7A7A; letter-spacing: .08em; text-transform: uppercase; }

@media (prefers-reduced-motion: no-preference) {
  .entra { animation: entra .5s cubic-bezier(.2, .7, .2, 1) both; }
  .entra:nth-child(2) { animation-delay: .05s; } .entra:nth-child(3) { animation-delay: .1s; }
  .entra:nth-child(4) { animation-delay: .15s; } .entra:nth-child(5) { animation-delay: .2s; }
  @keyframes entra { from { opacity: 0; transform: translateY(8px); } }
}
