/* ==========================================================================
   DECIDE Y CRECE - DISEÑO EDITORIAL INFANTIL CÁLIDO Y VIBRANTE
   ========================================================================== */

:root {
    /* Paleta Cálida y Dinámica */
    --bg-page: #FFFDF9;
    --bg-card: #FFFFFF;
    --bg-warm-light: #FFF5EA;
    --bg-sage-light: #EEF8F3;
    
    --text-main: #2C3437;
    --text-muted: #5F6C72;
    
    /* Colores Protagonistas */
    --brand-primary: #FF7A45;      /* Naranja cálido y alegre */
    --brand-primary-hover: #E86532;
    --brand-sage: #2A9D8F;         /* Verde esmeralda suave */
    --brand-sage-hover: #21867A;
    --brand-purple: #8E44AD;
    --brand-blue: #2980B9;
    --brand-yellow: #F4A261;
    
    --border-card: #F0E8DD;
    --font-heading: 'Literata', Georgia, serif;
    --font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
    
    --radius-pill: 50px;
    --radius-card: 16px;
    --shadow-pop: 0 10px 25px rgba(244, 162, 97, 0.15);
    --shadow-card: 0 4px 15px rgba(0, 0, 0, 0.05);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.7;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Header Luminoso */
.site-header {
    background: #FFFFFF;
    border-bottom: 2px solid var(--border-card);
    padding: 1.1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.header-container {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--brand-sage);
}

.brand-logo span.logo-mark {
    font-size: 1.6rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary), #FF9466);
    color: #FFFFFF !important;
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(255, 122, 69, 0.3);
    transition: transform 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

/* Hero Section Animada y Colorida */
.hero-section {
    background: radial-gradient(circle at top, #FFF2E5 0%, var(--bg-page) 70%);
    padding: 4.5rem 1.5rem 3.5rem;
    text-align: center;
}

.hero-content {
    max-width: 820px;
    margin: 0 auto;
}

.badge-tag {
    display: inline-block;
    background-color: #FFE5D9;
    color: #D35400;
    padding: 0.4rem 1.2rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 1.5rem;
}

.hero-section h1 {
    font-family: var(--font-heading);
    font-size: 2.85rem;
    color: #1F2937;
    line-height: 1.25;
    margin-bottom: 1.25rem;
}

.hero-lead {
    font-size: 1.18rem;
    color: var(--text-muted);
    margin-bottom: 2.25rem;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.btn-primary-large {
    background: linear-gradient(135deg, var(--brand-primary), #FF8E53);
    color: #FFF;
    padding: 1rem 2.2rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 1.05rem;
    box-shadow: 0 6px 18px rgba(255, 122, 69, 0.35);
}

.btn-outline-large {
    background: #FFF;
    border: 2px solid var(--border-card);
    color: var(--text-main);
    padding: 1rem 2rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 1.05rem;
}

/* Pilares Visuales */
.pillars-section {
    max-width: 1140px;
    margin: 3.5rem auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.pillar-card {
    background: #FFFFFF;
    border: 2px solid var(--border-card);
    border-radius: var(--radius-card);
    padding: 2.25rem;
    box-shadow: var(--shadow-card);
    transition: transform 0.25s ease;
}

.pillar-card:hover {
    transform: translateY(-4px);
}

.pillar-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.pillar-card h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    margin-bottom: 0.8rem;
    color: #1F2937;
}

.pillar-card p {
    color: var(--text-muted);
    font-size: 0.98rem;
}

/* Grilla de los 5 Libros */
.catalog-section {
    max-width: 1140px;
    margin: 5rem auto;
    padding: 0 1.5rem;
}

.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    margin-bottom: 0.8rem;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.2rem;
}

.book-card {
    background: #FFFFFF;
    border: 2px solid var(--border-card);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-pop);
}

.book-cover-banner {
    padding: 3.5rem 1.5rem;
    text-align: center;
}

.book-symbol {
    font-size: 4rem;
    display: inline-block;
}

.book-body {
    padding: 1.85rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.book-theme {
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--brand-primary);
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}

.book-body h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.book-body p {
    color: var(--text-muted);
    font-size: 0.98rem;
    margin-bottom: 1.5rem;
}

.book-meta-tags {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-bottom: 1.25rem;
}

.book-meta-tags span {
    background: #F4F6F8;
    color: #4A5568;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-pill);
}

.book-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border-card);
}

.btn-read {
    color: var(--brand-sage);
    font-weight: 700;
    font-size: 1rem;
}

/* Lector Adaptativo (lector.php) */
.reader-container {
    max-width: 860px;
    margin: 2.5rem auto 5rem;
    padding: 0 1.5rem;
}

.reader-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.back-link {
    font-weight: 700;
    color: var(--text-muted);
}

.reader-badges {
    display: flex;
    gap: 0.6rem;
}

.book-pill {
    background: #FFF;
    border: 1px solid var(--border-card);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.9rem;
}

.access-pill {
    padding: 0.4rem 1rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.85rem;
}

.pill-free {
    background: #FFF3CD;
    color: #856404;
}

.pill-paid {
    background: var(--bg-sage-light);
    color: var(--brand-sage);
}

/* Selector de Etapas */
.age-selector {
    display: flex;
    background: #F3EBDD;
    padding: 0.4rem;
    border-radius: var(--radius-card);
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.age-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    color: var(--text-muted);
}

.tab-emoji {
    font-size: 1.6rem;
}

.tab-texts strong {
    display: block;
    font-size: 1rem;
    color: var(--text-main);
}

.tab-texts small {
    font-size: 0.8rem;
}

.age-tab.active {
    background: #FFFFFF;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.age-tab.active .tab-texts strong {
    color: var(--brand-primary);
}

/* Audiolibro */
.audio-player-card {
    background: linear-gradient(135deg, #FFFFFF, var(--bg-warm-light));
    border: 2px solid #FFE4D1;
    border-radius: var(--radius-card);
    padding: 1.25rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.2rem;
    box-shadow: var(--shadow-card);
}

.audio-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.audio-pulse-avatar {
    font-size: 2.2rem;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.btn-audio {
    background: var(--brand-primary);
    color: #FFF;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 122, 69, 0.3);
}

.btn-audio.btn-playing {
    background: #E74C3C;
}

.audio-timer {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Lectura */
.reading-area {
    background: #FFFFFF;
    border: 2px solid var(--border-card);
    border-radius: var(--radius-card);
    padding: 3.5rem 3rem;
    box-shadow: var(--shadow-card);
}

.chapter-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.75rem;
    border-bottom: 2px dashed var(--border-card);
}

.chapter-header h2 {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    color: #1F2937;
    margin-bottom: 0.5rem;
}

.chapter-stage-label {
    font-weight: 700;
    color: var(--brand-sage);
}

.story-body p {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    line-height: 2.1;
    color: #2D3748;
    margin-bottom: 1.8rem;
}

/* Paywall */
.paywall-banner {
    margin-top: 2.5rem;
}

.paywall-card {
    background: linear-gradient(180deg, #FFFFFF, var(--bg-warm-light));
    border: 3px dashed var(--brand-primary);
    border-radius: var(--radius-card);
    padding: 3rem 2rem;
    text-align: center;
}

.lock-sparkle {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.paywall-card h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
}

.paywall-card p {
    color: var(--text-muted);
    max-width: 550px;
    margin: 0 auto 1.8rem;
    font-size: 1.05rem;
}

.btn-unlock {
    background: linear-gradient(135deg, var(--brand-primary), #FF8E53);
    color: #FFF;
    padding: 1.1rem 2.2rem;
    border-radius: var(--radius-pill);
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 6px 18px rgba(255, 122, 69, 0.4);
    display: inline-block;
}

.login-subtext {
    margin-top: 1.25rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.login-subtext a {
    color: var(--brand-primary);
    font-weight: 700;
}

/* Finales */
.decisions-container {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px dashed var(--border-card);
}

.decision-choice-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn-choice {
    flex: 1;
    padding: 1rem;
    border-radius: var(--radius-card);
    border: 2px solid var(--border-card);
    background: #FFF;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
}

.btn-choice.active {
    background: #FFF2E5;
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.final-box {
    padding: 2.5rem;
    border-radius: var(--radius-card);
    border: 2px solid var(--border-card);
}

.final-box h4 {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    margin-bottom: 1rem;
}

.final-box p {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    line-height: 2;
}

.final-sad { background: #FDF4F2; border-color: #F8D7DA; }
.final-happy { background: #F0FFF4; border-color: #C6F6D5; }

/* Footer */
.site-footer {
    background: #FFFFFF;
    border-top: 2px solid var(--border-card);
    padding: 4rem 1.5rem 3rem;
    margin-top: 5rem;
}

.footer-inner {
    max-width: 1140px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2.5rem;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--brand-sage);
    margin-bottom: 0.8rem;
    display: block;
}

/* Responsivo */
@media (max-width: 768px) {
    .hero-section h1 { font-size: 2.1rem; }
    .age-selector { flex-direction: column; }
    .decision-choice-tabs { flex-direction: column; }
    .reading-area { padding: 2rem 1.25rem; }
    .footer-inner { grid-template-columns: 1fr; }
}