@font-face { font-family: 'Jakarta'; src: url('fonts/jakarta.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
:root {
  --ciruela: #5B2A86; --ciruela-osc: #3B1758; --lavanda: #EFE6F6; --coral: #F06A7A; --coral-txt: #B3304D; --rosa: #FBE1E8;
  --salvia: #2C8566; --salvia-cl: #E2F3EC; --ambar: #B8650F; --ambar-cl: #FFF1DC; --indigo: #4258B8; --indigo-cl: #E7EBFA;
  --turquesa: #17808C; --turquesa-cl: #DFF3F4; --fondo: #FBF7FC; --tarjeta: #FFFFFF; --tinta: #2A1B33; --gris: #685E72; --linea: #E8DFEE;
  --sombra: 0 1px 2px rgba(59,23,88,.06), 0 6px 22px rgba(59,23,88,.08);
  --r: 18px; --seguro-abajo: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fondo); color: var(--tinta); font-family: 'Jakarta', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
a { color: var(--ciruela); }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

/* ---------- acceso ---------- */
.lock { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 18px calc(24px + var(--seguro-abajo));
  background: radial-gradient(120% 80% at 0% 0%, #F3E7FA 0%, transparent 60%), radial-gradient(120% 80% at 100% 100%, #FFE4EA 0%, transparent 55%), var(--fondo); }
.lockbox { width: 100%; max-width: 420px; text-align: center; }
.lockbox .logo { width: 88px; height: 88px; border-radius: 24px; box-shadow: 0 12px 30px rgba(91,42,134,.28); }
.lockbox h1 { font-size: 34px; margin: 14px 0 2px; letter-spacing: -.02em; color: var(--ciruela-osc); }
.lema { color: var(--gris); margin-bottom: 20px; }
.lockbox p { margin: 10px 0; }
.lockbox form, .lockbox .panel { text-align: left; background: var(--tarjeta); border-radius: var(--r); padding: 18px; box-shadow: var(--sombra); margin: 14px 0; }
.lbl { display: block; font-weight: 600; font-size: 14px; margin: 10px 0 6px; }
.pinwrap { position: relative; }
.pin { width: 100%; font-size: 26px; letter-spacing: .5em; text-align: center; padding: 12px 44px; border: 2px solid var(--linea); border-radius: 14px; background: #fff; }
.pin:focus { border-color: var(--ciruela); outline: none; }
.ojo { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; font-size: 20px; width: 44px; height: 44px; }
.pincount { font-size: 13px; color: var(--gris); text-align: center; margin-top: 4px; }
.msg { min-height: 22px; color: var(--coral-txt); font-weight: 600; text-align: center; margin: 8px 0; }
.mut { color: var(--gris); font-size: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 10px 0; }
.check input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--ciruela); }
.pasos { display: flex; gap: 6px; justify-content: center; margin: 4px 0 10px; }
.pasos i { width: 26px; height: 6px; border-radius: 6px; background: var(--linea); }
.pasos i.on { background: var(--ciruela); }
.beneficios { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.beneficios li { display: flex; gap: 10px; align-items: center; }
.beneficios b { font-size: 22px; width: 30px; text-align: center; }
.aviso { background: var(--ambar-cl); color: #6b3c06; padding: 10px 12px; border-radius: 12px; font-size: 14px; margin: 8px 0; }

/* ---------- botones ---------- */
.btn, .lockbox button[type=submit], .bio { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 14px; border: 0;
  background: var(--ciruela); color: #fff; font-weight: 700; width: 100%; margin-top: 12px; box-shadow: 0 6px 16px rgba(91,42,134,.25); }
.btn:active, .bio:active { transform: scale(.98); }
.bio { background: linear-gradient(135deg, var(--ciruela), #9A3E8C 60%, var(--coral)); font-size: 18px; min-height: 56px; }
.btn.sec { background: var(--lavanda); color: var(--ciruela-osc); box-shadow: none; }
.btn.peligro { background: #FCE4E8; color: var(--coral-txt); box-shadow: none; }
.btn.chico { width: auto; min-height: 40px; padding: 0 14px; margin-top: 0; font-size: 14px; }
.btn[disabled] { opacity: .6; }
.link { background: none; border: 0; color: var(--ciruela); font-weight: 600; text-decoration: underline; padding: 12px; min-height: 44px; }
.fila-btn { display: flex; gap: 10px; flex-wrap: wrap; }
.fila-btn .btn { flex: 1 1 140px; }

/* ---------- estructura principal ---------- */
.main { max-width: 1180px; margin: 0 auto; padding-bottom: calc(86px + var(--seguro-abajo)); }
.top { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(251,247,252,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--linea); }
.marca { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--ciruela-osc); letter-spacing: -.01em; }
.marca img { border-radius: 10px; }
.topacc { display: flex; gap: 4px; }
.ic { width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; font-size: 20px; }
.ic:hover { background: var(--lavanda); }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid var(--linea);
  padding-bottom: var(--seguro-abajo); box-shadow: 0 -6px 20px rgba(59,23,88,.06); }
.tabs button { border: 0; background: none; min-height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 600; color: var(--gris); }
.tabs .ti { font-size: 22px; line-height: 1; filter: grayscale(.7); opacity: .8; }
.tabs button.on { color: var(--ciruela); }
.tabs button.on .ti { filter: none; opacity: 1; transform: translateY(-1px); }
.rapida { padding: 12px 16px 0; }
#f-rapida { display: flex; gap: 8px; background: #fff; border-radius: 16px; padding: 6px; box-shadow: var(--sombra); border: 1px solid var(--linea); }
#qa { flex: 1; min-width: 0; border: 0; outline: none; padding: 10px; font-size: 16px; background: transparent; }
.btn-mas { width: 48px; height: 48px; border: 0; border-radius: 12px; background: var(--coral); color: #fff; font-size: 26px; font-weight: 700; flex: none; }
.qaprev { margin: 8px 4px 0; padding: 10px 12px; background: var(--lavanda); border-radius: 12px; font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qaprev .btn { width: auto; margin: 0; min-height: 38px; font-size: 14px; }
.view { padding: 14px 16px 10px; outline: none; }
h2 { font-size: 22px; margin: 6px 0 12px; letter-spacing: -.01em; color: var(--ciruela-osc); }
h3 { font-size: 16px; margin: 0 0 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.saludo { margin: 2px 0 14px; }
.saludo b { font-size: 24px; color: var(--ciruela-osc); display: block; letter-spacing: -.01em; }
.saludo span { color: var(--gris); }
.tarjeta { background: var(--tarjeta); border-radius: var(--r); padding: 16px; box-shadow: var(--sombra); margin-bottom: 14px; border: 1px solid #F1EAF5; }
.rejilla { display: grid; gap: 0 14px; }
.vacio { color: var(--gris); font-size: 14px; padding: 6px 0; }
.ejemplos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--linea); background: #fff; border-radius: 999px; padding: 8px 12px; font-size: 14px; min-height: 40px; }
.chip.on { background: var(--ciruela); border-color: var(--ciruela); color: #fff; }

/* ---------- listas de eventos ---------- */
.lista { list-style: none; margin: 0; padding: 0; }
.ev { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #F3EEF6; }
.ev:last-child { border-bottom: 0; }
.ev .ico { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 20px; }
.ev .cuerpo { flex: 1; min-width: 0; background: none; border: 0; text-align: left; padding: 0; }
.ev .tit { font-weight: 700; overflow-wrap: anywhere; }
.ev .sub { font-size: 13px; color: var(--gris); }
.ev.hecho .tit { text-decoration: line-through; color: var(--gris); }
.ev .der { text-align: right; font-weight: 700; white-space: nowrap; }
.tick { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--linea); background: #fff; flex: none; font-size: 15px; color: #fff; }
.tick.on { background: var(--salvia); border-color: var(--salvia); }
.estrella { color: #D9901A; }
.t-reunion { background: var(--indigo-cl); } .t-evento { background: var(--ambar-cl); } .t-fecha { background: var(--lavanda); }
.t-cumple { background: var(--rosa); } .t-salud { background: var(--turquesa-cl); } .t-pago, .t-deuda { background: var(--salvia-cl); } .t-tarea { background: #F2F0F4; } .t-ciclo { background: var(--rosa); }
.etq { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 8px; padding: 2px 8px; }
.etq.rojo { background: #FCE4E8; color: var(--coral-txt); } .etq.verde { background: var(--salvia-cl); color: #1D6A4F; } .etq.lila { background: var(--lavanda); color: var(--ciruela); }

/* ---------- calendario ---------- */
.mesnav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.mesnav b { font-size: 18px; text-transform: capitalize; }
.mesnav .ic { background: var(--lavanda); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dsem { text-align: center; font-size: 12px; font-weight: 700; color: var(--gris); padding: 4px 0; }
.dia { position: relative; aspect-ratio: 1 / 1.05; min-height: 44px; border: 0; border-radius: 12px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 6px; font-weight: 600; font-size: 15px; }
.dia.fuera { opacity: .35; }
.dia.hoy { box-shadow: inset 0 0 0 2px var(--ciruela); }
.dia.sel { background: var(--ciruela); color: #fff; }
.dia.c-per { background: #F9C9D6; } .dia.c-prev { background: repeating-linear-gradient(45deg, #FDE6EC, #FDE6EC 5px, #fff 5px, #fff 10px); } .dia.c-fert { background: #EAF6F0; }
.dia.sel.c-per, .dia.sel.c-prev, .dia.sel.c-fert { background: var(--ciruela); }
.puntos { display: flex; gap: 3px; margin-top: auto; margin-bottom: 7px; }
.puntos i { width: 6px; height: 6px; border-radius: 50%; background: var(--gris); }
.puntos i.p-reunion { background: var(--indigo); } .puntos i.p-evento { background: #E08A1E; } .puntos i.p-fecha { background: var(--ciruela); } .puntos i.p-cumple { background: var(--coral); }
.puntos i.p-salud { background: var(--turquesa); } .puntos i.p-pago, .puntos i.p-deuda { background: var(--salvia); } .puntos i.p-tarea { background: var(--gris); }
.dia.sel .puntos i { background: #fff; }
.leyenda { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--gris); margin-top: 10px; }
.leyenda span { display: inline-flex; align-items: center; gap: 5px; }
.leyenda i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.leyenda .l-per { background: #F9C9D6; } .leyenda .l-prev { background: repeating-linear-gradient(45deg, #FDE6EC, #FDE6EC 3px, #fff 3px, #fff 6px); border: 1px solid #F6C6D3; } .leyenda .l-fert { background: #EAF6F0; border: 1px solid #CDEBDD; }

/* ---------- ciclo ---------- */
.ciclo-hero { text-align: center; background: linear-gradient(160deg, #FFF0F4, #F4EAFB); }
.anillo { width: 172px; height: 172px; margin: 4px auto 8px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--coral) var(--avance, 0deg), #F3DDE6 0); }
.anillo > div { width: 138px; height: 138px; border-radius: 50%; background: #fff; display: grid; place-content: center; }
.anillo small { color: var(--gris); font-size: 13px; }
.anillo b { font-size: 40px; line-height: 1; color: var(--ciruela-osc); }
.fase { font-weight: 700; color: var(--coral-txt); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.nota-legal { font-size: 12px; color: var(--gris); margin-top: 8px; }

/* ---------- dinero ---------- */
.resumen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.cifra { border-radius: var(--r); padding: 14px; }
.cifra small { display: block; font-weight: 600; font-size: 13px; }
.cifra b { font-size: 24px; letter-spacing: -.01em; }
.cifra.debo { background: #FCE4E8; color: #7d1f35; } .cifra.medeben { background: var(--salvia-cl); color: #145a42; }
.barra { height: 8px; background: #F1EAF5; border-radius: 8px; overflow: hidden; margin-top: 6px; }
.barra i { display: block; height: 100%; width: 0; background: var(--salvia); border-radius: 8px; }
.deuda { padding: 12px 0; border-bottom: 1px solid #F3EEF6; }
.deuda:last-child { border-bottom: 0; }
.deuda .fila { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.deuda .acc { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.segm { display: grid; grid-template-columns: 1fr 1fr; background: var(--lavanda); padding: 4px; border-radius: 14px; margin-bottom: 12px; }
.segm button { border: 0; background: none; min-height: 42px; border-radius: 10px; font-weight: 700; color: var(--ciruela-osc); }
.segm button.on { background: #fff; box-shadow: var(--sombra); }

/* ---------- listas ---------- */
.agregar { display: flex; gap: 8px; margin-bottom: 8px; }
.agregar input { flex: 1; min-width: 0; }
.item-lista { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #F3EEF6; }
.item-lista .t { flex: 1; overflow-wrap: anywhere; }
.item-lista.hecho .t { text-decoration: line-through; color: var(--gris); }
.x { width: 40px; height: 40px; border: 0; background: none; color: var(--gris); font-size: 18px; border-radius: 10px; }

/* ---------- formularios y hoja ---------- */
input[type=text], input[type=number], input[type=date], input[type=time], input:not([type]), select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--linea); border-radius: 12px; background: #fff; font-size: 16px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ciruela); outline: none; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(42,27,51,.45); display: flex; align-items: flex-end; justify-content: center; }
.hoja { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 18px 18px calc(18px + var(--seguro-abajo)); animation: sube .22s ease-out; }
.hoja h2 { margin-top: 0; }
.cerrar { float: right; }
@keyframes sube { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.tipos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tipos button { border: 1.5px solid var(--linea); background: #fff; border-radius: 12px; min-height: 60px; font-size: 12px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; }
.tipos button span { font-size: 20px; }
.tipos button.on { border-color: var(--ciruela); background: var(--lavanda); color: var(--ciruela-osc); }

/* ---------- avisos y pie ---------- */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + var(--seguro-abajo)); z-index: 60; background: var(--tinta); color: #fff; padding: 12px 16px; border-radius: 14px;
  max-width: min(92vw, 520px); box-shadow: 0 10px 30px rgba(0,0,0,.25); display: flex; gap: 12px; align-items: center; font-size: 15px; }
.toast button { background: none; border: 0; color: #FFB3C0; font-weight: 800; min-height: 40px; }
.firma { text-align: center; color: var(--gris); font-size: 12px; margin-top: 18px; }
.firma p { margin: 2px 0; }
.firma .bowen { width: 120px; height: auto; margin: 4px auto; display: block; }
.piemain { padding: 0 16px 20px; }
.ajuste { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #F3EEF6; }
.ajuste:last-child { border-bottom: 0; }
.ajuste small { display: block; color: var(--gris); }
.interruptor { width: 60px; height: 40px; border-radius: 40px; border: 0; background: #D8CEE0; position: relative; flex: none; }
.interruptor::after { content: ''; position: absolute; top: 5px; left: 5px; width: 30px; height: 30px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.interruptor.on { background: var(--salvia); }
.interruptor.on::after { left: 25px; }
.versiones { font-size: 13px; color: var(--gris); }

/* ---------- tablet y escritorio ---------- */
@media (min-width: 760px) {
  .rejilla { grid-template-columns: 1fr 1fr; }
  .modal { align-items: center; }
  .hoja { border-radius: 24px; }
  .toast { bottom: 24px; }
}
@media (min-width: 900px) {
  .main { display: grid; grid-template-columns: 220px 1fr; grid-template-areas: 'top top' 'nav rap' 'nav view' 'nav pie'; padding-bottom: 20px; }
  .top { grid-area: top; }
  .tabs { grid-area: nav; position: sticky; top: 72px; align-self: start; display: flex; flex-direction: column; gap: 4px; background: none; border: 0; box-shadow: none; padding: 16px 10px; }
  .tabs button { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 14px; min-height: 50px; border-radius: 14px; font-size: 15px; }
  .tabs button.on { background: #fff; box-shadow: var(--sombra); }
  .rapida { grid-area: rap; padding-top: 16px; }
  .view { grid-area: view; }
  .piemain { grid-area: pie; }
  .agenda2 { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; align-items: start; }
  .dia { aspect-ratio: 1 / .82; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
