/* ============================================
   BotFactura.com - Full d'estil compartit
   ============================================ */

:root {
    --primary: #1f4e79;
    --primary-dark: #144870;
    --primary-light: #e8f0f9;
    --accent: #2ecc71;
    --text: #1a2841;
    --text-soft: #5a6478;
    --text-light: #8a94a8;
    --bg: #ffffff;
    --bg-soft: #f7f9fc;
    --border: #e5e8ee;
    --radius: 8px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --max-w: 1100px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter,
                 "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
}

/* ============ Header ============ */
header.site-header {
    position: sticky; top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}
.site-header .container {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 16px; padding-bottom: 16px;
}
.logo {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 19px; color: var(--text);
    text-decoration: none;
}
.logo svg { width: 32px; height: 32px; }
nav ul { list-style: none; display: flex; gap: 28px; }
nav a {
    color: var(--text-soft); font-size: 15px; font-weight: 500;
}
nav a:hover { color: var(--primary); text-decoration: none; }

/* ============ Selector d'idioma ============ */
.lang-switcher {
    display: flex; align-items: center; gap: 4px;
    margin-left: 20px; font-size: 13px;
}
.lang-link {
    color: var(--text-light); padding: 5px 8px;
    border-radius: 4px; font-weight: 500;
    text-decoration: none;
}
.lang-link.active { color: var(--primary); font-weight: 700; }
.lang-link:hover { background: var(--bg-soft); text-decoration: none; color: var(--primary); }
.lang-sep { color: var(--text-light); font-weight: 300; }

/* ============ Buttons ============ */
.btn {
    display: inline-block; padding: 12px 24px;
    border-radius: var(--radius); font-weight: 600; font-size: 15px;
    text-decoration: none; border: none; cursor: pointer;
    transition: all 0.15s;
}
.btn-primary {
    background: var(--primary); color: white;
}
.btn-primary:hover {
    background: var(--primary-dark); text-decoration: none;
    transform: translateY(-1px); box-shadow: var(--shadow-md);
}
.btn-secondary {
    background: transparent; color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn-secondary:hover { background: var(--primary-light); text-decoration: none; }
.btn-lg { padding: 16px 32px; font-size: 17px; }

/* ============ Hero ============ */
.hero {
    padding: 80px 0 60px;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}
.hero-grid {
    display: grid; grid-template-columns: 1.1fr 1fr;
    gap: 64px; align-items: center;
}
.hero h1 {
    font-size: 44px; line-height: 1.15; margin-bottom: 20px;
    letter-spacing: -0.02em;
}
.hero h1 .highlight { color: var(--primary); }
.hero .subtitle {
    font-size: 19px; color: var(--text-soft); margin-bottom: 32px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-meta {
    margin-top: 24px; font-size: 14px; color: var(--text-light);
}
.hero-image {
    background: white; border: 1px solid var(--border);
    border-radius: 12px; padding: 24px;
    box-shadow: var(--shadow-md);
}

/* ============ Sections ============ */
section.block { padding: 80px 0; }
section.block-soft { padding: 80px 0; background: var(--bg-soft); }
.section-head { text-align: center; max-width: 700px; margin: 0 auto 56px; }
.section-head h2 {
    font-size: 34px; margin-bottom: 14px; letter-spacing: -0.01em;
}
.section-head p { font-size: 17px; color: var(--text-soft); }

/* ============ Features ============ */
.features {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}
.feature {
    background: white; padding: 28px; border-radius: var(--radius);
    border: 1px solid var(--border);
}
.feature-icon {
    width: 44px; height: 44px; border-radius: 10px;
    background: var(--primary-light); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px; font-size: 22px;
}
.feature h3 { font-size: 17px; margin-bottom: 8px; }
.feature p { font-size: 15px; color: var(--text-soft); }

/* ============ Pricing ============ */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 880px;
    margin: 0 auto;
    align-items: stretch;
}
.pricing-card {
    background: white; border: 2px solid var(--border);
    border-radius: 12px; padding: 36px 32px;
    text-align: center;
    box-shadow: var(--shadow-md);
    position: relative;
    display: flex; flex-direction: column;
}
.pricing-card-pro {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(31,78,121,0.15);
    transform: translateY(-4px);
}
.pricing-badge {
    position: absolute;
    top: -12px; left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}
.price-tag {
    font-size: 48px; font-weight: 800; color: var(--primary);
    line-height: 1; margin: 12px 0;
}
.price-tag span { font-size: 17px; font-weight: 500; color: var(--text-soft); }
.pricing-card ul {
    list-style: none; text-align: left; margin: 20px 0;
    flex-grow: 1;
}
.pricing-card li {
    padding: 7px 0; padding-left: 26px; position: relative;
}
.pricing-card li::before {
    content: "✓"; position: absolute; left: 0; color: var(--accent);
    font-weight: bold;
}
@media (max-width: 768px) {
    .pricing-grid { grid-template-columns: 1fr; gap: 20px; }
    .pricing-card-pro { transform: none; }
}

/* ============ FAQ ============ */
.faq { max-width: 780px; margin: 0 auto; }
.faq details {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px 24px; margin-bottom: 12px; background: white;
}
.faq details[open] { border-color: var(--primary); }
.faq summary {
    cursor: pointer; font-weight: 600; font-size: 16px;
    list-style: none; position: relative; padding-right: 30px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+"; position: absolute; right: 0; top: -2px;
    font-size: 22px; color: var(--primary);
}
.faq details[open] summary::after { content: "−"; }
.faq p { margin-top: 14px; color: var(--text-soft); font-size: 15px; }

/* ============ Footer ============ */
footer.site-footer {
    background: var(--text); color: white; padding: 48px 0 24px;
}
.site-footer .container { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px; }
.site-footer h4 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em;
                   margin-bottom: 16px; color: #b0b8c8; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #d0d6e0; font-size: 14px; }
.site-footer a:hover { color: white; text-decoration: none; }
.footer-bottom {
    margin-top: 40px; padding-top: 24px;
    border-top: 1px solid #2a3957; color: #8a94a8; font-size: 13px;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

/* ============ Pages legals ============ */
.legal-page {
    max-width: 800px; margin: 64px auto; padding: 0 24px;
}
.legal-page h1 { font-size: 32px; margin-bottom: 8px; }
.legal-page .meta { color: var(--text-light); font-size: 14px; margin-bottom: 40px; }
.legal-page h2 { font-size: 22px; margin-top: 36px; margin-bottom: 14px; }
.legal-page h3 { font-size: 17px; margin-top: 24px; margin-bottom: 10px; }
.legal-page p, .legal-page li { font-size: 16px; color: var(--text-soft); margin-bottom: 12px; line-height: 1.7; }
.legal-page ul, .legal-page ol { padding-left: 24px; margin-bottom: 16px; }
.legal-page .placeholder {
    background: #fff4cc; border: 1px solid #f0d068; padding: 12px 16px;
    border-radius: 6px; font-size: 14px; color: #5c4a00;
}
.legal-page .placeholder strong { color: #806b00; }

/* ============ Download page ============ */
.download-card {
    max-width: 560px; margin: 80px auto; text-align: center;
    background: white; border: 1px solid var(--border);
    border-radius: 12px; padding: 48px;
    box-shadow: var(--shadow-md);
}
.download-card .icon {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--primary-light); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 24px; font-size: 42px;
}
.license-box {
    font-family: Consolas, Monaco, monospace; font-size: 18px;
    background: var(--bg-soft); padding: 16px;
    border: 1px dashed var(--border); border-radius: 6px;
    margin: 16px 0 28px; letter-spacing: 2px; font-weight: 600;
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    nav ul { gap: 16px; }
    nav a { font-size: 14px; }
    .hero { padding: 48px 0 40px; }
    .hero-grid { grid-template-columns: 1fr; gap: 40px; }
    .hero h1 { font-size: 32px; }
    .hero .subtitle { font-size: 17px; }
    section.block, section.block-soft { padding: 56px 0; }
    .section-head h2 { font-size: 26px; }
    .site-footer .container { grid-template-columns: 1fr; gap: 32px; }
    .pricing-card { padding: 32px 24px; }
    .price-tag { font-size: 44px; }
}

/* ============ Demo animada (CSS pures, loop 14s) ============ */

/* Pasos verticals */
.bf-step { margin: 0 auto 56px; max-width: 900px; }
.bf-step:last-child { margin-bottom: 0; }
.bf-step-head { text-align: center; margin-bottom: 24px; }
.bf-step-num {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    width: auto; min-width: 36px; height: 36px;
    border-radius: 18px;
    line-height: 36px;
    padding: 0 14px;
    font-weight: 700; font-size: 14px;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}
.bf-step-head h3 {
    font-size: 22px; margin: 8px 0 8px;
    color: var(--primary);
}
.bf-step-head p {
    color: var(--text-soft); font-size: 15px;
    max-width: 640px; margin: 0 auto;
}
.bf-step-pro .bf-step-num { background: #B8860B; }
.bf-step-pro .bf-step-head h3 { color: #B8860B; }
.bf-tag-pro {
    display: inline-block;
    background: #B8860B;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 4px;
    letter-spacing: 1px;
    vertical-align: middle;
    margin-left: 6px;
}
.bf-demo-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; max-width: 900px; margin: 0 auto; }
.bf-window, .bf-excel { background: white; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); }
.bf-titlebar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #f0f2f5; border-bottom: 1px solid var(--border); }
.bf-dots { display: flex; gap: 7px; }
.bf-dots span { width: 11px; height: 11px; border-radius: 50%; background: #cfd5df; }
.bf-title { font-size: 12px; color: var(--text-soft); margin-left: 6px; }
.bf-body { padding: 20px; }
.bf-h1 { font-size: 19px; font-weight: 700; margin: 0 0 4px; color: var(--primary); }
.bf-sub { font-size: 13px; color: var(--text-soft); margin: 0 0 16px; }
.bf-label { font-size: 12px; color: var(--text-soft); margin-bottom: 5px; }
.bf-input { font-size: 14px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius); padding: 0 12px; display: flex; align-items: center; background: white; margin-bottom: 14px; font-family: Consolas, Monaco, monospace; color: var(--text); }
.bf-typing { display: inline-block; opacity: 0; animation: bfTyping 20s infinite; }
@keyframes bfTyping { 0%,3%{opacity:0} 5%,95%{opacity:1} 100%{opacity:0} }
.bf-btn { background: var(--primary); color: white; font-size: 14px; font-weight: 600; padding: 11px; border-radius: var(--radius); text-align: center; cursor: pointer; animation: bfBtn 20s infinite; }
@keyframes bfBtn { 0%,12%{background:var(--primary); transform:scale(1)} 15%{background:var(--primary-dark); transform:scale(.97)} 18%,95%{background:#888; transform:scale(1)} 100%{background:var(--primary)} }
.bf-btn::after { content: "▶  Començar processament"; animation: bfBtnText 20s infinite; }
@keyframes bfBtnText { 0%,18%{content:"▶  Començar processament"} 19%,33%{content:"Processant..."} 35%,95%{content:"✓  Acabat"} }
.bf-progress { height: 7px; background: #e5e8ee; border-radius: 4px; margin-top: 14px; overflow: hidden; }
.bf-progress-fill { height: 100%; background: var(--accent); width: 0; animation: bfFill 20s infinite; }
@keyframes bfFill { 0%,15%{width:0} 33%{width:100%} 35%,95%{width:100%} 100%{width:0} }
.bf-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 14px; opacity: 0; animation: bfStats 20s infinite; }
@keyframes bfStats { 0%,33%{opacity:0} 38%,95%{opacity:1} 100%{opacity:0} }
.bf-stat { background: #f5f7fa; padding: 8px 10px; border-radius: var(--radius); text-align: center; font-size: 11px; color: var(--text-soft); }
.bf-stat-num { display: block; font-size: 19px; font-weight: 700; margin-bottom: 2px; }
.bf-stat.ok .bf-stat-num { color: var(--accent); }
.bf-stat.dup .bf-stat-num { color: #185FA5; }
.bf-stat.ko .bf-stat-num { color: #c0392b; }
.bf-log { margin-top: 14px; font-family: Consolas, Monaco, monospace; font-size: 11px; line-height: 1.5; color: var(--text-soft); height: 130px; overflow: hidden; }
.bf-log p { margin: 0; opacity: 0; }
.bf-log p:nth-child(1) { animation: bfLog 20s infinite 0.5s; }
.bf-log p:nth-child(2) { animation: bfLog 20s infinite 1.5s; }
.bf-log p:nth-child(3) { animation: bfLog 20s infinite 2.5s; }
.bf-log p:nth-child(4) { animation: bfLog 20s infinite 3.5s; }
.bf-log p:nth-child(5) { animation: bfLog 20s infinite 4.5s; }
.bf-log p:nth-child(6) { animation: bfLog 20s infinite 5.5s; }
.bf-log p:nth-child(7) { animation: bfLog 20s infinite 6.5s; }
@keyframes bfLog { 0%,15%{opacity:0; transform:translateY(4px)} 20%,95%{opacity:1; transform:translateY(0)} 100%{opacity:0} }
.bf-ok { color: var(--accent); font-weight: bold; }
.bf-dup-c { color: #185FA5; font-weight: bold; }
.bf-msg { color: var(--primary) !important; margin-top: 6px !important; font-weight: 600; }
.bf-excel { opacity: 0; transform: translateX(20px); animation: bfExcel 20s infinite; }
@keyframes bfExcel { 0%,33%{opacity:0; transform:translateX(20px)} 40%,95%{opacity:1; transform:translateX(0)} 100%{opacity:0; transform:translateX(20px)} }
.bf-excel-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #217346; color: white; }
.bf-excel-icon { width: 20px; height: 24px; background: white; border-radius: 2px; display: flex; align-items: center; justify-content: center; color: #217346; font-size: 12px; font-weight: 700; }
.bf-excel-name { font-size: 12px; font-weight: 500; }
.bf-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.bf-table th { background: var(--primary); color: white; padding: 8px 10px; text-align: left; font-weight: 600; font-size: 11px; }
.bf-table td { padding: 7px 10px; border-top: 1px solid var(--border); color: var(--text); }
.bf-table tr.bf-total td { background: #f0f4f8; font-weight: 700; }
.bf-amount { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 768px) { .bf-demo-wrap { grid-template-columns: 1fr; gap: 16px; } }

/* ============ Excel AEAT (pas 3) ============ */
.bf-aeat-wrap { max-width: 900px; margin: 0 auto; }
.bf-excel-aeat { border: 2px solid #B8860B; }
.bf-excel-aeat .bf-excel-bar { background: #B8860B; }
.bf-aeat-meta {
    background: #f5f7fa;
    padding: 10px 16px;
    font-size: 12px;
    color: var(--text-soft);
    border-bottom: 1px solid var(--border);
    line-height: 1.6;
}
.bf-aeat-meta strong { color: var(--primary); font-size: 13px; }
.bf-aeat-meta code {
    background: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #1a2841;
}
.bf-aeat-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    background: #fff;
}
.bf-table-aeat {
    font-size: 10px;
    min-width: 1400px;  /* força scroll horitzontal */
}
.bf-table-aeat th {
    background: #B8860B;
    padding: 5px 7px;
    font-size: 9px;
    text-align: center;
    border-left: 1px solid rgba(255,255,255,.2);
    white-space: nowrap;
}
.bf-aeat-group th { background: #8B6508; border-bottom: 1px solid rgba(255,255,255,.3); }
.bf-aeat-subgroup th { background: #B8860B; font-weight: 500; }
.bf-table-aeat td {
    padding: 5px 7px;
    font-size: 10px;
    white-space: nowrap;
    border-left: 1px solid #f0f0f0;
}
.bf-table-aeat td:first-child { border-left: none; }
.bf-aeat-note {
    background: #fdf6e3;
    color: #B8860B;
    font-size: 11px;
    text-align: center;
    padding: 8px;
    border-top: 1px solid #B8860B;
    font-weight: 500;
}

@media (max-width: 500px) {
    nav ul { display: none; }
    .logo { font-size: 17px; }
}
