/* Shared chrome for /apps, /apps/presupuesto-flow and /apps/cali.
   Tokens, nav, buttons and FAQ are a copy of index.html: keep them in sync by hand.
   Page-specific styles stay inline in each page. */

:root {
  --bg: #07121B;
  --surface: #0E1E2B;
  --surface-2: #142A3C;
  --card: #0A1720;
  --ink: #F4F6F8;
  --ink-soft: #B9C5D0;
  --ink-mute: #A2AFBB;
  --line: rgba(255, 255, 255, 0.10);
  --line-soft: rgba(255, 255, 255, 0.05);
  --accent: #03CDD3;
  --accent-ink: #07121B;
  --accent-2: #6D52DA;
  --danger: #FF7A55;
  --ok: #34D399;
  --font-display: 'Kanit', system-ui, sans-serif;
  --font-ui: 'Nunito', system-ui, sans-serif;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(3, 205, 211, 0.08), 0 16px 40px -22px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, 0.8);
  --nav-h: 76px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; overflow-x: clip; }
body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
main { flex: 1; }
img, video { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 12px 18px; border-radius: 8px; font-weight: 700; }
.skip-link:focus { left: 16px; }
.i { width: 20px; height: 20px; flex-shrink: 0; fill: currentColor; }
.ic { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.nfw-wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 clamp(16px, 5vw, 48px); }
.nfw-wrap--wide { max-width: 1320px; }

/* Type */
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
h1 em, h2 em { font-style: normal; color: var(--accent); }
.h-page { font-size: clamp(36px, 6vw, 64px); line-height: 1.02; letter-spacing: -0.03em; }
.h-section { font-size: clamp(30px, 5vw, 50px); line-height: 1.02; letter-spacing: -0.03em; }
.nfw-lead { font-size: clamp(17px, 2.1vw, 20px); line-height: 1.55; color: var(--ink-soft); max-width: 62ch; text-wrap: pretty; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.eyebrow a:hover { text-decoration: underline; text-underline-offset: 3px; }
.fineprint { font-size: 14px; color: var(--ink-mute); }

/* Sections */
.sec { padding: clamp(64px, 9vw, 120px) 0; position: relative; }
.sec--surface { background: var(--surface); }
.sec--sep { border-top: 1px solid var(--line-soft); }
.sec-head { max-width: 760px; margin: 0 0 clamp(32px, 5vw, 52px); }
.sec-head .nfw-lead { margin-top: 18px; }

/* Buttons */
.nfw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 13px 24px; border-radius: 999px;
  font-family: var(--font-ui); font-weight: 800; font-size: 15px; line-height: 1.25;
  border: 1px solid transparent; cursor: pointer; text-align: center;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.nfw-btn:hover { transform: translateY(-1px); }
.nfw-btn--primary { background: var(--ink); color: var(--bg); }
.nfw-btn--primary:hover { background: var(--accent); color: var(--accent-ink); }
.nfw-btn--accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--accent) 70%, transparent); }
.nfw-btn--accent:hover { background: var(--ink); }
.nfw-btn--ghost { background: transparent; color: var(--ink); border-color: color-mix(in srgb, var(--ink) 28%, transparent); }
.nfw-btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.nfw-btn[disabled] { opacity: 0.6; cursor: progress; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.text-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* Nav: one persistent WhatsApp entry (the nav button), no floating button on these pages. */
.app-nav { position: sticky; top: 0; z-index: 50; padding: 12px clamp(12px, 3vw, 32px) 0; }
.app-nav-inner {
  display: flex; align-items: center; gap: 10px;
  max-width: 1160px; margin: 0 auto; padding: 6px 6px 6px 18px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 999px;
}
.app-brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; flex-shrink: 0; }
.app-brand img { height: 30px; width: auto; }
.app-brand-sep { width: 1px; height: 22px; background: var(--line); }
.app-brand-name { font: 700 20px/1 var(--font-display); letter-spacing: -0.02em; color: var(--accent); }
.app-nav-links { display: flex; align-items: center; gap: 2px; margin-left: auto; list-style: none; }
.app-nav-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; font-weight: 700; font-size: 14px; color: var(--ink-soft); border-radius: 999px; }
.app-nav-links a:hover, .app-nav-links a[aria-current="page"] { color: var(--ink); }
.app-nav-act { display: flex; align-items: center; gap: 6px; }
.app-nav .nfw-btn { min-height: 44px; padding: 10px 16px; font-size: 14px; }
@media (max-width: 860px) {
  .app-nav-links { display: none; }
  .app-nav-act { margin-left: auto; }
}
@media (max-width: 420px) {
  .app-brand img { height: 26px; }
  .app-nav .nfw-btn span { display: none; }
  .app-nav .nfw-btn { width: 44px; padding: 0; }
}

/* Breadcrumb */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; font-size: 14px; font-weight: 700; color: var(--ink-mute); }
.crumbs li + li::before { content: '/'; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--accent); }

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(22px, 2.6vw, 30px); display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow); transition: border-color 0.3s ease;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.card h3 { font-size: clamp(20px, 2.2vw, 24px); line-height: 1.12; }
.card p { color: var(--ink-soft); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: clamp(16px, 2.5vw, 24px); }
.ic-badge { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.ic-badge .ic { width: 22px; height: 22px; }

/* Steps */
.steps { list-style: none; counter-reset: step; display: grid; gap: 0; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 52px 1fr; gap: 16px; padding: 22px 0; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before {
  content: counter(step, decimal-leading-zero); font-family: var(--font-display); font-weight: 700; font-size: 22px;
  color: var(--accent); line-height: 1.2;
}
.steps h3 { font-size: clamp(19px, 2vw, 22px); margin-bottom: 6px; }
.steps p { color: var(--ink-soft); }

/* FAQ (same look as the homepage) */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.faq-list { max-width: 860px; }
.faq-item { border-top: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-q {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 64px; padding: 16px 0; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: clamp(17px, 2vw, 21px); line-height: 1.25;
}
.faq-toggle { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 18px; transition: background 0.2s, transform 0.3s; }
.faq-item[open] .faq-toggle { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); transform: rotate(45deg); }
.faq-a { padding-bottom: 20px; font-size: 16px; line-height: 1.6; color: var(--ink-soft); max-width: 64ch; }

/* Closing CTA */
.close-cta { background: color-mix(in srgb, var(--accent) 9%, var(--surface-2)); }
.close-cta .h-section { max-width: 18ch; }
.close-cta .nfw-lead { margin-top: 18px; }
.close-cta .btn-row { margin-top: 28px; }
.related { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); font-weight: 700; color: var(--ink-mute); }
.related a { color: var(--ink-soft); min-height: 44px; display: inline-flex; align-items: center; }
.related a:hover { color: var(--accent); }

/* Footer */
.app-footer { padding: 28px 0 calc(32px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line-soft); font-size: 14px; color: var(--ink-mute); }
.app-footer .nfw-wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; }
.app-footer nav { display: flex; flex-wrap: wrap; }
.app-footer a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; font-weight: 700; color: var(--ink-soft); }
.app-footer a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nfw-btn:hover { transform: none; }
  .faq-toggle { transition: none; }
}
