/* Autónomo · mobile-first. Buttons >= 48 px, big text, automatic dark mode. */

:root {
  --fondo: #f2f4f6;
  --tarjeta: #ffffff;
  --texto: #1c1e21;
  --suave: #5f6670;
  --linea: #e3e6ea;
  --acento: #1f5fa6;
  --acento-texto: #ffffff;
  --fondo-bot: #eef0f3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #101214;
    --tarjeta: #1b1e22;
    --texto: #e8eaed;
    --suave: #9aa1ab;
    --linea: #2a2e33;
    --acento: #7aaee8;
    --acento-texto: #0c1420;
    --fondo-bot: #191c1f;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  background: var(--fondo);
  color: var(--texto);
}

.cabecera { padding: 14px 16px 0; }
.cabecera h1 { margin: 0; font-size: 24px; }

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 8px 16px calc(96px + env(safe-area-inset-bottom));
}

.aviso {
  margin: 10px 16px 0;
  max-width: 448px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--acento);
  color: var(--acento-texto);
  font-size: 15px;
}

.tarjeta {
  background: var(--tarjeta);
  border: 1px solid var(--linea);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}

.tarjeta h2 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--suave);
}

.grande { font-size: 32px; font-weight: 700; line-height: 1.15; }
.sub { color: var(--suave); font-size: 15px; margin: 4px 0 0; }

.lista { list-style: none; margin: 6px 0 0; padding: 0; }
.lista li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--linea);
}
.lista li:first-child { border-top: none; }

button {
  font: inherit;
  font-size: 16px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--linea);
  border-radius: 12px;
  background: var(--fondo-bot);
  color: var(--texto);
  cursor: pointer;
}
button:active { transform: scale(.98); }
button.sel {
  background: var(--acento);
  border-color: var(--acento);
  color: var(--acento-texto);
  font-weight: 600;
}

.boton-grande {
  width: 100%;
  min-height: 56px;
  font-size: 18px;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  background: var(--acento);
  color: var(--acento-texto);
}

#barra {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.tab { flex: 1; min-height: 56px; font-size: 17px; font-weight: 600; }
.fab {
  flex: 2;
  min-height: 56px;
  font-size: 19px;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  background: var(--acento);
  color: var(--acento-texto);
}

.titulo { font-size: 20px; margin: 4px 0 10px; }

.etiqueta {
  margin: 14px 0 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--suave);
}



.fila { display: flex; gap: 8px; }
.fila button { flex: 1; }


input {
  font: inherit;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--linea);
  border-radius: 12px;
  background: var(--tarjeta);
  color: var(--texto);
}

/* ---- Autónomo ---- */
.cabecera { display: flex; align-items: center; justify-content: space-between; max-width: 480px; margin: 0 auto; }
.enlace {
  min-height: 44px; padding: 6px 10px; font-size: 15px; font-weight: 600;
  border: none; border-radius: 10px; background: none; color: var(--acento);
}
.centrado { display: block; width: 100%; margin-top: 8px; text-align: center; }
.peligro { color: #b3403a; }
@media (prefers-color-scheme: dark) { .peligro { color: #e0736c; } }

.cifra { font-size: 44px; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; }
.grande-medio { font-size: 22px; font-weight: 700; margin: 0; }
.tocable { cursor: pointer; }
.nota { color: var(--suave); font-size: 14.5px; margin: 8px 2px 14px; }
/* First use: one question per screen. */
.progreso { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--suave); }
.opciones { display: grid; gap: 10px; margin-top: 16px; }
.opcion {
  min-height: 56px; padding: 12px 16px; text-align: left; font-size: 18px; font-weight: 600;
  border: 1px solid var(--linea); border-radius: 14px; background: var(--fondo-bot); color: var(--texto);
}
.opcion:active { background: var(--acento); color: var(--acento-texto); }
.ayuda { margin-top: 10px; }
.ver-mas { margin: 8px 0 0; font-size: 15px; font-weight: 600; color: var(--acento); }
.boton-grande.secundario { margin-top: 10px; background: var(--fondo-bot); color: var(--texto); border: 1px solid var(--linea); }
details.mas > .tarjeta { margin-top: 10px; }
main > section > div > .boton-grande, .formulario .boton-grande { margin-top: 14px; }

/* Home status line. */
.estado {
  display: block; width: 100%; text-align: left;
  padding: 14px; border-radius: 14px; font-size: 17px; font-weight: 600;
  border: 1px solid var(--linea); background: var(--tarjeta); margin-bottom: 12px;
}
.estado.ok { color: var(--acento); }
.estado.pendiente { border-color: #d9a400; }
.estado.urgente { border-color: #c2410c; color: #c2410c; }
@media (prefers-color-scheme: dark) {
  .estado.urgente { border-color: #f08a5d; color: #f08a5d; }
}

/* Forms. */
input { font: inherit; width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--linea);
  border-radius: 12px; background: var(--tarjeta); color: var(--texto); }
input.importe { font-size: 30px; font-weight: 700; text-align: right; }
.fila { display: flex; gap: 8px; }
.fila button { flex: 1; min-width: 0; padding: 8px 6px; }
.formulario > .fila:first-child, .fila + .formulario { margin-top: 12px; }
.formulario { margin-top: 12px; }
.fecha-otra { margin-top: 8px; }
.boton-foto { font-weight: 600; }
.foto-vista { display: block; max-width: 100%; max-height: 260px; margin: 10px auto 0; border-radius: 12px; }
.explica { min-height: 1.4em; margin-top: 10px; }
details.mas { margin-top: 14px; border: 1px solid var(--linea); border-radius: 12px; padding: 4px 12px 12px; }
details.mas summary { min-height: 40px; display: flex; align-items: center; font-weight: 600; color: var(--acento); cursor: pointer; }
select { font: inherit; width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--linea);
  border-radius: 12px; background: var(--tarjeta); color: var(--texto); }
/* Activity finder. */
.resultados { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.resultado { text-align: left; font-size: 15px; font-weight: 500; padding: 10px 12px; min-height: 44px; }

/* Filing in Hacienda. */
.pasos { margin: 8px 0 0; padding-left: 22px; font-size: 15px; }
.pasos li + li { margin-top: 8px; }
.pasos a { color: var(--acento); font-weight: 600; }

/* Quarter selector. */
.selector-trimestre { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.selector-trimestre .mini { min-width: 48px; min-height: 44px; font-size: 22px; padding: 0; }
.selector-nombre { flex: 1; text-align: center; font-weight: 700; }
#apuntes > .fila { margin-bottom: 12px; }

/* Rows in the list. */
.apunte {
  display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px;
  text-align: left; border: none; border-top: 1px solid var(--linea); border-radius: 0;
  background: none; padding: 10px 2px; min-height: 56px;
}
.tarjeta h2 + .apunte { border-top: none; }
.apunte-izq { min-width: 0; }
.apunte-titulo { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apunte-sub { color: var(--suave); font-size: 14px; }
.apunte-marca { color: #a16207; font-size: 13px; font-weight: 600; }
.apunte-der { font-weight: 700; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .apunte-marca { color: #e3b341; } }

/* Tax boxes. */
.casilla-fila { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; padding: 7px 0;
  border-top: 1px solid var(--linea); font-size: 15px; align-items: baseline; }
.tarjeta h2 + .casilla-fila { border-top: none; }
.casilla { color: var(--suave); font-variant-numeric: tabular-nums; font-size: 13px; }
.casilla-importe { white-space: nowrap; font-variant-numeric: tabular-nums; }
.casilla-fila.total { font-weight: 700; }
.avisos { margin: 0; padding-left: 18px; font-size: 15px; }
.avisos li + li { margin-top: 8px; }

/* Bottom bar: 3 tabs + the big "+". */
.tab { font-size: 15px; padding: 6px 4px; }
.tab.activa { border-color: var(--acento); color: var(--acento); }
.fab { flex: 1.2; font-size: 30px; line-height: 1; }
#barra { background: linear-gradient(transparent, var(--fondo) 30%); }

.tarjeta a { color: var(--acento); font-weight: 600; }
