/* Variables del Sistema - Extraídas del globals.css original */
:root {
  /* Colors - Light Mode */
  --primary: #2d3e9d;
  --primary-dark: #1a2563;
  --secondary: #3d0222;
  --secondary-dark: #200112;
  --background: #f8fafc;
  --foreground: #0f172a;
  
  /* Fonts */
  --font-inter: 'Inter', sans-serif;
  --font-montserrat: 'Montserrat', sans-serif;
}

/* Reset y Layout Básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f1f5f9; /* Un poco más oscuro que el bg del manual para ver las páginas */
    color: var(--foreground);
    font-family: var(--font-inter);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-montserrat);
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--primary-dark);
}

/* Clases Utilitarias */
.font-heading { font-family: var(--font-montserrat); font-weight: 700; }
.font-body { font-family: var(--font-inter); font-weight: 400; }
.bg-primary { background-color: var(--primary); color: white; }
.bg-dark { background-color: var(--foreground); color: white; }
.bg-light { background-color: var(--background); }
.text-primary { color: var(--primary); }
.text-white { color: white; }
.text-slate-500 { color: #64748b; }
.text-center { text-align: center; }
.text-small { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-4 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.p-4 { padding: 1rem; }
.w-1\/2 { width: 50%; }
.w-1\/3 { width: 33.333%; }
.w-1\/4 { width: 25%; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.flex-col { flex-direction: column; }
.gap-md { gap: 1rem; }
.relative { position: relative; }
.opacity-80 { opacity: 0.8; }
.uppercase { text-transform: uppercase; }

.border { border: 1px solid #e2e8f0; }
.rounded { border-radius: 8px; }
.rounded-2xl { border-radius: 1rem; }
.padding-lg { padding: 2rem; }
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.transition-all { transition: all 0.3s ease; }

.divider { height: 4px; width: 60px; background-color: var(--primary); margin: 1.5rem 0; }
.divider-sm { border: 0; height: 1px; background: #e2e8f0; width: 100%; }

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 9999px;
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.badge.bg-green { background-color: #10b981; }
.badge.bg-red { background-color: #ef4444; }

/* Estructura de Página tipo Documento */
.page {
    background-color: white;
    width: 210mm; /* A4 width */
    min-height: 297mm; /* A4 height */
    margin: 2rem auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    position: relative;
    page-break-after: always;
}

.page-container {
    padding: 40mm 20mm 30mm 20mm;
}

.section-title {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.intro-text {
    font-size: 1.25rem;
    color: #475569;
    margin-bottom: 2.5rem;
    max-width: 800px;
}

/* Grids */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

/* Cover Page */
.cover-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}
.cover-content { text-align: center; }
.cover-logo { max-width: 300px; margin-bottom: 3rem; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1)); }
.cover-text h1 { color: white; font-size: 3.5rem; margin-bottom: 0.5rem; }
.cover-text p { font-size: 1.25rem; opacity: 0.9; }
.cover-text .divider { background-color: white; margin: 2rem auto; }

/* TOC */
.toc-list { list-style: none; margin-top: 2rem; }
.toc-list li { margin-bottom: 1rem; border-bottom: 1px dashed #cbd5e1; padding-bottom: 0.5rem; }
.toc-list a { color: var(--foreground); font-size: 1.2rem; font-family: var(--font-montserrat); display: flex; align-items: center; }
.toc-list .num { color: var(--primary); font-weight: 700; margin-right: 1rem; width: 40px; display: inline-block; }

/* 01. Intro */
.brand-traits { list-style: none; }
.brand-traits li { margin-bottom: 0.75rem; padding-left: 1.5rem; position: relative; }
.brand-traits li::before { content: "•"; color: var(--primary); font-size: 1.5rem; position: absolute; left: 0; top: -5px; }
.icon-large { width: 150px; }

/* 02. Logo */
.logo-showcase { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.showcase-box { padding: 3rem 2rem; text-align: center; border-radius: 8px; }
.showcase-box h4 { font-size: 0.9rem; margin-bottom: 2rem; opacity: 0.7; }
.showcase-box img { max-width: 80%; height: auto; }
.icon-medium { width: 80px; margin: 1rem 0; }
.variation-box { padding: 2rem; text-align: center; }

/* 03. Área Seguridad */
.safety-box { position: relative; display: inline-block; padding: 3rem; border: 2px dashed #94a3b8; }
.safety-box img { width: 200px; }
.safety-guides::before, .safety-guides::after { content: "X"; position: absolute; color: var(--primary); font-weight: bold; font-family: monospace; font-size: 1.5rem;}
.safety-guides::before { top: 10px; left: 50%; transform: translateX(-50%); }
.safety-guides::after { left: 10px; top: 50%; transform: translateY(-50%); }

/* 05. Colores */
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.5rem; }
.color-card { border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.color-swatch { height: 120px; width: 100%; }
.color-info { padding: 1rem; background: white; display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.875rem; }
.color-info strong { font-family: var(--font-montserrat); color: var(--foreground); }
.color-info span { color: #64748b; }

/* 06. Tipografía */
.typo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.typo-preview { font-size: 3rem; padding: 2rem 0; border-bottom: 2px solid var(--primary); margin-bottom: 1rem; }
.typo-details h4 { color: var(--primary); }
.weights { display: flex; gap: 1rem; margin-top: 1rem; font-size: 0.875rem; color: #475569; }

/* 07. UI */
.btn { padding: 0.75rem 1.5rem; border-radius: 9999px; font-weight: 600; cursor: pointer; border: none; font-family: var(--font-inter); transition: all 0.3s ease; }
.btn-primary { background-color: var(--primary); color: white; box-shadow: 0 10px 15px -3px rgba(45, 62, 157, 0.3); }
.btn-outline { background-color: transparent; border: 2px solid var(--primary); color: var(--primary); }

.card-demo { background: white; border-radius: 1rem; overflow: hidden; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); border: 1px solid #e2e8f0; }
.card-img-placeholder { height: 150px; background-color: #cbd5e1; }
.card-body-demo { padding: 1.5rem; }
.badge-demo { display: inline-block; padding: 2px 8px; background: var(--primary); color: white; font-size: 0.6rem; border-radius: 10px; margin-bottom: 10px; font-weight: bold; }
.read-more { color: var(--primary); font-weight: bold; font-size: 0.8rem; display: block; margin-top: 1rem; }

/* 09. Errores */
.error-box { text-align: center; }
.error-img { height: 150px; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 1rem; position: relative; overflow: hidden; background: white;}
.error-img img { width: 100px; }
.cross { position: absolute; inset: 0; background: linear-gradient(to top right, transparent calc(50% - 2px), red, transparent calc(50% + 2px)), linear-gradient(to bottom right, transparent calc(50% - 2px), red, transparent calc(50% + 2px)); opacity: 0.5; z-index: 10;}
.error-box p { font-size: 0.875rem; color: #ef4444; font-weight: 500; }

/* 10. Aplicaciones */
.applications-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.app-mockup { background: #f8fafc; padding: 2rem; border-radius: 8px; border: 1px solid #e2e8f0; display: flex; flex-direction: column; align-items: center;}
.business-card { width: 250px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.bc-front { height: 140px; background: white; } /* Wait, .bc-front has bg-primary in HTML, that will override */
.bc-back { height: 140px; background: white; padding: 1rem; border: 1px solid #e2e8f0; }
.hero-banner { width: 100%; aspect-ratio: 16/9; display: flex; flex-direction: column; justify-content: center; }

/* Responsiveness (For screen viewing) */
@media screen and (max-width: 900px) {
    .page { width: 100%; margin: 1rem 0; border-radius: 0; }
    .page-container { padding: 2rem; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .color-grid { grid-template-columns: 1fr 1fr; }
}

/* Print Styles */
@media print {
    @page { size: A4; margin: 0; }
    body { background-color: white; margin: 0; padding: 0; }
    .page { 
        margin: 0; 
        box-shadow: none; 
        width: 210mm; 
        min-height: 297mm; 
        page-break-after: always;
        page-break-inside: avoid;
    }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
