/* =========================================================
   Vivada Vault — página de la app (mobile-first)
   Mismo diseño que vivadaproyect.com, pero sin fuentes ni
   recursos externos: solo fuentes del sistema.
   ========================================================= */

:root {
  --blue: #0A5BD8;
  --cyan: #06C3F7;
  --grad: linear-gradient(135deg, #0A5BD8, #06C3F7);

  /* Tema claro */
  color-scheme: light;
  --bg: #EEF3FA;
  --bg-alt: #E6EDF7;
  --surface: #F8FAFD;
  --heading: #0B2545;
  --text: #3d4f6b;
  --link: #0A5BD8;
  --border: rgba(11, 37, 69, .1);
  --tag-bg: #E1EBFA;
  --nav-bg: rgba(248, 250, 253, .9);
  --shadow: 0 10px 30px rgba(11, 37, 69, .08);
  --shadow-lg: 0 18px 44px rgba(10, 91, 216, .18);

  --radius: 20px;
  --nav-h: 64px;
  --font-title: "Sora", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Tema oscuro (por defecto; lo fija el script del <head>) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A1424;
  --bg-alt: #0E1B30;
  --surface: #12335E;
  --heading: #E6EEF9;
  --text: #A9BCD6;
  --link: #6FB0FF;
  --border: rgba(255, 255, 255, .1);
  --tag-bg: rgba(59, 140, 255, .16);
  --nav-bg: rgba(10, 20, 36, .9);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, .45);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 8px); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); color: var(--text); background: var(--bg); line-height: 1.65; }
img { max-width: 100%; height: auto; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--font-title); color: var(--heading); line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 8vw, 3.6rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.container { width: min(1040px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -60px; background: #0B2545; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 200; }
.skip-link:focus { top: 12px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { font-family: var(--font-title); font-weight: 600; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--link); margin-bottom: .8em; }

/* ---------- Botones (mín. 48 px de alto: cómodo al tacto) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 28px; border-radius: 999px; border: 2px solid transparent;
  background: var(--grad); color: #fff; text-decoration: none;
  font-family: var(--font-title); font-weight: 600; font-size: 1rem;
  box-shadow: 0 8px 20px rgba(10, 91, 216, .3);
  transition: transform .25s ease, box-shadow .25s ease;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(10, 91, 216, .4); }
.btn--small { min-height: 44px; padding: 8px 20px; font-size: .92rem; }
.btn--big { min-height: 60px; padding: 16px 38px; font-size: 1.15rem; }
.btn--ghost { background: transparent; color: var(--link); border-color: var(--link); box-shadow: none; }
.btn--ghost:hover { background: var(--bg-alt); box-shadow: none; }
.btn--light { background: #fff; color: #0A5BD8; box-shadow: 0 10px 26px rgba(0, 0, 0, .2); }
.btn svg { width: 24px; height: 24px; flex: none; }

/* ---------- Barra superior ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--nav-h); z-index: 100; background: var(--nav-bg); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar__inner { height: 100%; display: flex; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-title); font-weight: 700; color: var(--heading); margin-right: auto; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.topnav { display: none; }
.topnav a { color: var(--heading); text-decoration: none; font-weight: 500; padding: 10px 12px; border-radius: 10px; }
.topnav a:hover { color: var(--link); background: var(--bg-alt); }
.theme-toggle { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: transparent; color: var(--heading); cursor: pointer; }
.theme-toggle:hover { background: var(--bg-alt); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: calc(var(--nav-h) + 40px) 0 56px; background: linear-gradient(180deg, var(--bg-alt), var(--bg)); text-align: center; }
.hero__bg { position: absolute; inset: 0; pointer-events: none; }
.shape { position: absolute; display: block; background: var(--grad); }
.shape--1 { width: 380px; height: 380px; right: -140px; top: -90px; border-radius: 50%; opacity: .16; filter: blur(8px); }
.shape--2 { width: 280px; height: 280px; left: -120px; bottom: -70px; border-radius: 60px; opacity: .12; transform: rotate(25deg); }
.hero__inner { position: relative; z-index: 1; }
.hero__icon { width: 96px; height: 96px; border-radius: 24px; margin: 0 auto 20px; box-shadow: var(--shadow-lg); }
.hero .lead { font-size: 1.2rem; max-width: 30ch; margin: 0 auto 28px; }
.hero__meta { margin: 18px 0 0; font-size: .92rem; }

/* ---------- Secciones ---------- */
.section { padding: 64px 0; }
.section--alt { background: var(--bg-alt); }
.section__head { max-width: 640px; margin-bottom: 36px; }

/* ---------- Galería (scroll horizontal con snap; funciona sin JavaScript) ---------- */
.gallery { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 16px 20px; margin-inline: -16px; scrollbar-color: var(--blue) transparent; }
.gallery__item { flex: 0 0 min(62vw, 240px); scroll-snap-align: center; margin: 0; }
.gallery__item img { width: 100%; border-radius: 22px; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--surface); }
.gallery__item figcaption { margin-top: 10px; font-size: .9rem; text-align: center; }

/* ---------- Tarjetas ---------- */
.grid { display: grid; gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 24px; transition: transform .3s ease, box-shadow .3s ease; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card p { margin: 0; font-size: .98rem; }
.icon { width: 52px; height: 52px; border-radius: 16px; background: var(--grad); color: #fff; display: grid; place-items: center; margin-bottom: 16px; box-shadow: 0 8px 18px rgba(10, 91, 216, .3); }
.icon svg { width: 26px; height: 26px; }

/* ---------- Seguridad ---------- */
.explain { display: grid; gap: 20px; }
.explain article { border-left: 4px solid var(--blue); padding: 4px 0 4px 20px; }
.explain h3 { margin-bottom: .3em; }
.explain p { margin: 0; }
.notice { margin-top: 28px; padding: 20px 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.notice p { margin: 0; }
.notice strong { color: var(--heading); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; max-width: 760px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 52px 16px 20px; min-height: 52px; font-family: var(--font-title); font-weight: 600; color: var(--heading); position: relative; border-radius: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; line-height: 1; color: var(--link); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0; padding: 0 20px 18px; }

/* ---------- Datos técnicos ---------- */
.specs { display: grid; gap: 0; max-width: 640px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.specs div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--border); }
.specs div:first-child { border-top: 0; }
.specs dt { color: var(--text); }
.specs dd { margin: 0; color: var(--heading); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.specs { margin: 0; }

/* ---------- Soporte y cierre ---------- */
.contact-list { display: flex; flex-direction: column; gap: 4px; }
.contact-list a { display: inline-block; padding: 8px 0; font-weight: 600; }
.cta { background: var(--grad); color: #fff; text-align: center; border-radius: 28px; padding: 52px 24px; box-shadow: var(--shadow-lg); }
.cta h2 { color: #fff; }
.cta p { max-width: 40ch; margin: 0 auto 26px; font-size: 1.1rem; }

.footer { background: var(--bg-alt); padding: 36px 0; text-align: center; font-size: .92rem; }
.footer__inner { display: grid; gap: 16px; justify-items: center; }
.footer .brand { display: inline-flex; margin-right: 0; padding: 0; }
.footer ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 24px; }
.footer a { display: inline-block; padding: 8px 0; color: var(--heading); text-decoration: none; font-weight: 500; }
.footer a:hover { color: var(--link); }
.footer p { margin: 0; }

/* ---------- Tablet / escritorio ---------- */
@media (min-width: 720px) {
  .grid--features { grid-template-columns: repeat(2, 1fr); }
  .explain { grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .contact-list { flex-direction: row; gap: 32px; }
  .topnav { display: flex; gap: 4px; }
}
@media (min-width: 960px) {
  .grid--features { grid-template-columns: repeat(3, 1fr); }
  .section { padding: 90px 0; }
}

/* ---------- Enlace de vuelta (arriba del hero) ---------- */
.backlink { margin: 0 0 20px; text-align: left; }
.backlink a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
.backlink a:hover { text-decoration: underline; }

/* ---------- Índice de apps (app/index.html) ---------- */
.apps { display: grid; gap: 20px; }
.app-card { display: flex; flex-direction: column; gap: 18px; padding: 26px 24px; }
.app-card__head { display: flex; align-items: center; gap: 16px; }
.app-card__icon { width: 64px; height: 64px; border-radius: 16px; flex: none; box-shadow: var(--shadow); }
.app-card h3 { margin: 0; font-size: 1.3rem; }
.app-card p { margin: 0; }
.app-card__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.app-card__actions .btn { flex: 1 1 150px; }
@media (min-width: 720px) {
  .apps { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Botón sin enlace (app aún no publicada) ---------- */
.btn--disabled { background: var(--bg-alt); color: var(--heading); border-color: var(--border); box-shadow: none; cursor: default; pointer-events: none; }
.btn--compact { padding-inline: 14px; white-space: nowrap; }
.brand--nowrap span { white-space: nowrap; }
.cta .btn--disabled { background: rgba(255, 255, 255, .18); color: #fff; border-color: rgba(255, 255, 255, .55); }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .btn:hover, .card:hover { transform: none; }
}
