:root {
    --bg-dark: #ECE8E1; /* Fondo pergamino exterior */
    --card-bg: #FAF7F2; /* Marfil para panel interior */
    --text-primary: #1a1a1a; /* Texto principal oscuro */
    --text-secondary: #5c5c5c;
    --brand-color: #C5A059; /* Oro envejecido */
    --brand-hover: #D4AF37;
    --border-color: #D6D1C4;
    --sidebar-bg: #0a0a0a; /* Negro Litúrgico (Sotana) */
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Cinzel', serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
}

.view {
    display: none;
    height: 100vh;
    width: 100vw;
}

.view.active {
    display: flex;
}

/* Landing Page */
#landing-screen {
    position: relative;
    justify-content: center;
    align-items: center;
}

.landing-content {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(12px);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    text-align: center;
    max-width: 500px;
    z-index: 10;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.logo span, .logo-small span {
    color: var(--brand-color);
}
.logo { color: #ffffff; font-family: 'Cinzel', serif; }

.landing-content h1 {
    font-size: 2.2rem;
    margin: 0 0 1rem 0;
}

.landing-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.login-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-box h3 { margin: 0; font-size: 1.1rem; }
.login-box input {
    padding: 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: white;
    border-radius: 8px;
    font-family: 'Outfit';
}
.login-box input:focus { outline: none; border-color: var(--brand-color); }

.btn-primary {
    background: var(--brand-color);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.btn-primary:hover { background: var(--brand-hover); }

.signup-link { font-size: 0.9rem; margin-top: 1rem; }
.signup-link a { color: var(--brand-color); text-decoration: none; }

.landing-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    z-index: 1;
}

/* Dashboard */
.saas-sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.logo-small {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: #ffffff;
    font-family: 'Cinzel', serif;
}

.nav-category {
    font-size: 0.8rem;
    font-weight: 700;
    color: #8892b0;
    letter-spacing: 0.1em;
    padding: 0 16px;
    margin-bottom: 0.8rem;
    font-family: 'Cinzel', serif;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-links li {
    padding: 12px 16px;
    border-radius: 4px;
    color: #cbd5e1;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}
.nav-links li:hover:not(.active) { background: rgba(197, 160, 89, 0.1); color: var(--brand-color); }
.nav-links li.active { background: rgba(197, 160, 89, 0.2); color: var(--brand-color); font-weight: 600; border-left: 3px solid var(--brand-color); }

/* Capitular Icons */
.icon {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: var(--brand-color);
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.badge {
    background: var(--brand-color);
    color: #000;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
    font-weight: 700;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}
.avatar {
    width: 40px; height: 40px;
    background: var(--card-bg);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
}
.user-info strong { display: block; font-size: 0.95rem; }
.user-info span { color: var(--text-secondary); font-size: 0.8rem; }

.btn-upgrade {
    background: transparent;
    border: 1px solid var(--brand-color);
    color: var(--brand-color);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}
.btn-upgrade:hover { background: rgba(245, 158, 11, 0.1); }

/* Main Hub */
.saas-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
}

.saas-header {
    height: 80px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: var(--bg-dark);
}
.saas-header h2 { margin: 0; font-weight: 500; font-size: 1.3rem; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 12px;
}

.workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.config-panel {
    width: 400px;
    border-right: 1px solid var(--border-color);
    padding: 2rem;
    overflow-y: auto;
    background: var(--card-bg);
}

.config-panel h3 { margin: 0 0 0.2rem 0; }
.subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 2rem; }
.subtitle a { color: var(--brand-color); text-decoration: none; }

.form-grid { display: flex; flex-direction: column; gap: 1.2rem; margin-bottom: 2rem;}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.input-group select, .input-group input {
    width: 100%;
    padding: 12px;
    background: #ECE8E1;
    border: 1px solid var(--border-color);
    color: #1a1a1a;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-weight: 500;
}

.cantos-section h4 { margin: 0 0 1rem 0; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem;}
.canto-item { margin-bottom: 1rem; }
.canto-item input {
    width: 100%; padding: 10px; background: #ECE8E1; border: 1px solid var(--border-color); color: #1a1a1a; border-radius: 4px; border-left: 3px solid var(--brand-color); font-family: 'Cinzel', serif;
}

.btn-generate {
    width: 100%; background: var(--brand-color); color: #111822; font-weight: 700;
    padding: 14px; border: none; border-radius: 4px; cursor: pointer; margin-top: 1rem; transition: 0.2s;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
}
.btn-generate:hover { background: var(--brand-hover); }

.preview-panel {
    flex: 1;
    background: #f1f5f9; /* Neutro gris para escritorio */
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.pdf-container {
    background: #FAF7F2; /* Perlado / Parchment */
    color: #1a1a1a;
    width: 100%;
    max-width: 210mm; /* A4 Width maximo */
    min-height: 297mm; /* A4 Height minimo */
    height: max-content;
    padding: 25mm !important; /* Standard margins */
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-radius: 0px; /* Sharp corners like paper */
    font-family: 'EB Garamond', serif;
    white-space: pre-wrap;
    line-height: 1.6;
    margin: 0 auto;
    text-align: justify;
    font-size: 1.05rem;
}

.empty-state {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    text-align: center;
    font-family: 'Cinzel', serif;
    opacity: 0.6;
}

/* Rubric Styles */
.pdf-container strong.rubric {
    color: #B20000; /* Liturgical red */
}
.pdf-container h2, .pdf-container h3, .pdf-container strong.title-red {
    color: #B20000;
    font-family: 'Cinzel', serif;
    text-align: center;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.pdf-container blockquote {
    font-style: italic; color: #444; border-left: 3px solid #c90000; padding-left: 15px; margin-left: 20px;
}

/* Modals */
.modal {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8); backdrop-filter: blur(5px);
    z-index: 100; align-items: center; justify-content: center;
}
.modal.visible { display: flex; }

.modal-content {
    background: var(--card-bg); padding: 3rem; border-radius: 16px; width: 100%; max-width: 500px;
    border: 1px solid var(--border-color); text-align: center; position: relative;
}

.close-btn {
    position: absolute; top: 1rem; right: 1rem; background: none; border: none; color: white;
    font-size: 1.5rem; cursor: pointer;
}

.pricing-card {
    background: var(--bg-dark); border: 2px solid var(--brand-color); border-radius: 12px;
    padding: 2rem; margin-top: 2rem;
}
.pricing-card h3 { margin: 0; color: var(--brand-color); }
.price { font-size: 2.5rem; font-weight: 700; margin: 1rem 0; }
.price span { font-size: 1rem; color: var(--text-secondary); font-weight: 400; }

.pricing-card ul { text-align: left; margin-bottom: 2rem; color: var(--text-secondary); font-size: 0.95rem;}
.btn-checkout {
    width: 100%; background: #6366f1; color: white; padding: 14px; border: none; border-radius: 8px;
    font-weight: 600; cursor: pointer;
}

/* --- BOLETIN PRO STYLES --- */
.bulletin-wrapper {
    background: white;
    color: #111;
    width: 100%;
    max-width: 210mm;
    min-height: 297mm;
    height: max-content;
    padding: 15mm;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    font-family: 'Merriweather', serif;
    position: relative;
    margin: 0 auto;
}

.bul-top-motto {
    font-family: 'Outfit', sans-serif;
    color: #0b7a95; /* Teal color */
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    margin-bottom: 0;
}

.bul-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border-bottom: 2px solid #333;
    font-family: 'Outfit', sans-serif;
}

.bul-info-col {
    padding: 15px;
    font-size: 0.75rem;
    border-right: 1px solid #999;
}
.bul-info-col:last-child { border-right: none; text-align: center; }

.bul-date h4 {
    color: #6122d6; /* Purple */
    margin: 0 0 5px 0;
    font-size: 1rem;
    text-transform: uppercase;
}
.bul-date p { color: #d97706; font-weight: 600; margin: 0;}

.bul-title-main {
    font-size: 5.5rem;
    font-weight: 900;
    text-align: center;
    margin: 10px 0;
    letter-spacing: -3px;
    line-height: 1;
}

.bul-subtitle {
    font-family: 'Outfit', sans-serif;
    color: #0b7a95;
    font-weight: 700;
    font-size: 0.9rem;
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: 30px;
}

.bul-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
    height: 350px;
}

.bul-grid-box {
    background: #333;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}
.bul-grid-box.purple { background: #875c8a; color: white; font-family: 'Merriweather'; font-size: 1.1rem; line-height: 1.2; font-weight: 700;}
.bul-bg-img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.8;
}

.bul-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
}

.bul-clergy h3 {
    font-family: 'Style Script', 'Merriweather', cursive; /* Elegant Script fallback */
    font-size: 2.5rem;
    font-style: italic;
    margin: 0 0 10px 0;
}
.bul-clergy p {
    font-family: 'Merriweather'; font-size: 0.8rem; margin: 2px 0; font-weight: 700;
}
.bul-qr {
    width: 100px; height: 100px; background: #eee;
}

/* Gospel Page 2 */
.bul-page-2 {
    margin-top: 15mm;
    border-top: 2px dashed #ccc;
    padding-top: 15mm;
}
.bul-page-2 h2 { text-transform: uppercase; font-size: 1.2rem; color: #c90000; text-align: center; }

/* Premium Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center; justify-content: center;
    backdrop-filter: blur(5px);
}
.modal.visible {
    display: flex;
}
.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    color: white;
}
.close-btn {
    position: absolute;
    top: 15px; right: 15px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}
.pricing-card {
    background: var(--card-bg);
    border: 1px solid var(--brand-color);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}
.pricing-card .price {
    font-size: 2.5rem;
    color: var(--brand-color);
    font-weight: 700;
    margin: 10px 0;
}
.pricing-card .price span {
    font-size: 1rem; color: var(--text-secondary);
}
.pricing-card ul {
    text-align: left;
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}
.pricing-card ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}
.pricing-card ul li::before {
    content: '✓ ';
    color: var(--brand-color);
    font-weight: bold;
}
.btn-checkout {
    background: var(--brand-color);
    color: #000;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    font-size: 1rem;
}
