/* finanzas-mario — hoja base. Desde el bloque 04 de la v2, aquí solo queda lo común (base, campos) y la pantalla
   de entrada, que sigue con su aspecto v1. Todo lo de dentro de la app está en hoy.css (Hoy, barra, hojas, tokens
   --v2-*) y vistas.css (Resumen, Ajustes, cuadre, ventanas de pregunta). */

:root {
  /* Paleta v1: la usan la entrada y la banda del modo de prueba (contraste calculado sobre --fondo y --superficie) */
  --fondo: #f6f4ef;          /* el de theme-color y manifest */
  --superficie: #ffffff;
  --tinta: #1c1b19;          /* 15,7:1 sobre fondo · 17,2:1 sobre blanco */
  --tinta-suave: #57534b;    /* 7,0:1 sobre fondo · 7,7:1 sobre blanco */
  --linea-fuerte: #8a8478;   /* borde de campos y botones: 3,4:1 sobre fondo · 3,7:1 sobre blanco */
  --acento: #0e5a6b;         /* 7,1:1 sobre fondo · blanco encima 7,8:1 */
  --alerta: #b3261e;         /* 6,0:1 sobre fondo · 6,5:1 sobre blanco */

  --r-boton: 12px;
  --r-campo: 10px;
  --hueco: 16px;
  --ancho: 34rem;

  --t-rapida: 150ms;
  --curva: cubic-bezier(.2, 0, 0, 1);

  font-family: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--tinta);
  background: var(--fondo);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  min-height: 100dvh;
  font-size: 1rem;
  line-height: 1.45;
  overflow-x: hidden;
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

h1 { font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: 1.0625rem; line-height: 1.3; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--acento);
  outline-offset: 2px;
}

button:disabled { cursor: default; opacity: .55; }
button[aria-busy="true"] { opacity: .7; }
button[aria-busy="true"]::after { content: "…"; }

/* ------------------------------------------------------------ entrada (v1) */

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--r-boton);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--t-rapida) var(--curva), transform var(--t-rapida) var(--curva);
}
.boton:active:not(:disabled) { transform: scale(.98); }
.boton-principal { background: var(--acento); color: #fff; }

label { display: block; font-weight: 600; font-size: .9375rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"] {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: .5rem .75rem;
  border: 1px solid var(--linea-fuerte);
  border-radius: var(--r-campo);
  background: var(--superficie);
  font-size: 1.0625rem; /* ≥16 px: iOS no hace zoom al tocar */
}
input[type="date"] { -webkit-appearance: none; appearance: none; }
input:focus-visible { outline-offset: 0; border-color: var(--acento); }

.error { color: var(--alerta); font-weight: 600; text-wrap: pretty; }

.banda-prueba {
  padding: .375rem var(--hueco);
  padding-top: max(.375rem, env(safe-area-inset-top));
  background: var(--tinta);
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  text-align: center;
}

.aviso-sin-js {
  max-width: var(--ancho);
  margin: 2rem auto;
  padding: var(--hueco);
  font-weight: 600;
}

.pantalla-cargando {
  min-height: 60dvh;
  display: grid;
  place-items: center;
  padding: var(--hueco);
  color: var(--tinta-suave);
  text-align: center;
}

.pantalla-entrada {
  max-width: 24rem;
  margin: 0 auto;
  padding: max(3rem, env(safe-area-inset-top)) var(--hueco) 3rem;
}
.entrada-titulo { font-size: 2rem; margin-bottom: 1.5rem; }
.form-entrada { display: grid; gap: .5rem; }
.form-entrada input { margin-bottom: .5rem; }
.form-entrada .boton { width: 100%; margin-top: .5rem; }

/* ------------------------------------------------------------ «Fecha: hoy» plegable (hoja del «+»; colores en hoy.css) */

/* Control pequeño pero con cara de pulsable: valor subrayado y flecha; 44 px de zona táctil */
.otra-fecha { font-size: .9375rem; justify-self: start; }
.otra-fecha summary {
  display: inline-flex;
  align-items: center;
  gap: .25em;
  min-height: 44px;
  padding-right: .5rem;
  list-style: none;
  cursor: pointer;
}
.otra-fecha summary::-webkit-details-marker { display: none; }
.otra-fecha summary span {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.otra-fecha summary::after {
  content: "▾";
  transition: transform var(--t-rapida) var(--curva);
}
.otra-fecha[open] summary::after { transform: rotate(180deg); }
.otra-fecha[open] { justify-self: stretch; display: grid; gap: .375rem; padding-bottom: .25rem; }
