@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,500;0,9..144,700;1,9..144,400&family=Plus+Jakarta+Sans:wght@400;500;600&display=swap');

:root {
  --verde: #1A4A3A;
  --verde-mid: #0F6E56;
  --verde-light: #E1F5EE;
  --verde-soft: #C8EDE0;
  --morado: #3C3489;
  --morado-light: #EEEDFE;
  --naranja: #854F0B;
  --naranja-light: #FAEEDA;
  --crema: #FAFAF6;
  --crema-dark: #F2F0E8;
  --text: #1C1C1A;
  --text-soft: #5C5C5A;
  --text-lighter: #8C8C8A;
  --border: rgba(0,0,0,0.08);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--crema);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ── SPLASH ─────────────────────────────── */
#splash {
  position: fixed; inset: 0;
  background: var(--verde);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 1000;
  transition: opacity .5s ease, visibility .5s ease;
}
#splash.hidden { opacity: 0; visibility: hidden; }
.splash-icon { font-size: 56px; margin-bottom: 20px; animation: pulse 1.5s ease infinite; }
.splash-title { font-family: var(--font-display); font-size: 28px; color: #fff; font-weight: 500; text-align: center; margin-bottom: 6px; }
.splash-sub { font-size: 14px; color: rgba(255,255,255,0.65); }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }

/* ── LAYOUT ─────────────────────────────── */
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

/* ── TOPBAR ─────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,250,246,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex; align-items: center; gap: 12px;
}
.topbar-back {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px;
  flex-shrink: 0;
  display: none;
}
.topbar-back.visible { display: flex; }
.topbar-title { font-family: var(--font-display); font-size: 17px; font-weight: 500; flex: 1; }
.topbar-badge { font-size: 11px; padding: 3px 10px; border-radius: 20px; background: var(--verde-light); color: var(--verde); font-weight: 600; }

/* ── HOME ─────────────────────────────── */
.home { flex: 1; padding: 0 0 80px; }

.hero {
  background: var(--verde);
  padding: 32px 24px 40px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; bottom: -30px; left: -20px; right: -20px;
  height: 60px;
  background: var(--crema);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.hero-eyebrow { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 8px; }
.hero-title { font-family: var(--font-display); font-size: 30px; color: #fff; font-weight: 500; line-height: 1.2; margin-bottom: 8px; }
.hero-sub { font-size: 13px; color: rgba(255,255,255,0.7); line-height: 1.5; }

.section-label {
  font-size: 11px; font-weight: 600; color: var(--text-lighter);
  text-transform: uppercase; letter-spacing: 1.5px;
  padding: 0 24px; margin: 28px 0 14px;
}

/* ── GRUPO SELECTOR ─────────────────────── */
.grupo-tabs {
  display: flex; gap: 8px;
  padding: 0 24px;
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.grupo-tabs::-webkit-scrollbar { display: none; }
.grupo-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 24px;
  border: 1.5px solid var(--border);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  background: #fff;
  color: var(--text-soft);
  transition: all .2s;
  display: flex; align-items: center; gap: 6px;
}
.grupo-tab.g1.active { background: var(--verde-light); border-color: var(--verde-mid); color: var(--verde); }
.grupo-tab.g2.active { background: var(--morado-light); border-color: var(--morado); color: var(--morado); }
.grupo-tab.g3.active { background: var(--naranja-light); border-color: var(--naranja); color: var(--naranja); }

/* ── MES CARD ─────────────────────────── */
.mes-card {
  margin: 0 24px 12px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.mes-card:active { transform: scale(0.98); }
.mes-card-head {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
}
.mes-num {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
.mes-info { flex: 1; }
.mes-info h3 { font-family: var(--font-display); font-size: 16px; font-weight: 500; margin-bottom: 2px; }
.mes-info p { font-size: 12px; color: var(--text-soft); }
.mes-arrow { font-size: 18px; color: var(--text-lighter); }

.semana-list { border-top: 1px solid var(--border); }
.semana-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}
.semana-item:last-child { border-bottom: none; }
.semana-item:active { background: var(--crema-dark); }
.semana-num { font-size: 11px; font-weight: 600; color: var(--text-lighter); width: 24px; flex-shrink: 0; }
.semana-info { flex: 1; }
.semana-info strong { font-size: 14px; font-weight: 500; display: block; }
.semana-info span { font-size: 12px; color: var(--text-soft); }
.semana-arrow { font-size: 14px; color: var(--text-lighter); }

/* ── CLASE VIEW ─────────────────────────── */
.clase-view { flex: 1; padding-bottom: 80px; }

.clase-hero {
  padding: 28px 24px 36px;
  position: relative; overflow: hidden;
}
.clase-hero::after {
  content: '';
  position: absolute; bottom: -20px; left: 0; right: 0;
  height: 40px;
  background: var(--crema);
  border-radius: 50%;
}
.clase-eyebrow { font-size: 11px; font-weight: 600; opacity: .65; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.clase-title { font-family: var(--font-display); font-size: 26px; font-weight: 500; color: #fff; line-height: 1.2; margin-bottom: 6px; }
.clase-ref { font-size: 12px; color: rgba(255,255,255,.7); font-style: italic; }

.objetivo-box {
  margin: 24px 24px 0;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px 16px;
  font-size: 13px; line-height: 1.6;
  color: var(--text-soft);
}
.objetivo-box strong { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-lighter); margin-bottom: 5px; }

.sentidos-row {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 16px 24px 0;
}
.sentido-pill {
  font-size: 11px; font-weight: 500;
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-soft);
}

/* ── BLOQUES ─────────────────────────────── */
.bloques { padding: 16px 24px 0; }
.bloque {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.bloque-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}
.bloque-ico {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.bloque-meta { flex: 1; }
.bloque-meta strong { font-size: 14px; font-weight: 600; display: block; margin-bottom: 1px; }
.bloque-meta span { font-size: 11px; color: var(--text-soft); }
.bloque-time {
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 10px;
  flex-shrink: 0;
}
.bloque-arrow { font-size: 16px; color: var(--text-lighter); transition: transform .2s; margin-left: 4px; }
.bloque.open .bloque-arrow { transform: rotate(180deg); }
.bloque-body { display: none; padding: 4px 16px 16px; }
.bloque.open .bloque-body { display: block; }

/* ── CONTENIDO INTERNO ─────────────────── */
.bloque-body p { font-size: 13px; line-height: 1.7; color: var(--text-soft); margin-bottom: 8px; }
.bloque-body p:last-child { margin-bottom: 0; }

.script {
  background: var(--crema-dark);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px; line-height: 1.8;
  color: var(--text);
  margin-bottom: 10px;
  border-left: 3px solid var(--verde-mid);
  font-style: italic;
}

.cancion {
  background: var(--verde-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px; line-height: 1.9;
  color: var(--verde);
  margin-bottom: 10px;
}

.versiculo-box {
  background: linear-gradient(135deg, var(--verde-light), var(--crema-dark));
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-display);
  font-size: 15px; line-height: 1.7;
  color: var(--verde);
  margin-bottom: 10px;
  text-align: center;
  border: 1px solid var(--verde-soft);
}
.versiculo-box small { font-family: var(--font-body); font-size: 11px; color: var(--verde-mid); display: block; margin-top: 4px; }

.pregunta {
  background: var(--crema-dark);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px; line-height: 1.6;
  margin-bottom: 7px;
  border: 1px solid var(--border);
}

.din-desc {
  background: var(--crema-dark);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 13px; line-height: 1.6;
  color: var(--text-soft);
  margin-bottom: 10px;
  font-style: italic;
}

.materiales {
  font-size: 12px;
  color: var(--text-soft);
  padding: 10px 12px;
  background: var(--crema-dark);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  line-height: 1.7;
}

.nota-maestro {
  border-left: 3px solid #EF9F27;
  background: var(--naranja-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 12px;
  font-size: 12px; line-height: 1.6;
  color: var(--naranja);
  margin-top: 8px;
}

.tarea {
  background: linear-gradient(135deg, #E8F5FF, #EEF8FF);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px; line-height: 1.7;
  color: #1A4A6E;
  margin-top: 8px;
  border: 1px solid #C5E3FF;
}

.bloque-body ol, .bloque-body ul {
  padding-left: 4px;
  margin-bottom: 8px;
}
.bloque-body ol li, .bloque-body ul li {
  font-size: 13px; line-height: 1.7;
  color: var(--text-soft);
  padding: 4px 0 4px 8px;
  border-bottom: 1px solid var(--border);
  list-style: none;
}
.bloque-body ol li:last-child, .bloque-body ul li:last-child { border-bottom: none; }
.bloque-body strong { color: var(--text); font-weight: 600; }
.bloque-body em { color: var(--text); }

/* ── SENTIDOS COLORS PER GRUPO ─────────── */
.g1-theme .clase-hero { background: linear-gradient(145deg, #0F6E56, #1A8A6C); }
.g1-theme .bloque-ico { background: var(--verde-light); }
.g1-theme .bloque-time { background: var(--verde-light); color: var(--verde); }
.g2-theme .clase-hero { background: linear-gradient(145deg, #3C3489, #534AB7); }
.g2-theme .bloque-ico { background: var(--morado-light); }
.g2-theme .bloque-time { background: var(--morado-light); color: var(--morado); }
.g3-theme .clase-hero { background: linear-gradient(145deg, #854F0B, #A86510); }
.g3-theme .bloque-ico { background: var(--naranja-light); }
.g3-theme .bloque-time { background: var(--naranja-light); color: var(--naranja); }

/* ── SENTIDOS TAG CHIPS ─────────────────── */
.sentidos-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.sentido-chip {
  font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px;
  border: 1px solid var(--border);
}
.chip-vista { background: #FFF3E0; color: #E65100; border-color: #FFCC80; }
.chip-oido { background: #E3F2FD; color: #1565C0; border-color: #90CAF9; }
.chip-tacto { background: #F3E5F5; color: #6A1B9A; border-color: #CE93D8; }
.chip-olfato { background: #E8F5E9; color: #2E7D32; border-color: #A5D6A7; }
.chip-gusto { background: #FCE4EC; color: #880E4F; border-color: #F48FB1; }
.chip-movimiento { background: #E0F2F1; color: #00695C; border-color: #80CBC4; }

/* ── PROGRESS BAR ─────────────────────── */
.progress-bar {
  height: 3px; background: var(--crema-dark);
  margin: 0 24px 20px;
  border-radius: 2px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--verde-mid);
  border-radius: 2px; transition: width .4s ease;
}

/* ── OFFLINE BADGE ─────────────────────── */
.offline-badge {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--verde);
  color: #fff;
  font-size: 12px; font-weight: 500;
  padding: 8px 18px;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
  z-index: 200;
}
.offline-badge.visible { opacity: 1; }

/* ── SEMANA HEADER ─────────────────────── */
.semana-header-detail {
  padding: 6px 24px 20px;
}
.versiculo-mes {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  text-align: center;
  font-style: italic;
}
.versiculo-mes .ref { font-family: var(--font-body); font-size: 11px; font-weight: 600; font-style: normal; color: var(--text-soft); display: block; margin-top: 4px; text-transform: uppercase; letter-spacing: 1px; }

/* ── INSTALL PROMPT ─────────────────────── */
.install-prompt {
  margin: 0 24px 16px;
  background: var(--verde);
  border-radius: var(--radius);
  padding: 16px;
  color: #fff;
  display: flex; align-items: center; gap: 14px;
}
.install-prompt .ip-icon { font-size: 28px; flex-shrink: 0; }
.install-prompt .ip-text { flex: 1; }
.install-prompt .ip-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.install-prompt .ip-sub { font-size: 12px; opacity: .75; }
.install-prompt button {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  font-size: 12px; font-weight: 600;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
}
.install-prompt button:hover { background: rgba(255,255,255,0.3); }
.install-prompt .ip-close { background: none; border: none; color: rgba(255,255,255,.5); font-size: 18px; padding: 4px; cursor: pointer; }

/* Responsive */
@media(max-width:400px) {
  .hero-title { font-size: 26px; }
  .clase-title { font-size: 22px; }
}
