/* Panel de avance de obra de SAGIS.
   Pensado para el celular en obra: a una mano, con guantes y a pleno sol.
   De ahí los objetivos táctiles grandes y el contraste alto. */

:root {
  --espresso: #4c2b08;
  --crema: #faf8f5;
  --neblina: #dde8e5;
  --serenidad: #a7d4f9;
  --tinta: #2b1804;
  --gris: #6b6b6b;
  --borde: rgba(76, 43, 8, 0.14);
  --riesgo: #a8321e;
  --bien: #2f6b4f;
  --radio: 12px;
  --fuente: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--fuente);
  background: var(--crema);
  color: var(--tinta);
  line-height: 1.5;
  /* La barra inferior del navegador móvil tapa contenido; el padding evita
     que el último botón quede debajo de ella. */
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* --- Barra superior --- */
.barra {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 16px;
  background: var(--espresso); color: #fff;
}
.barra__marca {
  font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  font-size: 0.95rem; color: #fff; text-decoration: none;
}
.barra__marca span {
  font-weight: 300; opacity: 0.7; margin-left: 6px; text-transform: none; letter-spacing: 0.05em;
}
.barra__acciones { display: flex; align-items: center; gap: 8px; }
.barra__salir {
  display: inline-flex; align-items: center;
  background: rgba(255,255,255,0.14); color: #fff; border: 0;
  border-radius: 999px; padding: 8px 16px; font: inherit; font-size: 0.85rem;
  min-height: 40px; cursor: pointer; text-decoration: none; white-space: nowrap;
}

.contenido { max-width: 720px; margin: 0 auto; padding: 20px 16px 64px; }

/* --- Tipografía --- */
.titulo { font-size: 1.5rem; font-weight: 500; margin-bottom: 4px; }
.titulo--seccion { margin-top: 40px; }
.sub { color: var(--gris); font-size: 0.9rem; margin-bottom: 24px; }
.vacio { color: var(--gris); font-style: italic; padding: 16px 0; }
.volver {
  display: inline-block; color: var(--gris); text-decoration: none;
  font-size: 0.9rem; margin-bottom: 16px; min-height: 44px; line-height: 44px;
}

/* --- Avisos --- */
.aviso {
  border-radius: var(--radio); padding: 12px 16px; margin-bottom: 20px;
  font-size: 0.92rem; border-left: 4px solid;
}
.aviso--ok  { background: #eaf3ee; border-color: var(--bien);   color: var(--bien); }
.aviso--mal { background: #f9ecea; border-color: var(--riesgo); color: var(--riesgo); }

/* --- Tarjetas y formularios --- */
.tarjeta {
  background: #fff; border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 20px; margin-bottom: 24px;
}
.tarjeta__titulo { font-size: 1.05rem; font-weight: 500; margin-bottom: 16px; }

.campo { display: block; margin-bottom: 16px; }
.campo > span {
  display: block; font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--gris); margin-bottom: 6px;
}
.campo input[type="text"],
.campo input[type="email"],
.campo input[type="password"],
.campo textarea {
  width: 100%; padding: 12px; min-height: 48px;
  border: 1px solid var(--borde); border-radius: 8px;
  /* 16px es el mínimo que evita que iOS haga zoom al enfocar el campo. */
  font: inherit; font-size: 16px;
  background: var(--crema); color: var(--tinta);
}
.campo input:focus, .campo textarea:focus {
  outline: 2px solid var(--serenidad); outline-offset: 1px; background: #fff;
}
.campo textarea { resize: vertical; }
.campo input[type="file"] { width: 100%; padding: 12px 0; font-size: 0.95rem; }
.campo input[type="range"] { width: 100%; height: 44px; accent-color: var(--espresso); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; min-height: 52px; padding: 14px 20px;
  border: 1px solid var(--espresso); border-radius: 999px;
  background: transparent; color: var(--espresso);
  font: inherit; font-weight: 500; letter-spacing: 0.06em;
  cursor: pointer;
}
.btn--primario { background: var(--espresso); color: #fff; }
.btn--riesgo {
  width: auto; min-height: 40px; padding: 8px 16px; margin-top: 10px;
  border-color: var(--riesgo); color: var(--riesgo); font-size: 0.85rem;
}

/* --- Entrada --- */
.entrada { max-width: 380px; margin: 8vh auto 0; }
.entrada__titulo {
  text-align: center; font-size: 1.6rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--espresso);
}
.entrada__titulo span { font-weight: 300; text-transform: none; opacity: 0.6; margin-left: 8px; }
.entrada__sub { text-align: center; color: var(--gris); margin-bottom: 28px; font-size: 0.9rem; }

/* --- Lista de proyectos --- */
.lista { list-style: none; }
.proyecto {
  display: block; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 18px; margin-bottom: 14px;
}
.proyecto__cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.proyecto__cliente {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gris);
}
.etiqueta {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  background: var(--neblina); color: var(--gris); padding: 3px 8px; border-radius: 999px;
}
.proyecto__titulo { font-size: 1.15rem; font-weight: 500; margin: 4px 0; }
.proyecto__ubic { font-size: 0.85rem; color: var(--gris); margin-bottom: 12px; }
.proyecto__pie { font-size: 0.82rem; color: var(--gris); margin-top: 8px; }

.barra-avance {
  height: 6px; background: var(--neblina); border-radius: 999px; overflow: hidden;
}
.barra-avance__relleno { height: 100%; background: var(--espresso); border-radius: 999px; }

/* --- Línea de tiempo --- */
.linea { list-style: none; }
.linea__item {
  display: flex; gap: 14px; align-items: flex-start;
  background: #fff; border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 14px; margin-bottom: 12px;
}
.linea__foto {
  width: 92px; height: 92px; object-fit: cover; border-radius: 8px; flex-shrink: 0;
}
.linea__texto { min-width: 0; } /* deja que el texto largo se ajuste en vez de desbordar */
.linea__semana {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gris);
}
.linea__texto h3 { font-size: 1rem; font-weight: 500; margin: 2px 0 4px; }
.linea__texto p { font-size: 0.88rem; color: var(--gris); overflow-wrap: anywhere; }

@media (min-width: 560px) {
  .titulo { font-size: 1.9rem; }
  .btn { width: auto; min-width: 200px; }
  .linea__foto { width: 120px; height: 120px; }
}
