/* app-instalada.css — Experiencia propia de la app instalada (oct. 2026).
   Ver assets/php/appInstalada.php. Todo vive detrás de html.to-app: en la web
   no aplica nada. Mobile-first (375px). */

/* Lo que solo existe en la app (login: "Soy nuevo, registrarme"). */
.app-solo { display: none !important; }
html.to-app .app-solo { display: block !important; }
html.to-app .app-web-solo { display: none !important; }

/* ── Bienvenida del home ── */
.app-bv { display: none; }
html.to-app-bv { overflow: hidden; }
html.to-app-bv .app-bv {
  display: flex;
  position: fixed; top: 0; left: 0; right: 0; height: 100%; height: 100dvh;
  z-index: 100000;
  background: radial-gradient(120% 80% at 50% 0%, #2a2a2e 0%, #121214 60%);
  color: #f5f5f7;
  align-items: center; justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.app-bv-inner { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; }
.app-bv-logo { width: 170px; height: auto; align-self: center; margin-bottom: 8px; }
.app-bv picture { align-self: center; }
.app-bv-titulo { font-size: 26px; font-weight: 800; margin: 6px 0 0; text-align: center; color: #fff; line-height: 1.2; }
.app-bv-sub { font-size: 15px; margin: 0 0 8px; text-align: center; color: rgba(245, 245, 247, .65); }

.app-bv-card {
  display: flex; align-items: center; gap: 14px;
  min-height: 96px; padding: 18px 16px;
  border-radius: 20px; text-decoration: none !important;
  background: #ffd11a; color: #121214 !important;
  box-shadow: 0 10px 30px rgba(255, 209, 26, .18);
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease;
}
.app-bv-card:active { transform: scale(.98); }
.app-bv-card-pro {
  background: rgba(255, 255, 255, .06); color: #f5f5f7 !important;
  border: 1.5px solid rgba(255, 255, 255, .16); box-shadow: none;
}
.app-bv-ico {
  flex: 0 0 52px; width: 52px; height: 52px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: rgba(18, 18, 20, .1);
}
.app-bv-card-pro .app-bv-ico { background: rgba(255, 209, 26, .14); color: #ffd11a; }
.app-bv-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.app-bv-txt b { font-size: 18px; font-weight: 800; line-height: 1.2; }
.app-bv-txt small { font-size: 14px; line-height: 1.35; opacity: .78; }
.app-bv-flecha { flex: 0 0 auto; font-size: 18px; opacity: .6; }

/* ── login.php en la app ── */
.app-login-nuevo {
  margin: 22px 0 0;
  padding: 16px; border-radius: 18px;
  background: #e9f9ef; border: 1.5px solid #22c55e; text-align: center;
}
.app-login-nuevo p { margin: 0 0 10px; font-size: 15px; color: #14532d; font-weight: 600; }
.app-login-nuevo .app-btn-registro {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; width: 100%; border-radius: 999px;
  background: #22c55e; color: #fff !important; font-weight: 800; font-size: 16px;
  text-decoration: none !important;
}
.app-login-busco { margin: 16px 0 0; text-align: center; font-size: 15px; }
.app-login-busco a { color: #121214; font-weight: 700; text-decoration: underline; display: inline-block; padding: 10px 4px; }

@media (prefers-reduced-motion: reduce) { .app-bv-card { transition: none; } }

/* ── Inicio de la app para el que busca: el asistente adelante ──
   Capa fija sobre el home (debajo del bottom-nav 1080 y de los SweetAlert
   1060; el chat 20000 queda arriba). Solo con html.to-app-ini. */
.app-ini { display: none; }
html.to-app-ini .app-ini {
  /* El home de la web queda oculto (ver el <style> del bloque): el inicio es
     la página, no una capa fija encima — sin scroll anidado ni nada pesado
     dibujándose atrás. */
  display: block; position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  background: radial-gradient(120% 70% at 50% 0%, #26262b 0%, #121214 62%);
  color: #f5f5f7;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
html.to-app-ini body { background: #121214; }
.app-ini-in, .app-ini-in * { box-sizing: border-box; }
.app-ini-in {
  max-width: 480px; margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(120px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
}
.app-ini-top { display: flex; align-items: center; justify-content: center; min-height: 40px; margin: 6px 0 14px; }
.app-ini-logo { width: 148px; height: auto; display: block; }
.app-ini-hola { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; text-align: center; color: #fff; line-height: 1.2; }
.app-ini-hola span { color: #ffd11a; }
.app-ini-ask {
  border-radius: 22px; padding: 16px;
  background: linear-gradient(160deg, rgba(255,209,26,.16), rgba(255,209,26,.04));
  border: 1px solid rgba(255,209,26,.45);
  display: flex; flex-direction: column; gap: 12px; margin: 0;
}
.app-ini-q { font-size: 18px; font-weight: 800; color: #fff; margin: 0; }
.app-ini-ask textarea {
  width: 100%; box-sizing: border-box; min-height: 96px; resize: none; border-radius: 14px;
  background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.12);
  padding: 12px 13px; font-size: 16px; line-height: 1.4; color: #fff; font-family: inherit;
}
.app-ini-ask textarea::placeholder { color: rgba(245,245,247,.45); }
.app-ini-ask textarea:focus { outline: none; border-color: rgba(255,209,26,.7); }
.app-ini-row { display: flex; align-items: center; gap: 8px; }
.app-ini-esp { flex: 1 1 auto; }
.app-ini-mic, .app-ini-send {
  width: 48px; height: 48px; flex: 0 0 auto; border-radius: 50%; border: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px; cursor: pointer;
}
.app-ini-mic { background: rgba(255,255,255,.08); color: #fff; }
.app-ini-mic[hidden] { display: none; }
.app-ini-mic.is-listening { background: rgba(220,53,69,.25); color: #ff8a8a; }
.app-ini-send { background: #ffd11a; color: #121214; box-shadow: 0 6px 18px rgba(255,209,26,.3); }
.app-ini-explorar {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px 16px;
  border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.22);
  color: #fff !important; text-decoration: none !important; font-size: 15.5px; font-weight: 700;
}
.app-ini-explorar i { color: #ffd11a; font-size: 18px; flex: 0 0 auto; }
.app-ini-explorar span { flex: 1 1 auto; min-width: 0; }
.app-ini-explorar:active, .app-ini-explorar:hover { background: rgba(255,209,26,.12); border-color: rgba(255,209,26,.45); }
.app-ini-ret {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px;
  background: rgba(255,209,26,.1); border: 1px solid rgba(255,209,26,.3);
  color: rgba(245,245,247,.85) !important; text-decoration: none !important; font-size: 14px; min-width: 0;
}
.app-ini-ret i { color: #ffd11a; font-size: 18px; flex: 0 0 auto; }
.app-ini-ret span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-ini-ret b { color: #ffd11a; }
.app-ini-sec { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: rgba(245,245,247,.5); margin: 10px 0 -2px; text-align: center; }
.app-ini-ex { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.app-ini-ex button {
  min-height: 40px; padding: 8px 14px; border-radius: 999px; font-family: inherit;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
  color: rgba(245,245,247,.85); font-size: 14px; cursor: pointer;
}
.app-ini-ex button:active { background: rgba(255,209,26,.18); }

.app-ini-aviso { margin: 8px 0 0; font-size: 13.5px; color: #ffd11a; line-height: 1.35; }
.app-ini-aviso[hidden] { display: none; }

/* Velocidad en la app instalada: el blur del bottom-nav sobre el contenido es
   de lo más caro de componer al scrollear en iPhone. Fondo casi opaco y sin
   backdrop-filter: se ve igual y no traba. */
html.to-app .bottom-nav-inner, html.to-app .bottom-nav-popup {
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  background: rgba(22, 24, 32, .96) !important;
}
