@import url("https://fonts.googleapis.com/css2?family=Barlow:wght@300;400;500;600;700&family=Georgia&display=swap");

:root {
  --bg: #0a0a0a;
  --bg2: #111111;
  --bg3: #181818;
  --bg4: #222222;

  --gold: #c9a84c;
  --gold2: #e8d5a3;
  --gdim: rgba(201, 168, 76, 0.13);
  --gborder: rgba(201, 168, 76, 0.22);

  --w: #ffffff;
  --w2: rgba(255, 255, 255, 0.82);
  --w3: rgba(255, 255, 255, 0.42);
  --w4: rgba(255, 255, 255, 0.12);

  --coral: #c96b50;
  --coral-dim: rgba(201, 107, 80, 0.13);
  --coral-border: rgba(201, 107, 80, 0.3);
  --coral-text: #e0896e;

  --purple: #7c5c8a;
  --purple-dim: rgba(124, 92, 138, 0.13);
  --purple-border: rgba(124, 92, 138, 0.3);
  --purple-text: #b08ac0;

  --teal: #3d7a6f;

  --r: 14px;
  --pill: 999px;
  --font: "Barlow", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--w);
  font-family: var(--font);
  font-weight: 300;
  line-height: 1.55;
}

h1,
h2,
h3 {
  font-family: var(--font);
  font-weight: 500;
  margin: 0 0 0.4em;
  color: var(--w);
}

h1 {
  font-size: 1.7rem;
  font-weight: 300;
  line-height: 1.2;
}
h1 em,
h1 strong {
  font-style: normal;
  font-weight: 600;
  color: var(--gold);
}
h2 {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
h3 {
  font-size: 0.9rem;
  font-weight: 600;
}

p {
  color: var(--w3);
  font-weight: 300;
  margin: 0 0 1em;
}

a {
  color: var(--gold);
  text-decoration: none;
}

/* frases de marca: único lugar donde conservamos la serif itálica del brief original */
.cita,
.tagline {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
}

/* ---------- app shell ---------- */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 84px;
}

.contenido {
  padding: 0 16px 24px;
}

/* ---------- nav superior ---------- */
.nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--gborder);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.logo-marca {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  line-height: 1.2;
  text-decoration: none;
}

.logo-marca small {
  display: block;
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.14em;
  color: var(--w3);
  margin-top: 1px;
  text-transform: none;
}

.nav-iconos {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icono-nav {
  background: none;
  border: none;
  color: var(--w3);
  font-size: 19px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  text-decoration: none;
}

.icono-nav:hover {
  color: var(--gold);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--gborder);
  background: var(--gdim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
}

.volver {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--w3);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
}
.volver:hover {
  color: var(--gold);
}

/* ---------- nav inferior ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--bg);
  border-top: 1px solid var(--gborder);
  display: flex;
  padding: 8px 0 max(10px, env(safe-area-inset-bottom));
  z-index: 50;
}

.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  text-decoration: none;
  color: var(--w3);
}

.bn-item .bni {
  font-size: 19px;
}
.bn-item .bnl {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.bn-item.activo {
  color: var(--gold);
}

/* ---------- hero / saludo ---------- */
.hero {
  padding: 22px 16px 6px;
}

.saludo {
  font-size: 26px;
  font-weight: 300;
  line-height: 1.2;
  margin-bottom: 4px;
}
.saludo strong {
  font-weight: 500;
  color: var(--gold);
}

.hero-sub {
  font-size: 12px;
  color: var(--w3);
  font-weight: 300;
  margin-bottom: 18px;
}

/* ---------- búsqueda ---------- */
.buscador {
  position: relative;
  margin-bottom: 18px;
}
.campo-busqueda {
  width: 100%;
  padding: 12px 44px 12px 16px;
  border: 1.5px solid var(--gborder);
  border-radius: var(--pill);
  background: var(--bg2);
  font-family: var(--font);
  font-size: 13px;
  color: var(--w);
  outline: none;
}
.campo-busqueda::placeholder {
  color: var(--w3);
}
.campo-busqueda:focus {
  border-color: var(--gold);
}
.buscador .icono-buscar {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  font-size: 16px;
  pointer-events: none;
}

/* ---------- pills de modo (home) ---------- */
.modo-pills {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}
.modo-pill {
  flex: 1;
  border-radius: var(--r);
  border: 1.5px solid;
  padding: 13px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}
.modo-pill.emergencia {
  border-color: var(--coral-border);
  background: var(--coral-dim);
}
.modo-pill.explorar {
  border-color: var(--purple-border);
  background: var(--purple-dim);
}
.modo-pill .mp-e {
  font-size: 21px;
}
.modo-pill .mp-l {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.modo-pill.emergencia .mp-l {
  color: var(--coral-text);
}
.modo-pill.explorar .mp-l {
  color: var(--purple-text);
}
.modo-pill .mp-s {
  font-size: 10px;
  color: var(--w3);
  font-weight: 300;
}

/* ---------- secciones ---------- */
.seccion {
  padding: 20px 16px 6px;
}
.seccion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
}
.seccion-titulo {
  font-size: 14px;
  font-weight: 500;
}
.ver-todo {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
}
.divisor {
  height: 1px;
  background: var(--gborder);
  margin: 4px 16px 4px;
}

/* ---------- tarjetas de cápsula ---------- */
.lista-capsulas {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.capsula-card {
  background: var(--bg2);
  border: 1px solid var(--w4);
  border-radius: var(--r);
  padding: 12px 13px;
  display: flex;
  gap: 11px;
  align-items: flex-start;
  text-decoration: none;
  color: var(--w);
}
.capsula-card:hover {
  border-color: var(--gborder);
  background: var(--bg3);
}
.capsula-card.bloqueada {
  opacity: 0.5;
}
.capsula-icono {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.capsula-icono.cat-emergencia {
  background: var(--coral-dim);
}
.capsula-icono.cat-explorar {
  background: var(--purple-dim);
}
.capsula-cuerpo {
  flex: 1;
  min-width: 0;
}
.capsula-nombre {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 2px;
  line-height: 1.3;
  color: var(--w);
}
.capsula-desc {
  font-size: 11px;
  color: var(--w3);
  margin-bottom: 6px;
  font-weight: 300;
  line-height: 1.3;
}
.capsula-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--pill);
}
.tag.dur {
  background: var(--gdim);
  color: var(--gold);
}
.tag.cat-emergencia {
  background: var(--coral-dim);
  color: var(--coral-text);
  font-weight: 500;
}
.tag.cat-explorar {
  background: var(--purple-dim);
  color: var(--purple-text);
  font-weight: 500;
}
.capsula-estado {
  align-self: center;
  font-size: 15px;
  flex-shrink: 0;
}

/* ---------- scroll horizontal ---------- */
.scroll-h {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 16px 6px;
  scrollbar-width: none;
}
.scroll-h::-webkit-scrollbar {
  display: none;
}

.ruta-card {
  flex-shrink: 0;
  width: 190px;
  background: var(--bg2);
  border: 1px solid var(--gborder);
  border-radius: var(--r);
  padding: 13px;
  text-decoration: none;
  color: var(--w);
  display: block;
}
.ruta-card:hover {
  background: var(--bg3);
}
.ruta-card .re {
  font-size: 21px;
  margin-bottom: 7px;
}
.ruta-card .rt {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 3px;
  line-height: 1.3;
}
.ruta-card .rd {
  font-size: 10px;
  color: var(--w3);
  font-weight: 300;
  margin-bottom: 7px;
  line-height: 1.4;
}
.ruta-card .rm {
  font-size: 10px;
  color: var(--gold);
  font-weight: 500;
}
.ruta-card.bloqueada {
  border-color: var(--w4);
  opacity: 0.55;
}
.ruta-card.bloqueada .rt {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ---------- franja diario / accesos rápidos ---------- */
.franja {
  margin: 0 16px 8px;
  background: var(--bg2);
  border: 1px solid var(--gborder);
  border-radius: var(--r);
  padding: 13px 14px;
  display: flex;
  gap: 11px;
  align-items: center;
  text-decoration: none;
  color: var(--w);
}
.franja:hover {
  background: var(--bg3);
}
.franja .fi {
  font-size: 21px;
}
.franja .fb {
  flex: 1;
}
.franja .ft {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 1px;
  color: var(--w);
}
.franja .fs {
  font-size: 11px;
  color: var(--w3);
  font-weight: 300;
}
.franja .fa {
  color: var(--gold);
  font-size: 16px;
}

/* ---------- botones ---------- */
.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  border-radius: var(--pill);
  border: none;
  background: var(--gold);
  color: var(--bg);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
}
.boton.ancho {
  width: 100%;
}
.boton-secundario {
  background: transparent;
  color: var(--gold);
  border: 1.5px solid var(--gborder);
}
.boton:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- formularios ---------- */
label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--w3);
  margin-bottom: 6px;
}
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--w4);
  border-radius: var(--r);
  color: var(--w);
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 300;
  margin-bottom: 1.1rem;
  outline: none;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--gold);
}
.campo {
  margin-bottom: 1.1rem;
}
.error-form {
  color: var(--coral-text);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.aviso-ok {
  color: var(--gold);
  border: 1px solid var(--gborder);
  border-radius: var(--r);
  padding: 0.8rem 1rem;
  margin-bottom: 1.2rem;
  font-size: 0.85rem;
  background: var(--gdim);
}

/* ---------- encabezados de sección de pantalla ---------- */
.sct {
  padding: 16px 16px 4px;
}
.sct-h {
  font-size: 19px;
  font-weight: 500;
  margin-bottom: 3px;
}
.sct-s {
  font-size: 12px;
  color: var(--w3);
  font-weight: 300;
  margin-bottom: 14px;
}

/* ---------- detalle de cápsula ---------- */
.detalle-header {
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--w4);
}
.badge-cat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--pill);
  margin-bottom: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-cat.cat-emergencia {
  background: var(--coral-dim);
  color: var(--coral-text);
}
.badge-cat.cat-explorar {
  background: var(--purple-dim);
  color: var(--purple-text);
}
.detalle-titulo {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 7px;
  color: var(--w);
}
.detalle-desc {
  font-size: 13px;
  color: var(--w3);
  line-height: 1.6;
  margin-bottom: 13px;
  font-weight: 300;
}

/* ---------- reproductor ---------- */
.reproductor-wrap {
  margin: 16px 16px 0;
}
.reproductor-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r);
  background: var(--bg3);
  border: 1px solid var(--gborder);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 1rem;
}
.reproductor-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 40% 40%, rgba(201, 168, 76, 0.08), transparent 65%);
}
.boton-play {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 18px;
  position: relative;
  z-index: 1;
}
.reproductor-leyenda {
  font-size: 11px;
  color: var(--w3);
  letter-spacing: 0.05em;
  position: relative;
  z-index: 1;
  max-width: 80%;
}
.reproductor-leyenda code {
  color: var(--gold);
  font-family: "Menlo", "Consolas", monospace;
  font-size: 10px;
  display: block;
  margin-top: 4px;
}
.reproductor audio,
.reproductor video {
  width: 100%;
  display: block;
  border-radius: var(--r);
  background: #000;
}
.reproductor {
  margin: 16px 16px 0;
}

/* ---------- guion ---------- */
.guion-wrap {
  padding: 16px 16px 8px;
}
.guion-titulo {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 11px;
}
.guion {
  background: var(--bg2);
  border: 1px solid var(--w4);
  border-radius: var(--r);
  padding: 14px 15px;
  white-space: pre-wrap;
  font-size: 13px;
  color: var(--w2);
  font-weight: 300;
  line-height: 1.7;
}
.guion .placeholder-tag {
  display: block;
  color: var(--gold);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6em;
}

/* ---------- encuesta ---------- */
.encuesta {
  margin: 16px 16px 0;
  border: 1px solid var(--gborder);
  border-radius: var(--r);
  padding: 15px;
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.07), rgba(61, 122, 111, 0.03));
}
.escala-puntaje {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.escala-puntaje label {
  flex: 1;
  border: 1px solid var(--w4);
  border-radius: var(--r);
  padding: 10px 0;
  text-align: center;
  cursor: pointer;
  color: var(--w3);
  margin: 0;
  font-weight: 500;
  font-size: 13px;
}
.escala-puntaje input {
  display: none;
}
.escala-puntaje label:has(input:checked) {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gdim);
}

/* ---------- mapa emocional / barras ---------- */
.barras {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 1rem 0 1.4rem;
}
.barra-fila {
  display: grid;
  grid-template-columns: 96px 1fr 2.2rem;
  align-items: center;
  gap: 0.7rem;
}
.barra-emocion {
  font-size: 12px;
  color: var(--w2);
}
.barra-track {
  background: var(--bg2);
  border: 1px solid var(--w4);
  border-radius: var(--pill);
  height: 0.6rem;
  overflow: hidden;
}
.barra-fill {
  background: var(--gold);
  height: 100%;
  border-radius: var(--pill);
}
.barra-count {
  text-align: right;
  color: var(--w3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.tarjeta {
  border: 1px solid var(--gborder);
  background: var(--bg2);
  border-radius: var(--r);
  padding: 1rem 1.1rem;
  color: var(--w2);
  font-size: 0.85rem;
}
.tarjeta strong {
  color: var(--gold);
}

/* ---------- diario: selector de ánimo ---------- */
.grid-animos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-bottom: 18px;
}
.animo-boton {
  background: var(--bg2);
  border: 1px solid var(--w4);
  border-radius: 11px;
  padding: 11px 4px;
  text-align: center;
  cursor: pointer;
  display: block;
}
.animo-boton input {
  display: none;
}
.animo-boton .ae {
  font-size: 21px;
  display: block;
  margin-bottom: 3px;
}
.animo-boton .al {
  font-size: 9px;
  color: var(--w3);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.animo-boton:has(input:checked) {
  border-color: var(--gold);
  background: var(--gdim);
}
.animo-boton:has(input:checked) .al {
  color: var(--gold);
}

.entrada-diario {
  display: flex;
  gap: 9px;
  padding: 11px 0;
  border-bottom: 1px solid var(--w4);
}
.entrada-diario:last-child {
  border-bottom: none;
}
.entrada-diario .hem {
  font-size: 17px;
  flex-shrink: 0;
  margin-top: 2px;
}
.entrada-diario .fecha {
  font-size: 10px;
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
  text-transform: uppercase;
}
.entrada-diario p {
  font-size: 12px;
  color: var(--w2);
  font-weight: 300;
  line-height: 1.5;
  margin: 0;
}

/* ---------- carta futuro ---------- */
.carta-sellada {
  margin: 16px;
  border: 1px dashed var(--gborder);
  border-radius: var(--r);
  padding: 2rem 1.4rem;
  text-align: center;
  color: var(--w3);
}
.carta-contenido {
  margin: 16px;
  white-space: pre-wrap;
  background: var(--bg2);
  border: 1px solid var(--w4);
  border-radius: var(--r);
  padding: 1.1rem 1.2rem;
  color: var(--w2);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ---------- perfil ---------- */
.perfil-header {
  padding: 22px 16px 16px;
  text-align: center;
  border-bottom: 1px solid var(--w4);
}
.perfil-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: var(--gdim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 500;
  color: var(--gold);
  margin: 0 auto 11px;
}
.perfil-nombre {
  font-size: 19px;
  font-weight: 500;
  margin-bottom: 3px;
}
.perfil-sub {
  font-size: 11px;
  color: var(--w3);
  font-weight: 300;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--w4);
}
.stat-item {
  background: var(--bg);
  padding: 13px 8px;
  text-align: center;
}
.stat-numero {
  font-size: 19px;
  font-weight: 600;
  color: var(--gold);
  display: block;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 10px;
  color: var(--w3);
  font-weight: 300;
}
.banner-plan {
  margin: 14px 16px;
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.1), rgba(201, 168, 76, 0.04));
  border: 1px solid var(--gborder);
  border-radius: var(--r);
  padding: 14px;
}
.banner-plan .plbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.banner-plan .pltitle {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}
.banner-plan ul {
  margin: 0.5em 0 0;
  padding-left: 1.1rem;
  color: var(--w3);
  font-size: 12px;
}
.banner-plan li {
  margin-bottom: 0.3em;
}

/* ---------- racha ---------- */
.racha-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--gborder);
  background: var(--gdim);
  border-radius: var(--pill);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gold);
}

/* ---------- landing pública ---------- */
.landing-hero {
  text-align: center;
  padding: 3.5rem 1.2rem 2rem;
}
.landing-hero .cita {
  display: block;
  font-size: 1.2rem;
  margin: 0.9rem 0 1.6rem;
}
.landing-hero .acciones {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

footer.pie {
  text-align: center;
  color: var(--w3);
  font-size: 0.72rem;
  padding: 1.4rem 1rem 1.8rem;
}
