/* ============================================================
 MI AFP CON SENTIDO — app-style version (site/app/). Mode: operate.
 Not a website layout: no header, hero, stacked sections or footer columns. The first screen
 is a menu of buttons; each button opens one sheet; detail sits in accordions that open one
 at a time. Tokens come from styles.css and site.css, loaded before this file.
 ============================================================ */

:root { --sheet: 46rem; --bar: 3.5rem; --on-ink: rgba(255, 255, 255, 0.82); }

@view-transition { navigation: auto; }

body.app { min-height: 100svh; display: flex; flex-direction: column; background: var(--paper-2); }
.app :focus-visible { outline-color: var(--accent-ink); }
.app-home :focus-visible, .app-bar :focus-visible { outline-color: var(--accent); }

/* ---------- front screen: the menu ---------- */
.app-home { background: var(--ink); color: var(--white); position: relative; isolation: isolate; }
.home-film { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 78% 50%; z-index: -2; }
.app-home::before { content: ""; position: fixed; inset: 0; z-index: -1; background: color-mix(in srgb, var(--ink) 72%, transparent); }
.home { flex: 1; width: 100%; max-width: 62rem; margin-inline: auto; display: flex; flex-direction: column; justify-content: center;
  padding: max(1.5rem, env(safe-area-inset-top)) var(--gutter) 1.5rem; }
.home-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
/* the way back to the full website: a button on every screen, top right */
.app-full { display: inline-flex; align-items: center; gap: 0.4rem; min-height: var(--tap); padding: 0 1.1rem; border-radius: 999rem;
  border: var(--hair) solid var(--accent); color: var(--accent); font-weight: 700; font-size: 0.95rem; white-space: nowrap; }
.app-full:hover { background: var(--accent); color: var(--ink); }
.app-full svg { width: 1rem; height: 1rem; }
.app-bar .app-full { margin-left: auto; }
.home-brand { font-size: 0.8rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.home h1 { font-size: clamp(1.6rem, 1rem + 2.6vw, 2.9rem); margin-top: 0.8rem; text-wrap: balance; }
.home h1 .accent { color: var(--accent); }

.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; margin-top: clamp(1.4rem, 1rem + 2vw, 2.6rem); }
.tile-btn { display: grid; grid-template-columns: 1fr auto; gap: 0.3rem 0.8rem; align-content: start; min-height: 8.2rem;
  padding: 1.2rem 1.3rem; border-radius: var(--radius); background: color-mix(in srgb, var(--ink-2) 88%, transparent);
  border: 1px solid var(--line-dark); color: var(--white); transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast), background var(--dur-fast); } /* ds-allow-hardcode: 1px hairline */
.tile-btn:hover { transform: translateY(calc(var(--nudge) * -1)); border-color: var(--accent); background: var(--ink-3); }
.tile-btn:active { transform: none; }
.tile-btn-n { font-weight: 700; font-size: 0.85rem; letter-spacing: 0.1em; color: var(--accent); font-variant-numeric: tabular-nums; }
.tile-btn-go { grid-row: 1; grid-column: 2; color: var(--accent); }
.tile-btn-go svg { width: var(--icon); height: var(--icon); }
.tile-btn-t { grid-column: 1 / -1; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; line-height: 1.15; margin-top: 0.6rem; }
.tile-btn-s { grid-column: 1 / -1; font-size: 0.92rem; color: var(--on-ink); }

/* the same buttons on a light sheet (the three cuadernillos) */
.tile-grid-light .tile-btn { background: var(--ink-2); }
.tile-grid-light .tile-btn:hover { background: var(--ink-3); }

/* ---------- section screens: a slim bar and one sheet ---------- */
.app-bar { position: sticky; top: 0; z-index: 10; min-height: var(--bar); display: flex; align-items: center; gap: 1rem;
  padding: 0.4rem var(--gutter); padding-top: max(0.4rem, env(safe-area-inset-top)); background: var(--ink); color: var(--white); }
.app-back { display: inline-flex; align-items: center; gap: 0.5rem; min-height: var(--tap); padding: 0 1rem; border-radius: 999rem;
  background: var(--accent); color: var(--ink); font-weight: 700; }
.app-back:hover { background: var(--accent-hi); }
.app-bar-t { font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--on-ink); }

.app-view { flex: 1; width: 100%; padding: clamp(1rem, 0.6rem + 2vw, 2.4rem) var(--gutter); }
.sheet { max-width: var(--sheet); margin-inline: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(1.3rem, 1rem + 2vw, 2.6rem); box-shadow: var(--shadow-sm); } /* ds-allow-hardcode: 1px hairline */
.sheet h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); text-wrap: balance; }
.sheet h2 { font-family: var(--font-body); font-size: 1.05rem; font-weight: 700; letter-spacing: 0; margin-top: 1.8rem; }
.sheet h2.sheet-quiet { font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.sheet-eyebrow { font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.6rem; }
.sheet-lead { font-size: var(--text-lead); margin-top: 0.9rem; }
.sheet-note { color: var(--muted); font-size: 0.92rem; margin-top: 0.9rem; }
.sheet .tile-grid { margin-top: 1.4rem; }
.sheet .calc { margin-top: 1.2rem; padding: 0; border: 0; }
.sheet .rates { grid-template-columns: 1fr; gap: 0.8rem; margin-top: 1rem; }

/* accordions: one open at a time per group */
.acc-group { display: grid; gap: 0.6rem; margin-top: 0.9rem; }
.acc { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); } /* ds-allow-hardcode: 1px hairline */
.acc[open] { border-color: var(--green); background: var(--card); }
.acc summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto auto; gap: 0.2rem 1rem; align-items: center;
  min-height: var(--tap); padding: 0.85rem 1.1rem; font-weight: 700; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; color: var(--green); font-size: 1.4rem; line-height: 1; font-weight: 400; }
.acc[open] summary::after { content: "\2013"; }
.acc-m { display: grid; justify-items: end; font-weight: 400; color: var(--muted); font-size: 0.9rem; }
.acc-m strong { color: var(--ink); font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.acc-m:empty { display: none; }
.acc-k { display: block; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.acc-rec { display: inline-block; margin-left: 0.4rem; padding: 0.1rem 0.6rem; border-radius: 999rem; background: var(--green); color: var(--white); font-size: 0.74rem; vertical-align: middle; }
.acc-b { padding: 0 1.1rem 1.1rem; display: grid; gap: 0.7rem; }
.acc-b p { color: var(--muted); }
.acc-inc { font-weight: 700; color: var(--ink); }
.dots { list-style: disc; padding-left: 1.2rem; display: grid; gap: 0.4rem; color: var(--muted); }
ol.dots { list-style: decimal; }
.dots strong { color: var(--ink); }

/* chips: the next places to go */
.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.8rem; }
.chip { display: inline-flex; align-items: center; gap: 0.4rem; min-height: var(--tap); padding: 0 1.1rem; border-radius: 999rem;
  background: var(--green); color: var(--white); font-weight: 700; font-size: 0.95rem; }
.chip:hover { background: var(--green-ink); }
.chip svg { width: 1rem; height: 1rem; }
.chip-out { background: var(--green-soft); color: var(--green-ink); }
.chip-out:hover { background: var(--paper-2); }

/* ---------- the one-line foot ---------- */
.app-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.3rem 1.5rem; padding: 0.9rem var(--gutter);
  padding-bottom: max(0.9rem, env(safe-area-inset-bottom)); font-size: 0.82rem; color: var(--muted); }
.app-foot a { display: inline-block; padding-block: 0.3rem; text-decoration: underline; text-underline-offset: var(--nudge); }
.app-home .app-foot { color: var(--on-ink); }

@media (max-width: 760px) {
  .tile-grid { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  /* phones: the bar holds two buttons, so the section name gives up its place */
  .app-bar-t { display: none; }
  .tile-btn { min-height: 6.6rem; padding: 0.9rem 1rem; }
  .tile-btn-t { font-size: 1.05rem; margin-top: 0.3rem; }
  .tile-btn-s { font-size: 0.82rem; }
  .tile-grid-light { grid-template-columns: 1fr; }
  .acc summary { grid-template-columns: 1fr auto; }
  .acc-m { grid-column: 1; grid-row: 2; justify-items: start; }
  .acc summary::after { grid-column: 2; grid-row: 1; }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .tile-btn, .tile-btn:hover { transition: none; transform: none; }
}
