/* Cara-cliente del portal (S1).
   Sin framework: son tres pantallas y casi todas se abriran desde el movil,
   muchas veces desde el enlace de un WhatsApp. Tipos grandes y mucho aire: se
   lee de pie y con una mano. */

/* Los dos colores de Pilar Masdemont, muestreados de su web (6-ago-2026), no
   elegidos a ojo. El portal del trabajador es azul (#1565c0) porque es una
   herramienta interna; esto lo ve la clienta y va en la marca. */
:root {
  --verde: #14604D;
  --verde-oscuro: #0f4a3b;   /* hover: el mismo, mas cerrado */
  --crema: #FFFCF7;
  --texto: #1f2937;
  --gris: #6b7280;
  --borde: #d8d5cd;          /* gris con algo de calido, para no chocar con el crema */
  --rojo: #b91c1c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: var(--crema);
  color: var(--texto);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

.caja {
  width: 100%;
  max-width: 28rem;
  background: #fff;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

h1 {
  margin: 0 0 .25rem;
  font-size: 1.4rem;
}

.sub {
  margin: 0 0 1.5rem;
  color: var(--gris);
  font-size: .9rem;
}

label {
  display: block;
  margin: 1rem 0 .35rem;
  font-size: .9rem;
  font-weight: 500;
}

input {
  width: 100%;
  padding: .7rem .75rem;
  border: 1px solid var(--borde);
  border-radius: 8px;
  font-size: 1rem;      /* 16px o mas: por debajo, iOS hace zoom al enfocar */
}

input:focus {
  outline: 2px solid var(--verde);
  outline-offset: 1px;
  border-color: var(--verde);
}

button {
  width: 100%;
  margin-top: 1.5rem;
  padding: .8rem;
  border: 0;
  border-radius: 8px;
  background: var(--verde);
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}

button:hover { background: var(--verde-oscuro); }

.error {
  margin: 0 0 1rem;
  padding: .7rem .8rem;
  border-radius: 8px;
  background: #fee2e2;
  color: var(--rojo);
  font-size: .9rem;
}

.ayuda {
  margin-top: 1.25rem;
  color: var(--gris);
  font-size: .85rem;
}

.pendiente {
  margin: 1.5rem 0;
  padding: 1.25rem;
  border: 1px dashed var(--borde);
  border-radius: 8px;
  text-align: center;
  color: var(--gris);
}

.secundario { margin-top: 1.5rem; }

.enlace {
  width: auto;
  margin: 0;
  padding: 0;
  background: none;
  color: var(--gris);
  font-size: .9rem;
  text-decoration: underline;
}

.enlace:hover { background: none; color: var(--texto); }

.pie {
  margin-top: 1.5rem;
  color: var(--gris);
  font-size: .8rem;
}

/* --- ¿Quien eres? --- */

/* Un formulario por opcion (cada uno manda su propia clave), asi que el margen
   va aqui y no en el boton: si no, el `margin-top` de `button` los separaria el
   doble. */
.eleccion { margin: 0; }

.opcion {
  margin-top: .6rem;
  background: #fff;
  color: var(--texto);
  border: 1px solid var(--borde);
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;
  padding: .9rem 1rem;
}

.opcion:hover { background: #f2f7f4; border-color: var(--verde); color: var(--verde); }

/* --- El historial --- */

.visitas { list-style: none; margin: 0; padding: 0; }

.visitas li {
  padding: .9rem 0;
  border-bottom: 1px solid #eee9e1;
}

.visitas li:last-child { border-bottom: 0; }

.fecha {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
}

.servicios {
  display: block;
  margin-top: .1rem;
  color: var(--gris);
  font-size: .9rem;
}

/* El enlace al consejo ocupa su propia linea y se toca con el pulgar: es lo
   unico accionable de la pantalla. */
.consejo {
  display: inline-block;
  margin-top: .5rem;
  padding: .45rem .8rem;
  border: 1px solid var(--verde);
  border-radius: 999px;
  color: var(--verde);
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
}

.consejo:hover { background: var(--verde); color: #fff; }

/* --- Instalar en el movil --- */

/* Las dos acciones van ARRIBA y pequeñas: al final de noventa visitas no las ve
   nadie. En este tamaño se ven sin competir con el historial, que es a lo que
   ha venido. */
.acciones {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  margin: -.75rem 0 1.25rem;
}

.acciones form { margin: 0; }

/* `button` nace ancho y con margen para el boton macizo de la pantalla de
   entrar; aqui hay que deshacerlo. */
.accion {
  width: auto;
  margin: 0;
  padding: .3rem .75rem;
  border: 1px solid var(--borde);
  border-radius: 999px;
  background: #fff;
  color: var(--gris);
  font-size: .8rem;
  font-weight: 500;
}

.accion:hover { background: #f2f7f4; color: var(--texto); }

.accion-instalar { color: var(--verde); border-color: var(--verde); }

.accion-instalar:hover { background: var(--verde); color: #fff; }

.accion:disabled { opacity: .5; cursor: default; }

.instalar-ayuda {
  margin-bottom: 1.25rem;
  padding: .8rem 1rem;
  border: 1px solid var(--verde);
  border-radius: 8px;
  background: #f2f7f4;
  font-size: .9rem;
}

.instalar-ayuda p { margin: 0; }
