/* Variables & Reset */
:root {
    --bg-color: #0a192f; /* Azul noche muy oscuro */
    --secondary-bg: #112240; /* Azul ligeramente más claro para secciones */
    --text-primary: #ccd6f6; /* Blanco hueso para texto */
    --text-secondary: #8892b0; /* Gris azulado para subtítulos */
    --gold: #d4af37; /* Dorado clásico */
    --gold-hover: #f3e5ab; /* Dorado pálido para hover */
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Lato', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: var(--font-serif);
    color: #e6f1ff;
    margin-bottom: 1rem;
}

h1 { font-size: 3rem; font-weight: 700; }
h2 { font-size: 2.5rem; color: var(--gold); }
h3 { font-size: 1.5rem; }

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* Utilities */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center { text-align: center; }
.section { padding: 80px 0; }

/* Buttons */
.btn-primary {
    background: linear-gradient(45deg, #b8860b, #d4af37, #b8860b);
    color: #0a192f;
    padding: 15px 35px;
    border-radius: 2px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    border: 1px solid var(--gold);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(45deg, #d4af37, #f3e5ab, #d4af37);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn-small {
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 8px 20px;
    border-radius: 2px;
    font-size: 0.9rem;
}

.btn-small:hover {
    background: var(--gold);
    color: var(--bg-color);
}

/* Navbar */
.navbar {
    padding: 20px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: rgba(10, 25, 47, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
    /* inline para que quede a la derecha del logo dentro del flex
       container .logo-link (en lugar de un <div> block que iría debajo) */
    display: inline-block;
    line-height: 1;
}

/* Hero Section */
.hero {
    height: 100vh;
    background: url('https://images.unsplash.com/photo-1419242902214-272b3f66ee7a?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    display: flex;
    align-items: center;
    position: relative;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 25, 47, 0.7); /* Oscurece la imagen de fondo */
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero .subtitle {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 30px;
    font-weight: 300;
}

.trust-badge {
    display: block;
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Grids & Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.split-section img, .product-showcase img {
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

/* Features */
.features-section { background-color: var(--secondary-bg); }
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    text-align: center;
    padding: 30px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    transition: 0.3s;
}

.feature-card:hover { transform: translateY(-5px); border-color: var(--gold); }
.feature-card .icon { font-size: 2.5rem; margin-bottom: 20px; }

/* Testimonials */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.review-card {
    background: var(--secondary-bg);
    padding: 30px;
    border-left: 3px solid var(--gold);
}

.review-text { font-style: italic; margin-bottom: 15px; }
.review-author { font-weight: 700; color: var(--gold); }

/* Steps */
.steps-container {
    display: flex;
    justify-content: space-around;
    text-align: center;
    margin-top: 50px;
    flex-wrap: wrap;
}

.step { flex: 1; min-width: 200px; margin: 20px; }
.step-number {
    display: inline-block;
    width: 40px; height: 40px;
    border: 2px solid var(--gold);
    border-radius: 50%;
    line-height: 36px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 15px;
}

/* FAQ Accordion - tema oscuro forzado sobre las variables de Bootstrap
   (Bootstrap 5 expone --bs-accordion-* y por default usa fondo blanco) */
.accordion {
    max-width: 800px;
    margin: 40px auto 0;
    --bs-accordion-bg: transparent;
    --bs-accordion-active-bg: transparent;
    --bs-accordion-color: var(--text-primary);
    --bs-accordion-active-color: var(--text-primary);
    --bs-accordion-btn-bg: transparent;
    --bs-accordion-btn-color: var(--text-primary);
    --bs-accordion-btn-focus-box-shadow: none;
    --bs-accordion-btn-focus-border-color: rgba(212, 175, 55, 0.4);
    --bs-accordion-border-color: rgba(255,255,255,0.1);
    --bs-accordion-body-color: var(--text-secondary);
    --bs-accordion-inner-border-radius: 0;
    --bs-accordion-border-radius: 0;
}
.accordion-item {
    background: transparent !important;
    color: var(--text-primary);
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.accordion-header {
    width: 100%;
    background: transparent !important;
    border: none;
    color: var(--text-primary) !important;
    padding: 20px;
    text-align: left;
    font-size: 1.1rem;
    cursor: pointer;
    font-family: var(--font-serif);
    display: flex;
    justify-content: space-between;
}
.accordion-header:hover { color: var(--gold); }
.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 20px;
    color: var(--text-secondary) !important;
    background: transparent !important;
}

/* Footer */
footer {
    background: #020c1b;
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid rgba(212, 175, 55, 0.1);
}
.footer-logo { font-family: var(--font-serif); color: var(--gold); margin-bottom: 20px; font-size: 1.2rem; }
.footer-links a { color: var(--text-secondary); margin: 0 15px; font-size: 0.9rem; }
.footer-links a:hover { color: var(--gold); }
footer p { margin-top: 20px; color: #555; font-size: 0.8rem; }

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* Mobile Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .grid-2 { grid-template-columns: 1fr; }
    .reverse-mobile { display: flex; flex-direction: column-reverse; }
    .hero { height: auto; padding: 150px 0 80px; }
}

/* =========================================
   BOOTSTRAP OVERRIDES (FORZADO)
   ========================================= */

/* 1. Fondo Global */
body {
    background-color: var(--bg-color) !important;
    color: var(--text-primary) !important;
}

/* 2. Forzar Tarjetas (Cards) Oscuras */
.card {
    /* --bs-card-bg es la variable que usa Bootstrap 5, la reescribimos */
    --bs-card-bg: var(--secondary-bg); 
    background-color: var(--secondary-bg) !important; /* Forzamos el color #112240 */
    border: 1px solid rgba(212, 175, 55, 0.2) !important;
    color: var(--text-primary) !important;
}

/* 3. Inputs (Formularios) */
.form-control {
    background-color: rgba(10, 25, 47, 0.6) !important; /* Fondo oscuro */
    border: 1px solid #233554 !important;
    color: #fff !important; /* Texto blanco al escribir */
}

.form-control:focus {
    background-color: rgba(10, 25, 47, 0.9) !important;
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 0.25rem rgba(212, 175, 55, 0.15) !important; /* Brillo dorado */
    color: #fff !important;
}

/* Placeholder (texto de ayuda dentro del input) */
.form-control::placeholder {
    color: rgba(204, 214, 246, 0.5) !important;
}

/* 4. Textos de Bootstrap */
.text-muted {
    color: var(--text-secondary) !important; /* Cambia el gris claro por tu gris azulado */
}

h1, h2, h3, .h1, .h2, .h3 {
    color: #e6f1ff !important; /* Asegura que los títulos sean claros */
}

/* 5. Barra de Progreso */
.progress {
    background-color: #233554 !important;
}

.progress-bar {
    background-color: var(--gold) !important;
}
/* ============================================================
   Hero price + trust strip (added in 2026-04 SEO/conversion pass)
   ============================================================ */

.hero-price {
    margin: 18px 0 22px 0;
    color: var(--text-primary);
    font-size: 1.15rem;
    letter-spacing: 0.5px;
}
.hero-price strong {
    color: var(--gold);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 4px;
}
.hero-price-note {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-left: 4px;
}
.hero-price--inline {
    margin: 12px 0;
    font-size: 1rem;
}

.trust-strip {
    background: var(--secondary-bg);
    padding: 18px 0;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}
.trust-strip-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
}
.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.92rem;
}
.trust-item i {
    color: var(--gold);
    font-size: 1.15rem;
}
@media (max-width: 700px) {
    .trust-strip-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .trust-item {
        font-size: 0.88rem;
    }
}

/* Logo link en navbar */
.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.logo-link:hover { text-decoration: none; }

/* Discount code toggle (Step 1) */
.discount-toggle {
    background: none;
    border: none;
    color: var(--gold);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    text-decoration: underline;
}
.discount-toggle:hover { color: var(--gold-hover); }

/* ============================================================
   Print stylesheet (added in 2026-04 pass)
   ============================================================ */
@media print {
    body, .ysb-theme {
        background: #fff !important;
        color: #000 !important;
    }
    .navbar, footer, .btn-primary, .btn-small, .accordion-header {
        display: none !important;
    }
    a { color: #000 !important; text-decoration: underline; }
    .card, .ysb-card { box-shadow: none !important; border: 1px solid #ccc !important; }
}

/* ============================================================
   Error pages (404, 500, 403)
   ============================================================ */

.error-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 60px 20px;
}
.error-content {
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
}
.error-glyph {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}
.error-code {
    font-family: var(--font-serif);
    font-size: 5.5rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
    letter-spacing: 4px;
    margin-bottom: 12px;
    opacity: 0.85;
}
.error-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: #e6f1ff;
    margin-bottom: 18px;
    line-height: 1.25;
}
.error-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 24px;
}
.error-path {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
}
.error-path code {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold);
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 0.92rem;
}
.error-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}
.error-help {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
}
.error-help a {
    color: var(--gold);
    text-decoration: none;
}
.error-help a:hover {
    color: var(--gold-hover);
    text-decoration: underline;
}

/* Debug box (solo APP_DEBUG=true) */
.error-debug {
    margin-top: 40px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 6px;
    text-align: left;
    font-size: 0.88rem;
}
.error-debug h3 {
    color: var(--gold);
    margin-bottom: 12px;
    font-size: 1rem;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.error-debug h3 small {
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 8px;
}
.error-debug code {
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-primary);
    padding: 2px 6px;
    border-radius: 3px;
}
.error-debug-loc {
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.error-debug pre {
    background: #000;
    color: #ccd6f6;
    padding: 14px;
    border-radius: 4px;
    overflow-x: auto;
    max-height: 400px;
    font-size: 0.78rem;
    line-height: 1.5;
}
.error-debug summary {
    cursor: pointer;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

@media (max-width: 600px) {
    .error-code { font-size: 4rem; }
    .error-title { font-size: 1.5rem; }
    .error-subtitle { font-size: 1rem; }
}

/* ============================================================
   Save-and-continue resume banner
   ============================================================ */
.ysb-resume-banner {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(212, 175, 55, 0.06));
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}
.ysb-resume-text {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
    flex: 1 1 280px;
}
.ysb-resume-text strong { color: var(--gold); }
.ysb-resume-actions {
    display: flex;
    gap: 8px;
}
.ysb-resume-dismiss,
.ysb-resume-clear {
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: transparent;
    color: var(--gold);
    padding: 7px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.88rem;
    transition: background 0.2s, color 0.2s;
}
.ysb-resume-dismiss {
    background: var(--gold);
    color: #0a192f;
    font-weight: 600;
}
.ysb-resume-dismiss:hover {
    background: var(--gold-hover, #e8c869);
}
.ysb-resume-clear:hover {
    background: rgba(212, 175, 55, 0.1);
}
@media (max-width: 540px) {
    .ysb-resume-banner { flex-direction: column; align-items: stretch; }
    .ysb-resume-actions { justify-content: flex-end; }
}

/* ---------------------------------------------------------------
 * Wizard step1: "Same as above" — input bloqueado del recipient
 * Aplica cuando el usuario tildó el checkbox "the book is for me"
 * ---------------------------------------------------------------*/
.ysb-input-locked {
    background-color: rgba(212, 175, 55, 0.06) !important;
    cursor: not-allowed;
    opacity: 0.85;
}
.ysb-input-locked:focus {
    outline: none;
}

/* ---------------------------------------------------------------
 * Wizard step1: opt-in para email marketing (lead recovery)
 * Card discreta entre el recipient y el botón submit.
 * Tema oscuro: misma paleta que las cards del wizard.
 * ---------------------------------------------------------------*/
.ysb-marketing-optin {
    background-color: rgba(212, 175, 55, 0.05);  /* gold tint muy sutil */
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 6px;
    padding: 14px 16px;
    color: var(--text-primary);
}
.ysb-marketing-optin .form-check-label {
    cursor: pointer;
    line-height: 1.4;
    color: var(--text-primary);
}
.ysb-marketing-optin .text-muted {
    color: var(--text-secondary) !important;
}

/* ---------------------------------------------------------------
 * Compensación de la navbar fija
 *
 * .navbar tiene position:fixed; top:0 con altura real ~101px:
 *   - padding 20px arriba + 20px abajo = 40px
 *   - logo 60×60 (max alto del flex container .logo-link)
 *   - border-bottom 1px
 *   = 101px total
 *
 * Estrategia: cada página que usa la navbar incluye un
 * <div class="navbar-spacer"></div> justo después del </nav>, que
 * ocupa el espacio de la navbar en el flujo normal. Es la solución
 * más predecible y no depende de qué elemento venga después.
 *
 * Usamos 120px con buffer de ~20px sobre la altura real para no
 * dejar el texto pegado a la navbar.
 *
 * La landing es la excepción: no usa spacer porque el .hero ocupa
 * 100vh y la navbar superpuesta en su esquina superior es parte
 * del diseño.
 * ---------------------------------------------------------------*/
.navbar-spacer {
    height: 120px;
    min-height: 120px;
    width: 100%;
    flex-shrink: 0;
}

/* Logo img: display:block evita el gap de baseline que algunos
   navegadores dejan debajo de imagenes inline. Dentro del flex
   .logo-link ya no es problema, pero lo dejamos explicito por si
   la estructura cambia. */
.navbar .logo-link img,
.logo-link img {
    display: block;
}

/* ---------------------------------------------------------------
 * Helper text (Bootstrap .form-text y .text-muted) sobre tema oscuro
 *
 * Bootstrap default usa --bs-secondary-color que es un gris pensado
 * para fondo claro. Sobre el azul noche del wizard queda ilegible
 * (gris oscuro sobre azul oscuro). Forzamos var(--text-secondary)
 * que es #8892b0 (gris azulado claro), legible y consistente con
 * el resto del tema.
 *
 * Aplica a las descripciones cortas debajo de inputs y a cualquier
 * uso de .text-muted dentro del wizard.
 * ---------------------------------------------------------------*/
body.ysb-theme .form-text,
.ysb-theme .form-text,
body.ysb-theme .text-muted,
.ysb-theme .text-muted {
    color: var(--text-secondary) !important;
}
