/* App de la Parroquia Madre de Misericordia — pensada para personas mayores:
   letra grande, botones grandes, alto contraste y una cosa por pantalla. */
:root {
  --cafe: #5A3A1E; --cafe-2: #3E2814; --acento: #A0521A; --acento-2: #8A4512; --crema: #FBF7F1; --beige: #F6E7D6; --borde: #EADFCF; --borde-2: #CDBBA5;
  --texto: #2B1D12; --suave: #6B5442; --verde: #1F8F4E; --verde-suave: #E8F5EC; --rojo: #B3261E; --rojo-suave: #FBE3E1;
  --morado: #4A2F6E; --morado-2: #5B3A8C; --morado-suave: #EEE6F7; --morado-borde: #D9CCE8; --oro: #E9C46A;
  --ok: #E3F0DA; --ok-t: #2E4417; --pend: #FCEBD2; --pend-t: #6E3A06;
  --fs: 19px; --nav: 76px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
html[data-letra="grande"] { --fs: 21px; }
html[data-letra="muy-grande"] { --fs: 24px; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--crema); color: var(--texto); font-family: 'Nunito Sans', system-ui, -apple-system, sans-serif; font-size: var(--fs); line-height: 1.4; }
body { min-height: 100dvh; }
a { color: var(--acento-2); }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
h1, h2, h3, .serif { font-family: Lora, Georgia, serif; }
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; position: relative; background: var(--crema); }
.cargando { min-height: 100dvh; display: flex; align-items: center; justify-content: center; }
.cargando img { animation: lat 1.4s ease-in-out infinite; } @keyframes lat { 50% { transform: scale(.9); opacity: .7 } }
.spin { width: 38px; height: 38px; border: 4px solid var(--borde); border-top-color: var(--acento); border-radius: 50%; animation: gira 1s linear infinite; margin: 2rem auto; }
@keyframes gira { to { transform: rotate(360deg) } }

/* Barra superior */
.top { position: sticky; top: 0; z-index: 5; background: var(--cafe); color: #FFF8EE; padding: calc(10px + var(--safe-t)) 10px 10px; display: flex; align-items: center; gap: 6px; min-height: 64px; }
.top.morado { background: var(--morado); }
.top h1 { margin: 0; font-size: 1.2em; flex: 1; line-height: 1.15; }
.top .atras { width: 52px; height: 52px; border: 0; background: transparent; color: inherit; display: flex; align-items: center; justify-content: center; border-radius: 26px; cursor: pointer; flex: none; }
.top .atras:active { background: rgba(255,255,255,.15); }
.top .der { font-size: .8em; opacity: .85; padding-right: 6px; }
.logobar { background: #fff; border-bottom: 1px solid var(--borde); padding: calc(10px + var(--safe-t)) 16px 10px; display: flex; align-items: center; gap: 10px; }
.logobar img { height: 52px; width: auto; }
.campana { margin-left: auto; position: relative; width: 52px; height: 52px; border-radius: 26px; background: var(--beige); color: var(--acento); border: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; }
.campana b { position: absolute; top: -3px; right: -3px; min-width: 24px; height: 24px; border-radius: 12px; background: var(--rojo); color: #fff; font-size: 14px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }

/* Contenido */
.cuerpo { padding: 16px 16px calc(var(--nav) + 24px + var(--safe-b)); display: flex; flex-direction: column; gap: 12px; }
.cuerpo.sin-nav { padding-bottom: calc(24px + var(--safe-b)); }
.saludo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.saludo h2 { margin: 0; font-size: 1.3em; flex: 1; }
.chip { background: var(--morado-suave); color: var(--morado-2); border-radius: 99px; padding: 8px 14px; font-weight: 800; font-size: .8em; text-decoration: none; white-space: nowrap; }
.muted { color: var(--suave); }
.peq { font-size: .84em; }
.q { font-family: Lora, serif; font-size: 1.35em; font-weight: 700; margin: 0; line-height: 1.2; }
.paso { font-size: .78em; font-weight: 800; color: var(--acento-2); letter-spacing: .04em; text-transform: uppercase; }
.barra-paso { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; } .barra-paso span { height: 8px; border-radius: 4px; background: #E2D5C4; } .barra-paso span.on { background: var(--acento); }

/* Lema */
.lema { background: var(--cafe); color: #FFF8EE; border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.lema .et { font-size: .72em; font-weight: 800; letter-spacing: .06em; opacity: .8; text-transform: uppercase; }
.lema .frase { font-family: Lora, serif; font-style: italic; font-size: 1.02em; line-height: 1.3; }
.lema .valor b { color: #F4C98E; }

/* Botones grandes */
.big { min-height: 74px; border-radius: 18px; background: #fff; border: 2px solid var(--borde); display: flex; align-items: center; gap: 14px; padding: 10px 16px; font-size: 1.05em; font-weight: 800; text-decoration: none; color: var(--texto); cursor: pointer; text-align: left; width: 100%; }
.big:active { transform: scale(.985); }
.big .ic { width: 50px; height: 50px; border-radius: 14px; background: var(--beige); color: var(--acento); display: flex; align-items: center; justify-content: center; flex: none; }
.big .ar { margin-left: auto; color: var(--acento); font-size: 1.3em; padding-left: 6px; }
.big .sub { display: block; font-weight: 600; font-size: .78em; color: var(--suave); }
.big.principal { background: var(--acento); border-color: var(--acento); color: #fff; } .big.principal .ic { background: rgba(255,255,255,.18); color: #fff; } .big.principal .ar { color: #fff; }
.big.sel { border-color: var(--acento); background: #FFF1E3; }
.big.rezo { border-color: var(--morado-borde); } .big.rezo .ic { background: var(--morado-suave); color: var(--morado-2); } .big.rezo .ar { color: var(--morado-2); }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dos .big { min-height: 62px; font-size: .95em; padding: 8px 12px; gap: 10px; } .dos .big .ic { width: 40px; height: 40px; }
.franja { display: flex; align-items: center; gap: 10px; background: #FFF4E8; border: 2px dashed #E3B98A; border-radius: 16px; padding: 10px 14px; text-decoration: none; color: var(--texto); font-size: .9em; }
.franja .ar { margin-left: auto; color: var(--acento); font-weight: 800; }

.btn { min-height: 62px; border-radius: 18px; background: var(--acento); color: #fff; font-size: 1.08em; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; cursor: pointer; text-decoration: none; padding: 10px 18px; width: 100%; text-align: center; }
.btn:active { transform: scale(.985); filter: brightness(.95); }
.btn[disabled] { opacity: .45; }
.btn.wa { background: var(--verde); } .btn.azul { background: #2F5D8A; } .btn.morado { background: var(--morado-2); }
.btn.out { background: #fff; color: var(--texto); border: 2px solid var(--borde-2); min-height: 56px; font-size: 1em; }
.btn.link { background: transparent; color: var(--suave); min-height: 48px; font-size: .95em; font-weight: 700; }
.fondo { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }

.card { background: #fff; border: 1px solid var(--borde); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.card h3 { margin: 0; font-size: 1.05em; display: flex; align-items: center; gap: 10px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; } .kv span { color: var(--suave); } .kv b { text-align: right; }
.kv.hoy { background: #FFF1E3; margin: 0 -10px; padding: 6px 10px; border-radius: 10px; }
.nota { background: var(--verde-suave); color: #1D5A33; border-radius: 16px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: .92em; }
.nota.cafe { background: #FFF4E8; color: var(--texto); }
.vacio { text-align: center; color: var(--suave); padding: 24px 8px; }
.badge { font-size: .74em; font-weight: 800; padding: 5px 11px; border-radius: 99px; white-space: nowrap; display: inline-block; }
.b-ok { background: var(--ok); color: var(--ok-t); } .b-pend { background: var(--pend); color: var(--pend-t); } .b-fer { background: var(--rojo-suave); color: #9E1F17; } .b-gris { background: #ECE5DA; color: #5C4A3C; }

/* Formularios */
label.fl { font-weight: 800; font-size: .95em; margin-bottom: -4px; display: block; }
.inp { width: 100%; min-height: 62px; border: 2px solid var(--borde-2); border-radius: 16px; background: #fff; padding: 12px 16px; font: inherit; font-size: 1.08em; font-weight: 700; color: var(--texto); }
.inp:focus { outline: 3px solid #F0C98F; border-color: var(--acento); }
textarea.inp { min-height: 110px; resize: vertical; }
.opcion { min-height: 66px; border-radius: 16px; border: 2px solid var(--borde-2); background: #fff; display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; text-align: left; width: 100%; font-size: 1em; }
.opcion i { width: 28px; height: 28px; border-radius: 14px; border: 2px solid #9C8A76; flex: none; }
.opcion.sel { border-color: var(--acento); background: #FFF1E3; } .opcion.sel i { border: 8px solid var(--acento); }
.opcion[disabled] { opacity: .5; }
.dias { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dia { min-height: 80px; border-radius: 16px; border: 2px solid var(--borde-2); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; padding: 4px; }
.dia small { font-size: .74em; font-weight: 700; } .dia b { font-size: 1.4em; line-height: 1.1; } .dia em { font-size: .66em; font-style: normal; color: var(--suave); }
.dia.sel { background: var(--acento); border-color: var(--acento); color: #fff; } .dia.sel em { color: #fde9d6; }

/* Eventos / fechas */
.ev { background: #fff; border: 1px solid var(--borde); border-radius: 16px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.ev.fer { border: 2px solid #E9B4AE; }
.dt { width: 58px; height: 64px; border-radius: 12px; background: #F3EBE0; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; }
.dt small { font-size: .66em; font-weight: 800; text-transform: uppercase; } .dt b { font-size: 1.35em; line-height: 1; }
.dt.r { background: var(--rojo); color: #fff; }
.mesbar { display: flex; align-items: center; gap: 8px; }
.mesbar button { width: 52px; height: 52px; border-radius: 26px; border: 2px solid var(--borde-2); background: #fff; font-size: 1.3em; cursor: pointer; flex: none; }
.mesbar h2 { flex: 1; text-align: center; margin: 0; font-size: 1.2em; text-transform: capitalize; }

/* Rezar */
.texto-oracion { font-family: Lora, serif; font-size: 1.1em; line-height: 1.55; }
.texto-oracion .r, .r { color: #A3221B; }
.texto-oracion p { margin: 0 0 .7em; }
.texto-oracion .c { text-align: center; }
.horas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hora { min-height: 52px; border: 2px solid var(--morado-borde); border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .88em; cursor: pointer; text-decoration: none; color: var(--texto); text-align: center; padding: 4px; }
.hora.on { background: var(--morado-2); border-color: var(--morado-2); color: #fff; }
.hora.full { grid-column: 1 / -1; }
.herr { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.herr .btn { min-height: 56px; }
.aa { width: 92px; }
.cuentas { display: block; margin: 0 auto; width: 100%; max-width: 380px; height: auto; }
.misterio { background: #fff; border: 1px solid var(--morado-borde); border-radius: 16px; padding: 12px 14px; }
.misterio .t { font-family: Lora, serif; font-size: 1.2em; font-weight: 700; line-height: 1.25; }
.prog5 { display: flex; gap: 4px; margin-left: auto; } .prog5 span { width: 22px; height: 7px; border-radius: 4px; background: var(--morado-borde); } .prog5 span.on { background: var(--morado-2); }
.sw { width: 64px; height: 38px; border-radius: 19px; background: #CDBBA5; position: relative; border: 0; flex: none; cursor: pointer; }
.sw::after { content: ''; position: absolute; left: 4px; top: 4px; width: 30px; height: 30px; border-radius: 15px; background: #fff; transition: left .2s; }
.sw.on { background: #4E6B2E; } .sw.on::after { left: 30px; }
.fila-sw { display: flex; align-items: center; gap: 12px; }
.fila-sw > div { flex: 1; }

/* Barra inferior */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: #fff; border-top: 1px solid var(--borde); display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: var(--safe-b); max-width: 560px; margin: 0 auto; }
.nav a { min-height: var(--nav); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .74em; font-weight: 700; color: var(--suave); text-decoration: none; }
.nav a.on { color: var(--acento); font-weight: 800; }

/* Bienvenida / instalar */
.splash { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 0 22px calc(22px + var(--safe-b)); color: #FFF8EE;
  background: linear-gradient(180deg, rgba(40,25,14,.1) 0%, rgba(40,25,14,.35) 32%, rgba(58,38,22,.92) 62%, #5A3A1E 100%), url(/img/templo.jpg) center top / auto 60% no-repeat, #5A3A1E; }
.splash .marca { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 10px; text-align: center; padding-bottom: 22px; text-shadow: 0 2px 10px rgba(0,0,0,.45); }
.splash .logo { width: 116px; height: 116px; border-radius: 28px; background: #F5EFE6; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.splash .nombre { font-family: Lora, serif; font-size: 1.75em; font-weight: 700; line-height: 1.1; }
.splash .tarjeta { width: 100%; background: #fff; color: var(--texto); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 10px; text-shadow: none; }
.pasos-ios { display: flex; flex-direction: column; gap: 10px; }
.pasos-ios .p { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--borde); border-radius: 16px; padding: 12px 14px; }
.pasos-ios .n { font-family: Lora, serif; font-size: 1.5em; color: var(--acento); font-weight: 700; width: 26px; }
.pasos-ios .i { margin-left: auto; width: 46px; height: 46px; border-radius: 12px; background: #E9F1FB; color: #2F6FB5; display: flex; align-items: center; justify-content: center; flex: none; }

/* Chat simulado del registro */
.chat { background: #EFE7DD; border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 8px; font-size: .9em; }
.chat .yo { align-self: flex-end; background: #D9FDD3; border-radius: 14px 4px 14px 14px; padding: 8px 12px; max-width: 88%; }
.esperando { display: flex; align-items: center; gap: 12px; justify-content: center; color: var(--suave); font-weight: 700; }
.esperando .spin { margin: 0; width: 28px; height: 28px; border-width: 3px; }

#toast { position: fixed; left: 50%; bottom: calc(var(--nav) + 16px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--cafe-2); color: #fff; padding: 14px 20px; border-radius: 16px; font-weight: 700; opacity: 0; pointer-events: none; transition: all .25s; z-index: 20; max-width: calc(100% - 32px); text-align: center; }
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--rojo); }
.oculto { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
