/* Difusor El Arte de Vivir — tema claro, pensado para gente no técnica.
   Tipografía grande, botones grandes, poco color y bien usado. */

:root {
  --fondo: #f7f6f3;
  --papel: #ffffff;
  --borde: #e2ded6;
  --texto: #23201c;
  --texto-suave: #6b6459;
  --acento: #c8641e;
  --acento-oscuro: #a44f14;
  --ok-fondo: #eaf5ec;
  --ok-borde: #b7ddc0;
  --ok-texto: #1e5b30;
  --aviso-fondo: #fdf5e0;
  --aviso-borde: #e8d08a;
  --aviso-texto: #6d5410;
  --error-fondo: #fdecea;
  --error-borde: #f0b6b0;
  --error-texto: #8c2318;
  --radio: 10px;
  --sombra: 0 1px 2px rgba(35, 32, 28, .06), 0 4px 14px rgba(35, 32, 28, .05);
}

* { box-sizing: border-box; }

html { color-scheme: light; }

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

.contenedor { max-width: 780px; margin: 0 auto; padding: 0 20px 72px; }
.contenedor-angosto { max-width: 460px; }

header.barra {
  background: var(--papel);
  border-bottom: 1px solid var(--borde);
  margin-bottom: 28px;
}
header.barra .contenedor {
  padding-top: 14px; padding-bottom: 14px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.marca { font-weight: 600; letter-spacing: -.01em; }
.marca span { color: var(--texto-suave); font-weight: 400; }

nav.menu { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
nav.menu a {
  color: var(--texto-suave); text-decoration: none;
  padding: 7px 12px; border-radius: 8px; font-size: 15px;
}
nav.menu a:hover { background: var(--fondo); color: var(--texto); }
nav.menu a.activo { background: var(--fondo); color: var(--texto); font-weight: 600; }

h1 { font-size: 30px; line-height: 1.2; margin: 0 0 10px; letter-spacing: -.02em; }
h2 { font-size: 21px; margin: 32px 0 12px; letter-spacing: -.01em; }
h3 { font-size: 17px; margin: 22px 0 8px; }
p  { margin: 0 0 14px; }
.bajada { color: var(--texto-suave); margin-bottom: 26px; }

.tarjeta {
  background: var(--papel);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 24px;
  box-shadow: var(--sombra);
  margin-bottom: 20px;
}

label { display: block; font-weight: 600; margin-bottom: 6px; }
.ayuda { color: var(--texto-suave); font-size: 15px; font-weight: 400; margin: -2px 0 8px; }

input[type=text], input[type=password], input[type=number], input[type=time],
input[type=tel], input[type=file], textarea, select {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--texto);
  background: var(--papel);
  border: 1px solid var(--borde);
  border-radius: 8px;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--acento);
  outline-offset: 1px;
  border-color: var(--acento);
}
textarea { min-height: 150px; resize: vertical; font-family: inherit; }
textarea.numeros { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; }

.campo { margin-bottom: 20px; }
.fila { display: flex; gap: 16px; flex-wrap: wrap; }
.fila > .campo { flex: 1 1 180px; }

button, .boton {
  display: inline-block;
  padding: 14px 24px;
  font: inherit; font-weight: 600;
  color: #fff; background: var(--acento);
  border: 1px solid var(--acento-oscuro);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
button:hover, .boton:hover { background: var(--acento-oscuro); }
button:disabled { opacity: .5; cursor: not-allowed; }
.boton-secundario {
  background: var(--papel); color: var(--texto); border-color: var(--borde);
}
.boton-secundario:hover { background: var(--fondo); color: var(--texto); }
.boton-peligro { background: #fff; color: var(--error-texto); border-color: var(--error-borde); }
.boton-peligro:hover { background: var(--error-fondo); color: var(--error-texto); }
.boton-ancho { width: 100%; }
.botonera { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.botonera form { margin: 0; }

.nota, .aviso, .error, .exito {
  border: 1px solid; border-radius: 8px; padding: 14px 16px; margin: 0 0 18px;
}
.nota   { background: var(--fondo);       border-color: var(--borde);       color: var(--texto-suave); }
.aviso  { background: var(--aviso-fondo); border-color: var(--aviso-borde); color: var(--aviso-texto); }
.error  { background: var(--error-fondo); border-color: var(--error-borde); color: var(--error-texto); }
.exito  { background: var(--ok-fondo);    border-color: var(--ok-borde);    color: var(--ok-texto); }
.nota :last-child, .aviso :last-child, .error :last-child, .exito :last-child { margin-bottom: 0; }
.aviso strong, .error strong { display: block; margin-bottom: 4px; }

table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--borde); }
th { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--texto-suave); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tabla-scroll { overflow-x: auto; }

.cifras { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.cifra {
  flex: 1 1 120px; background: var(--papel); border: 1px solid var(--borde);
  border-radius: var(--radio); padding: 16px;
}
.cifra .n { font-size: 30px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cifra .r { color: var(--texto-suave); font-size: 14px; }

.qr-caja { text-align: center; padding: 8px 0 4px; }
.qr-caja img {
  width: 264px; height: 264px; image-rendering: pixelated;
  border: 1px solid var(--borde); border-radius: 8px; background: #fff; padding: 8px;
}
.cuenta-regresiva { color: var(--texto-suave); font-size: 15px; margin-top: 10px; }
.codigo-vinculacion {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 38px; font-weight: 600; letter-spacing: .12em; text-align: center;
  padding: 18px; background: var(--fondo); border: 1px solid var(--borde); border-radius: 8px;
}

.estado { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.punto { width: 10px; height: 10px; border-radius: 50%; background: var(--texto-suave); }
.punto.ok { background: #2f9e52; }
.punto.espera { background: #d79a2b; }
.punto.mal { background: #c0392b; }

.pasos { list-style: none; padding: 0; margin: 0 0 18px; counter-reset: paso; }
.pasos li {
  counter-increment: paso; position: relative; padding: 0 0 10px 34px;
}
.pasos li::before {
  content: counter(paso); position: absolute; left: 0; top: 1px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--fondo); border: 1px solid var(--borde);
  font-size: 14px; font-weight: 600; display: grid; place-items: center;
}

.consentimiento label { font-weight: 400; display: flex; gap: 12px; align-items: flex-start; }
.consentimiento input[type=checkbox] { width: 22px; height: 22px; margin-top: 3px; flex: none; }

.variante {
  background: var(--fondo); border: 1px solid var(--borde); border-radius: 8px;
  padding: 12px 14px; margin-bottom: 8px; white-space: pre-wrap; font-size: 16px;
}
.previsualizacion img { max-width: 260px; border-radius: 8px; border: 1px solid var(--borde); }

.barra-progreso {
  height: 12px; background: var(--fondo); border: 1px solid var(--borde);
  border-radius: 999px; overflow: hidden; margin-bottom: 8px;
}
/* Sin transición a propósito: htmx reemplaza el fragmento entero cada 10 s, así que
   el nodo es nuevo y una transición de width nunca llegaría a correr (y encima
   provocaría layout). El ancho se pinta ya en su valor final. */
.barra-progreso > div { height: 100%; background: var(--acento); }

.pie { color: var(--texto-suave); font-size: 14px; margin-top: 34px; }
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
