/* ========================================
   Sí a la Vida — Design System
   ======================================== */

/* --- CSS Custom Properties --- */
:root {
  --color-bg: #F5E6D3;
  --color-bg-warm: #F0DCC8;
  --color-gold: #D4A574;
  --color-gold-light: #E8C9A6;
  --color-brown: #8B6914;
  --color-brown-dark: #6B4F0E;
  --color-text: #5C4A32;
  --color-text-light: #9B8B7A;
  --color-white: #FFFFFF;
  --color-card-bg: rgba(255, 255, 255, 0.55);
  --color-card-border: rgba(212, 165, 116, 0.3);

  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Nunito', 'Segoe UI', sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --tab-bar-height: 64px;

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Emil Kowalski custom easings */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
}

h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 4vw, 1.85rem); }
h3 { font-size: clamp(1.1rem, 3vw, 1.35rem); }

.text-phrase {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--color-text);
}

.text-subtle {
  color: var(--color-text-light);
  font-size: 0.9rem;
}

/* --- App Container --- */
#app-container {
  padding-top: var(--safe-top);
  padding-left: calc(16px + var(--safe-left));
  padding-right: calc(16px + var(--safe-right));
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + 20px);
  min-height: 100dvh;
}

@media (display-mode: standalone) {
  #app-container {
    padding-top: calc(12px + var(--safe-top));
  }
}

#tab-content {
  max-width: 600px;
  margin: 0 auto;
  padding-top: 16px;
  padding-bottom: 24px;
}

/* --- Tab Bar --- */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tab-bar-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(245, 230, 211, 0.92);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-top: 1px solid var(--color-card-border);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  z-index: 1000;
}

.tab-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 2px;
  color: var(--color-text-light);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: none;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 200ms var(--ease-out);
  position: relative;
}

.tab-bar-item .tab-icon {
  font-size: 22px;
  line-height: 1;
}

.tab-bar-item .tab-label {
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.tab-bar-item.active {
  color: var(--color-brown);
}

.tab-bar-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--color-gold);
  border-radius: 0 0 3px 3px;
}

.tab-bar-item:active {
  transform: scale(0.97);
}

/* --- Cards --- */
.card {
  background: var(--color-card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: 0 4px 16px rgba(139, 105, 20, 0.06);
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}

.card-interactive:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(139, 105, 20, 0.1);
}

.card-gold {
  background: linear-gradient(135deg,
    rgba(212, 165, 116, 0.25) 0%,
    rgba(245, 230, 211, 0.5) 100%);
  border: 1px solid rgba(212, 165, 116, 0.4);
}

.card-phrase {
  background: linear-gradient(145deg,
    rgba(245, 230, 211, 0.7),
    rgba(212, 165, 116, 0.3));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(212, 165, 116, 0.35);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(139, 105, 20, 0.08);
}

/* --- Buttons --- */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border: 1.5px solid var(--color-gold);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms var(--ease-out), background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.btn-pill:active {
  background: var(--color-gold);
  color: var(--color-white);
  transform: scale(0.97);
}

.btn-pill-sm {
  padding: 8px 20px;
  font-size: 0.85rem;
  border: 1.5px solid var(--color-gold);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms var(--ease-out), background 200ms ease, border-color 200ms ease;
}

.btn-pill-sm:active {
  background: var(--color-gold);
  color: var(--color-white);
  transform: scale(0.97);
}

.btn-pill-gold {
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--color-gold), var(--color-brown));
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 16px rgba(139, 105, 20, 0.25);
  transition: transform 160ms var(--ease-out), box-shadow 200ms ease;
}

.btn-pill-gold:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(139, 105, 20, 0.3);
}

/* --- Tab Views --- */
.tab-view {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 250ms var(--ease-out), transform 250ms var(--ease-out);
}

.tab-view.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* --- Install Banner --- */
.install-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  padding: calc(var(--safe-top) + 8px) 16px 8px;
  background: rgba(245, 230, 211, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-card-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: transform 250ms var(--ease-out), opacity 250ms var(--ease-out);
}

.install-banner.hidden {
  display: none;
}

.install-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
}

.install-banner-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.install-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  line-height: 1.3;
}

.install-banner-text strong {
  font-size: 0.95rem;
}

.install-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text-light);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* ========================================
   Tab: Inicio
   ======================================== */

.inicio-header {
  text-align: center;
  padding: 20px 0 24px;
}

.inicio-logo {
  width: 120px;
  height: auto;
  margin-bottom: 12px;
}

.inicio-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.inicio-subtitle {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--color-text-light);
}

/* Experience Quick Access */
.experience-section {
  margin-bottom: 28px;
}

.experience-section h3 {
  text-align: center;
  margin-bottom: 16px;
  font-weight: 400;
  font-size: 1.1rem;
}

.experience-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.experience-pills .btn-pill {
  font-size: 0.88rem;
  padding: 10px 20px;
}

/* Actions Section */
.actions-section {
  margin-bottom: 28px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
  color: var(--color-text);
}

.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-card-border);
}

.section-divider span {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-text-light);
  white-space: nowrap;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin-bottom: 10px;
}

.action-emoji {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.action-text {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
}

.action-btn {
  flex-shrink: 0;
}

/* Phrase Section */
.phrase-section {
  margin-bottom: 28px;
}

.phrase-text {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: 8px;
}

.phrase-author {
  font-size: 0.85rem;
  color: var(--color-text-light);
  text-align: right;
}

/* Inicio: About link */
.inicio-logo-link {
  display: inline-block;
  text-decoration: none;
  transition: transform 200ms var(--ease-out);
}

.inicio-logo-link:hover {
  transform: scale(1.05);
}

.inicio-about-link {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--color-gold);
  text-decoration: none;
  transition: color 200ms ease;
}

.inicio-about-link:hover {
  color: var(--color-brown);
}

/* ========================================
   Sobre Deva Isis
   ======================================== */

.sobre-page {
  padding-top: 8px;
}

.sobre-back {
  font-size: 0.85rem;
  padding: 8px 16px;
  margin-bottom: 20px;
}

.sobre-header {
  text-align: center;
  padding: 16px 0 28px;
}

.sobre-logo {
  width: 140px;
  height: auto;
  margin-bottom: 16px;
}

.sobre-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  font-weight: 700;
  color: var(--color-text);
}

.sobre-section {
  margin-bottom: 20px;
}

.sobre-card {
  padding: 24px 20px;
}

.sobre-card h3 {
  font-size: 1.2rem;
  margin-bottom: 14px;
  color: var(--color-brown);
}

.sobre-card p {
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 12px;
}

.sobre-card p:last-child {
  margin-bottom: 0;
}

.sobre-fundadora-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-gold);
  margin-bottom: 6px;
}

.sobre-highlight {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.05rem !important;
  color: var(--color-brown);
  margin-top: 8px !important;
}

.sobre-footer {
  text-align: center;
  padding: 20px 0 24px;
  border-top: 1px solid var(--color-card-border);
}

/* ========================================
   Tab: Experiencia
   ======================================== */

.exp-header {
  text-align: center;
  padding: 24px 0 28px;
}

.exp-header h1 {
  margin-bottom: 8px;
}

.exp-note {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--color-text-light);
  margin-top: 8px;
}

.exp-states-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.exp-state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 20px;
  cursor: pointer;
  border: none;
  width: 100%;
}

.exp-state-emoji {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.exp-state-name {
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.exp-state-desc {
  font-size: 0.88rem;
  color: var(--color-text-light);
  line-height: 1.5;
}

/* Flow header */
.exp-flow-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0 16px;
}

.exp-flow-emoji {
  font-size: 2rem;
}

.exp-flow-header h2 {
  margin: 0;
}

/* ========================================
   Guided Flow Component
   ======================================== */

.guided-flow {
  padding: 8px 0;
}

/* Progress Bar */
.gf-progress-bar {
  height: 4px;
  background: rgba(212, 165, 116, 0.2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
}

.gf-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-gold), var(--color-brown));
  border-radius: 4px;
  transition: width 300ms var(--ease-out);
}

/* Step Indicators */
.gf-steps-indicator {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}

.gf-step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(212, 165, 116, 0.15);
  color: var(--color-text-light);
  transition: background 250ms var(--ease-out), color 250ms ease, transform 250ms var(--ease-out), box-shadow 250ms ease;
}

.gf-step-dot.active {
  background: var(--color-gold);
  color: var(--color-white);
  transform: scale(1.1);
  box-shadow: 0 2px 12px rgba(212, 165, 116, 0.4);
}

.gf-step-dot.completed {
  background: rgba(139, 105, 20, 0.2);
  color: var(--color-brown);
}

/* Step Content */
.gf-content {
  text-align: center;
  padding: 0 4px;
  transition: opacity 250ms var(--ease-out), transform 250ms var(--ease-out);
}

.gf-content.gf-entering {
  opacity: 0;
  transform: translateY(12px);
}

.gf-step-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.gf-step-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--color-text);
}

.gf-step-text {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-text);
  margin-bottom: 24px;
  text-align: left;
}

.gf-instruction {
  padding: 20px;
  margin-bottom: 32px;
  text-align: left;
}

.gf-instruction p {
  font-style: italic;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Navigation */
.gf-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}

.gf-btn-back {
  font-size: 0.88rem;
  padding: 10px 20px;
}

.gf-btn-next {
  font-size: 0.88rem;
  padding: 10px 24px;
}

/* Integration Cards */
.gf-integracion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

.gf-yoga-card {
  text-align: center;
  padding: 18px 14px;
}

.gf-yoga-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.gf-yoga-card h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-brown);
}

.gf-yoga-card p {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--color-text-light);
}

/* ========================================
   Tab: Sí a la Vida
   ======================================== */

.sav-header {
  text-align: center;
  padding: 24px 0 20px;
}

.sav-header h1 {
  margin-bottom: 6px;
}

.sav-section {
  margin-bottom: 28px;
}

/* Fragmentos */
.sav-fragmentos-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sav-fragmento-card {
  position: relative;
}

.sav-fragmento-text {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 16px;
  color: var(--color-text);
}

.sav-explore-btn {
  display: block;
  margin: 0 auto;
}

/* Capítulos */
.sav-capitulos-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sav-capitulo-card {
  text-align: left;
  padding: 20px;
  cursor: pointer;
  border: none;
  width: 100%;
  font-family: var(--font-body);
}

.sav-capitulo-number {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-gold);
  margin-bottom: 4px;
}

.sav-capitulo-title {
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.sav-capitulo-sub {
  font-size: 0.88rem;
  color: var(--color-text-light);
  font-style: italic;
}

/* Fragmento Flow Header */
.sav-flow-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 0 16px;
}

.sav-flow-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.sav-flow-quote {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
}

/* Capítulo Reading View */
.sav-capitulo-header {
  padding: 16px 0 20px;
}

.sav-back-btn {
  margin-bottom: 20px;
  font-size: 0.85rem;
  padding: 8px 16px;
}

.sav-capitulo-meta {
  text-align: center;
}

.sav-capitulo-num {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-gold);
  display: block;
  margin-bottom: 8px;
}

.sav-capitulo-h1 {
  font-size: clamp(1.5rem, 5vw, 2rem);
  margin-bottom: 6px;
}

.sav-capitulo-subtitle {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1rem;
  color: var(--color-text-light);
}

.sav-reading {
  padding: 8px 0 32px;
}

.sav-reading p {
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 20px;
  color: var(--color-text);
}

.sav-reading p:first-child::first-letter {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  float: left;
  line-height: 1;
  margin-right: 8px;
  margin-top: 4px;
  color: var(--color-brown);
}

.sav-reading-footer {
  text-align: center;
  padding: 16px 0 24px;
  border-top: 1px solid var(--color-card-border);
}

/* ========================================
   Tab: Alimentación
   ======================================== */

.ali-header {
  text-align: center;
  padding: 24px 0 20px;
}

.ali-header h1 {
  margin-bottom: 12px;
}

.ali-header .text-phrase {
  font-size: 0.95rem;
  text-align: left;
}

.ali-section {
  margin-bottom: 28px;
}

/* Momentos grid */
.ali-momentos-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ali-momento-card {
  text-align: center;
  padding: 24px 20px;
  cursor: pointer;
  border: none;
  width: 100%;
  font-family: var(--font-body);
}

.ali-momento-emoji {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 10px;
}

.ali-momento-card h3 {
  margin-bottom: 6px;
}

/* Big cards (Ayurveda, Emocional) */
.ali-big-card {
  text-align: center;
  padding: 24px 20px;
  cursor: pointer;
  border: none;
  width: 100%;
  font-family: var(--font-body);
}

.ali-big-emoji {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 10px;
}

.ali-big-card h3 {
  margin-bottom: 8px;
}

/* Detail views */
.ali-detail-header {
  padding: 16px 0 20px;
}

.ali-back-btn {
  font-size: 0.85rem;
  padding: 8px 16px;
  margin-bottom: 16px;
}

.ali-detail-title {
  text-align: center;
}

.ali-detail-emoji {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 8px;
}

.ali-detail-title h2 {
  margin-bottom: 12px;
}

/* Pasos (momentos) */
.ali-pasos {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.ali-paso-card {
  position: relative;
  padding: 24px 20px 20px;
}

.ali-paso-num {
  position: absolute;
  top: -12px;
  left: 20px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-gold), var(--color-brown));
  color: var(--color-white);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ali-paso-card h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.ali-paso-contenido {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 14px;
}

.ali-pregunta {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
}

.ali-pregunta p {
  font-size: 0.9rem;
  line-height: 1.5;
  font-style: italic;
}

/* Secciones (Ayurveda) */
.ali-secciones {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.ali-seccion-card h3 {
  margin-bottom: 12px;
  font-size: 1.15rem;
  color: var(--color-brown);
}

.ali-seccion-contenido p {
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 12px;
}

/* Reflexiones (emocional) */
.ali-reflexiones {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.ali-reflexion-card h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.ali-reflexion-card p {
  font-size: 0.95rem;
  line-height: 1.7;
}

.ali-footer {
  text-align: center;
  padding: 16px 0 24px;
  border-top: 1px solid var(--color-card-border);
}

/* ========================================
   Tab: Explorar
   ======================================== */

.exp-main-header {
  text-align: center;
  padding: 24px 0 20px;
}

.exp-main-header h1 {
  margin-bottom: 12px;
}

.exp-main-header .text-phrase {
  text-align: left;
}

/* Section Grid */
.exp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.exp-section-card {
  text-align: center;
  padding: 20px 14px;
  cursor: pointer;
  border: none;
  width: 100%;
  font-family: var(--font-body);
}

.exp-section-emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.exp-section-card h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.exp-section-card .text-subtle {
  font-size: 0.78rem;
  line-height: 1.4;
  margin-bottom: 8px;
}

.exp-section-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Full-width for last card if odd count */
.exp-grid .exp-section-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

/* Section detail */
.exp-seccion-header {
  padding: 16px 0 20px;
}

.exp-back-btn {
  font-size: 0.85rem;
  padding: 8px 16px;
  margin-bottom: 16px;
}

.exp-seccion-title {
  text-align: center;
}

.exp-seccion-emoji {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 8px;
}

.exp-seccion-title h2 {
  margin-bottom: 6px;
}

/* Subtemas list */
.exp-subtemas-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.exp-subtema-card {
  text-align: left;
  padding: 20px;
  cursor: pointer;
  border: none;
  width: 100%;
  font-family: var(--font-body);
}

.exp-subtema-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--color-brown);
}

.exp-subtema-preview {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-text-light);
}

/* Subtema reading */
.exp-subtema-header {
  padding: 16px 0 16px;
}

.exp-subtema-title {
  text-align: center;
}

.exp-subtema-title h2 {
  margin-bottom: 4px;
  font-size: clamp(1.3rem, 4vw, 1.7rem);
}

.exp-reading {
  padding: 8px 0 24px;
}

.exp-reading p {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 16px;
}

.exp-reading strong {
  color: var(--color-brown);
}

.exp-reading ul {
  list-style: none;
  padding: 0;
  margin-bottom: 16px;
}

.exp-reading ul li {
  padding: 6px 0 6px 20px;
  position: relative;
  font-size: 0.95rem;
  line-height: 1.6;
}

.exp-reading ul li::before {
  content: '•';
  position: absolute;
  left: 4px;
  color: var(--color-gold);
  font-weight: 700;
}

/* Subtema navigation */
.exp-subtema-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.exp-nav-btn {
  font-size: 0.82rem;
  padding: 10px 16px;
  max-width: 48%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exp-footer {
  text-align: center;
  padding: 16px 0 24px;
  border-top: 1px solid var(--color-card-border);
}

/* ========================================
   Tab: Guía
   ======================================== */

.guia-header {
  text-align: center;
  padding: 24px 0 20px;
}

.guia-header h1 {
  margin-bottom: 12px;
}

.guia-header .text-phrase {
  text-align: left;
}

/* Fórmula base */
.guia-formula {
  margin-bottom: 28px;
}

.guia-formula-steps {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.guia-formula-step {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: var(--color-card-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-sm);
}

.guia-formula-num {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.guia-formula-step strong {
  font-size: 0.95rem;
  color: var(--color-brown);
  display: block;
  margin-bottom: 2px;
}

.guia-formula-step p {
  font-size: 0.85rem;
  color: var(--color-text-light);
  line-height: 1.4;
}

.guia-formula-arrow {
  color: var(--color-gold);
  font-size: 1rem;
  padding: 2px 0;
  opacity: 0.6;
}

/* Section cards */
.guia-section {
  margin-bottom: 24px;
}

.guia-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guia-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  text-align: left;
  cursor: pointer;
  border: none;
  width: 100%;
  font-family: var(--font-body);
}

.guia-card-emoji {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.guia-card h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.guia-card .text-subtle {
  font-size: 0.82rem;
  line-height: 1.4;
  margin-bottom: 4px;
}

.guia-card-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Section detail */
.guia-seccion-header {
  padding: 16px 0 20px;
}

.guia-back-btn {
  font-size: 0.85rem;
  padding: 8px 16px;
  margin-bottom: 16px;
}

.guia-seccion-title {
  text-align: center;
}

.guia-seccion-emoji {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 8px;
}

.guia-seccion-title h2 {
  margin-bottom: 6px;
}

/* Temas list */
.guia-temas-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.guia-tema-card {
  text-align: left;
  padding: 20px;
  cursor: pointer;
  border: none;
  width: 100%;
  font-family: var(--font-body);
}

.guia-tema-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--color-brown);
}

.guia-tema-preview {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-text-light);
}

/* Tema reading */
.guia-tema-header {
  padding: 16px 0 16px;
}

.guia-tema-title {
  text-align: center;
}

.guia-tema-title h2 {
  margin-bottom: 4px;
  font-size: clamp(1.3rem, 4vw, 1.7rem);
}

.guia-reading {
  padding: 8px 0 24px;
}

.guia-reading p {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 16px;
}

.guia-reading strong {
  color: var(--color-brown);
}

.guia-reading ul {
  list-style: none;
  padding: 0;
  margin-bottom: 16px;
}

.guia-reading ul li {
  padding: 6px 0 6px 20px;
  position: relative;
  font-size: 0.95rem;
  line-height: 1.6;
}

.guia-reading ul li::before {
  content: '•';
  position: absolute;
  left: 4px;
  color: var(--color-gold);
  font-weight: 700;
}

/* Tema navigation */
.guia-tema-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.guia-nav-btn {
  font-size: 0.82rem;
  padding: 10px 16px;
  max-width: 48%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guia-footer {
  text-align: center;
  padding: 16px 0 24px;
  border-top: 1px solid var(--color-card-border);
}

/* ========================================
   Tab: Placeholder (tabs en construcción)
   ======================================== */

.tab-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 40px 20px;
}

.tab-placeholder-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
}

.tab-placeholder h2 {
  margin-bottom: 8px;
}

.tab-placeholder p {
  color: var(--color-text-light);
  font-size: 0.95rem;
}

/* ========================================
   Utilities
   ======================================== */

.hidden { display: none !important; }

.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.mb-xl { margin-bottom: 32px; }

.text-center { text-align: center; }

/* ========================================
   Responsive
   ======================================== */

@media (min-width: 768px) {
  #tab-content {
    max-width: 500px;
  }

  .tab-bar {
    max-width: 500px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-left: 1px solid var(--color-card-border);
    border-right: 1px solid var(--color-card-border);
  }
}

/* ========================================
   Skip Link (accessibility)
   ======================================== */

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 12px 24px;
  background: var(--color-brown);
  color: var(--color-white);
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  font-family: var(--font-body);
}

.skip-link:focus {
  top: calc(var(--safe-top) + 8px);
}

/* ========================================
   Focus & Hover States
   ======================================== */

/* Focus visible — golden outline for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.tab-bar-item:focus-visible {
  outline-offset: -2px;
}

/* Remove default outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Hover states — gated for pointer devices only */
@media (hover: hover) and (pointer: fine) {
  .btn-pill:hover {
    background: rgba(212, 165, 116, 0.15);
    border-color: var(--color-brown);
  }

  .btn-pill-sm:hover {
    background: rgba(212, 165, 116, 0.15);
    border-color: var(--color-brown);
  }

  .btn-pill-gold:hover {
    box-shadow: 0 6px 24px rgba(139, 105, 20, 0.35);
    transform: translateY(-1px);
  }

  .card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 105, 20, 0.1);
  }

  .tab-bar-item:hover {
    color: var(--color-brown);
  }

  .exp-state-card:hover,
  .ali-momento-card:hover,
  .ali-big-card:hover,
  .guia-card:hover,
  .exp-section-card:hover,
  .exp-subtema-card:hover,
  .guia-tema-card:hover,
  .sav-capitulo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 105, 20, 0.1);
  }
}

/* ========================================
   Onboarding
   ======================================== */

.onboarding {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 400ms var(--ease-out);
}

.onboarding.hidden {
  display: none;
}

.onboarding.visible {
  opacity: 1;
}

.onboarding.closing {
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms var(--ease-out);
}

.onboarding-content {
  max-width: 360px;
  padding: 40px 28px;
  text-align: center;
  animation: onboardingFadeUp 500ms var(--ease-out) 0.15s both;
}

@keyframes onboardingFadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.onboarding-logo {
  width: 100px;
  height: auto;
  margin-bottom: 20px;
  animation: onboardingPulse 3s var(--ease-in-out) infinite;
}

@keyframes onboardingPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.03); opacity: 0.9; }
}

.onboarding-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 24px;
}

.onboarding-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: 12px;
}

.onboarding-highlight {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--color-brown);
  margin-top: 16px;
  margin-bottom: 28px;
}

.onboarding-btn {
  padding: 14px 40px;
  font-size: 1rem;
}

/* ========================================
   Loading State
   ======================================== */

.loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(212, 165, 116, 0.2);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   Update Banner
   ======================================== */

.update-banner {
  position: fixed;
  bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(92, 74, 50, 0.95);
  color: var(--color-white);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  font-size: 0.88rem;
  opacity: 0;
  transition: transform 300ms var(--ease-out), opacity 300ms var(--ease-out);
}

.update-banner.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.update-banner .btn-pill-sm {
  border-color: var(--color-gold);
  color: var(--color-white);
}

/* ========================================
   Animations & Transitions
   ======================================== */

/* Tab view entrance */
.tab-view.active {
  animation: tabFadeIn 250ms var(--ease-out) both;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Logo gentle pulse on Inicio */
.inicio-logo {
  animation: logoPulse 4s var(--ease-in-out) infinite;
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* Pill button ripple — starts from scale(0.5) not 0 */
.btn-pill,
.btn-pill-gold,
.btn-pill-sm {
  position: relative;
  overflow: hidden;
}

.btn-pill::after,
.btn-pill-gold::after,
.btn-pill-sm::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 70%);
  opacity: 0;
  transform: scale(0.5);
  transition: transform 300ms var(--ease-out), opacity 250ms ease;
}

.btn-pill:active::after,
.btn-pill-gold:active::after,
.btn-pill-sm:active::after {
  opacity: 1;
  transform: scale(2.5);
  transition: transform 0s, opacity 0s;
}

/* Cards enter animation — stagger 50ms, custom ease-out */
.action-card,
.exp-state-card,
.ali-momento-card,
.sav-fragmento-card,
.sav-capitulo-card,
.exp-section-card,
.guia-card {
  animation: cardSlideIn 300ms var(--ease-out) both;
}

.action-card:nth-child(2),
.exp-state-card:nth-child(2),
.sav-fragmento-card:nth-child(2),
.exp-section-card:nth-child(2) { animation-delay: 50ms; }

.action-card:nth-child(3),
.exp-state-card:nth-child(3),
.sav-fragmento-card:nth-child(3),
.exp-section-card:nth-child(3) { animation-delay: 100ms; }

.action-card:nth-child(4),
.exp-state-card:nth-child(4),
.sav-fragmento-card:nth-child(4),
.exp-section-card:nth-child(4) { animation-delay: 150ms; }

.exp-state-card:nth-child(5) { animation-delay: 200ms; }
.exp-state-card:nth-child(6) { animation-delay: 250ms; }

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Progress bar glow */
.gf-progress-fill {
  box-shadow: 0 0 8px rgba(212, 165, 116, 0.4);
}

/* ========================================
   Reduced Motion
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  .tab-view,
  .tab-view.active,
  .tab-bar-item,
  .card,
  .card-interactive,
  .btn-pill,
  .btn-pill-gold,
  .btn-pill-sm,
  .onboarding,
  .onboarding-content,
  .onboarding-logo,
  .inicio-logo,
  .action-card,
  .exp-state-card,
  .ali-momento-card,
  .sav-fragmento-card,
  .sav-capitulo-card,
  .exp-section-card,
  .guia-card,
  .update-banner {
    animation: none !important;
    transition: none !important;
  }

  .onboarding.visible { opacity: 1; }
  .onboarding.closing { opacity: 0; }
}
