/* Cversus — estilos de la web pública y de la aplicación.
   Identidad visual de la familia Sapindex (Sapindex AI): magenta #A3166B, títulos en EB Garamond y texto en Inter.
   Las tipografías se sirven desde este mismo servidor (sin Google Fonts ni cookies de terceros). */
@font-face { font-family: "EB Garamond"; src: url("fonts/eb-garamond.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }

:root {
    --brand: #A3166B;
    --brand-dark: #8A1259;
    --brand-deep: #6E0D47;
    --tint: #FCF4F8;
    --tint-2: #FBEFF5;
    --tint-line: #E3BFD4;
    --ink: #1D2226;
    --text: #384347;
    --muted: #5F686D;
    --line: #E4DDE1;
    --line-soft: #EEE8EB;
    --field-line: #D9CED4;
    --bg: #F4F1F3;
    --white: #FFFFFF;
    --green: #18794E;
    --red: #B42318;
    --radius: 14px;
    --radius-sm: 8px;
    --serif: "EB Garamond", Georgia, "Times New Roman", serif;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --shadow: 0 1px 2px rgba(29, 34, 38, .04), 0 8px 24px rgba(29, 34, 38, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); color: var(--text); background: var(--white); line-height: 1.55; font-size: 16px; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
a:hover { color: var(--brand-deep); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; color: var(--ink); letter-spacing: 0; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.eyebrow { display: inline-block; color: var(--brand); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }

/* Botones y formularios */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; background: var(--brand); color: var(--white); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 0 20px; font-family: inherit; font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { background: var(--brand-dark); color: var(--white); }
.btn-secondary, .btn-ghost { background: var(--white); color: var(--ink); border-color: var(--field-line); }
.btn-secondary:hover, .btn-ghost:hover { background: var(--white); color: var(--brand); border-color: var(--brand); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #912018; }
.btn-small { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
button.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
button.link:hover { color: var(--brand); }
label { display: block; font-weight: 600; font-size: 13px; color: var(--ink); margin: 0 0 6px; }
input[type=text], input[type=email], input[type=password], select, textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--field-line); border-radius: var(--radius-sm); font: inherit; font-size: 15px; background: var(--white); color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(163, 22, 107, .2); border-color: var(--brand); }
input[type=checkbox] { accent-color: var(--brand); }
.field { margin-bottom: 16px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 14px; color: var(--text); }
.check input { margin-top: 3px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.flash { margin: 16px 0; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 15px; }
.flash-success { background: #ECF7F1; color: var(--green); border: 1px solid #BFE3CF; }
.flash-error { background: #FEF3F2; color: var(--red); border: 1px solid #F5C2BE; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }

/* Marca */
.brand { display: inline-flex; align-items: center; background: var(--brand); color: var(--white); font-family: var(--serif); font-weight: 500; font-size: 25px; line-height: 1; letter-spacing: .01em; padding: 6px 14px 8px; border-radius: 6px; text-decoration: none; box-shadow: 0 1px 2px rgba(110, 13, 71, .25); }
.brand:hover { color: var(--white); background: var(--brand-dark); }
.brand-c { color: inherit; }

/* Cabecera y pie */
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.site-header { border-bottom: 1px solid var(--line); background: var(--white); position: sticky; top: 0; z-index: 10; }
.site-nav { display: flex; align-items: center; gap: 24px; }
.site-nav a { text-decoration: none; color: var(--text); font-weight: 500; font-size: 15px; }
.site-nav a:hover { color: var(--brand); }
.site-nav a.btn { color: var(--white); }
.site-footer { background: var(--bg); border-top: 1px solid var(--line); color: var(--muted); margin-top: 0; padding: 40px 0; font-size: 14px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--brand); }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.footer-inner p { margin: 12px 0 0; }
.footer-inner nav { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.brand-footer { font-size: 21px; }

/* Portada */
.hero { padding: 72px 0 56px; background: linear-gradient(110deg, #FFFFFF 0%, var(--tint-2) 55%, #F2D3E4 100%); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-size: 52px; font-weight: 500; margin: 0 0 20px; line-height: 1.08; }
.hero h1 em { font-style: italic; color: var(--brand); }
.hero .lead { font-size: 19px; color: var(--text); margin: 0 0 28px; max-width: 34em; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-note { font-size: 14px; color: var(--muted); margin-top: 14px; }
.ba { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.ba-arrow { font-size: 26px; color: var(--brand); font-weight: 600; }
.doc { background: var(--white); border-radius: 6px; box-shadow: 0 10px 30px rgba(29, 34, 38, .14); padding: 14px 12px; aspect-ratio: 1 / 1.414; font-size: 6.5px; line-height: 1.45; overflow: hidden; position: relative; }
.doc-before { font-family: "Comic Sans MS", "Trebuchet MS", sans-serif; color: #333; transform: rotate(-1.5deg); }
.doc-before .b-name { font-size: 13px; font-weight: 700; color: #2E7D32; }
.doc-before .b-contact { color: #0645AD; text-decoration: underline; margin-bottom: 5px; }
.doc-before .b-title { background: #FFE066; display: inline-block; font-weight: 700; margin: 5px 0 2px; padding: 0 2px; }
.doc-before .b-cols { display: grid; grid-template-columns: 1fr 2fr; gap: 6px; }
.doc-before .b-side { background: #E3F2FD; padding: 3px; }
.line { height: 3px; background: #DDD7DA; border-radius: 2px; margin: 3px 0; }
.line.s { width: 55%; } .line.m { width: 78%; }
.doc-after { padding: 16px 14px; }
.doc-after .a-head { padding: 0; }
.doc-after .a-logo { display: flex; justify-content: space-between; align-items: center; font-size: 6px; margin-bottom: 8px; color: var(--ink); font-weight: 600; letter-spacing: .1em; }
.doc-after .a-logo span:first-child { background: var(--brand); color: var(--white); font-family: var(--serif); font-size: 7px; letter-spacing: 0; padding: 2px 5px; border-radius: 2px; }
.doc-after .a-title { font-family: var(--serif); font-size: 11px; font-weight: 500; color: var(--ink); letter-spacing: .03em; padding-bottom: 5px; border-bottom: 1px solid var(--brand); }
.doc-after .a-body { padding: 4px 0 0; }
.doc-after .a-h { color: var(--brand); font-family: var(--serif); font-weight: 600; font-size: 8px; margin: 7px 0 3px; text-transform: uppercase; }
.doc-after .a-chip { display: inline-block; background: var(--tint); border: 1px solid var(--tint-line); color: var(--ink); border-radius: 6px; padding: 0 3px; margin: 0 2px 2px 0; }
.doc-after .a-badge { position: absolute; right: 8px; bottom: 8px; background: var(--ink); color: var(--white); font-size: 6px; padding: 1px 6px; border-radius: 6px; }
.doc-label { position: absolute; top: -26px; left: 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.section { padding: 80px 0; }
.section-alt { background: var(--bg); }
.section h2 { font-size: 38px; font-weight: 500; margin: 0 0 12px; }
.section .intro { font-size: 18px; color: var(--muted); max-width: 720px; margin: 0 0 40px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: step; }
.step { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.step::before { counter-increment: step; content: counter(step); display: inline-flex; width: 36px; height: 36px; border-radius: 50%; background: var(--tint); border: 1px solid var(--tint-line); color: var(--brand); font-family: var(--serif); font-size: 19px; font-weight: 600; align-items: center; justify-content: center; margin-bottom: 14px; }
.step h3 { margin: 0 0 8px; font-size: 23px; }
.step p { margin: 0; color: var(--muted); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 36px; }
.feature h3 { font-size: 22px; margin: 0 0 6px; }
.feature p { margin: 0; color: var(--muted); }
.feature-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--tint); border: 1px solid var(--tint-line); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.compare { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.compare th, .compare td { padding: 15px 18px; border-bottom: 1px solid var(--line-soft); text-align: left; font-size: 15px; }
.compare tr:last-child td { border-bottom: 0; }
.compare th { background: var(--bg); color: var(--ink); font-weight: 600; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.compare td:first-child { color: var(--ink); font-weight: 500; }
.compare td.yes { color: var(--brand); font-weight: 600; }
.pricing { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; align-items: stretch; }
.price-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; }
.price-card.featured { border: 2px solid var(--brand); position: relative; box-shadow: var(--shadow); }
.price-card.featured::after { content: "Más elegido"; position: absolute; top: -12px; left: 24px; background: var(--brand); color: var(--white); font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.price-card h3 { margin: 0 0 6px; font-size: 22px; }
.price { font-family: var(--serif); font-size: 44px; font-weight: 500; color: var(--ink); margin: 4px 0 2px; line-height: 1.1; }
.per-cv { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.price-card ul { padding-left: 18px; margin: 0 0 22px; color: var(--text); font-size: 15px; flex: 1; }
.price-card li::marker { color: var(--brand); }
.price-card .btn { width: 100%; }
.faq details { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 10px; }
.faq details[open] { border-color: var(--tint-line); }
.faq summary { font-weight: 600; cursor: pointer; color: var(--ink); }
.faq summary::marker { color: var(--brand); }
.faq details p { margin: 10px 0 0; color: var(--muted); }
.cta-band { background: linear-gradient(110deg, #FFFFFF 0%, var(--tint-2) 45%, #F2D3E4 100%); border: 1px solid #EBCFDE; border-radius: var(--radius); padding: 48px 40px; text-align: center; }
.cta-band h2 { color: var(--ink); }
.cta-band p { color: var(--muted); font-size: 18px; margin: 0 0 24px; }

/* Formularios de acceso */
.auth-page { background: var(--bg); padding: 56px 0 72px; }
.auth { max-width: 460px; margin: 0 auto; padding: 0 24px; }
.auth h1 { font-size: 36px; font-weight: 500; margin: 0 0 6px; }
.auth .card { margin-top: 20px; padding: 28px; }
.auth .btn { width: 100%; }

/* Páginas legales */
.legal { max-width: 780px; margin: 48px auto; padding: 0 24px; }
.legal h1 { font-size: 40px; font-weight: 500; }
.legal h2 { font-size: 24px; margin-top: 32px; }
.legal table { border-collapse: collapse; width: 100%; font-size: 14px; }
.legal td, .legal th { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal th { background: var(--bg); color: var(--ink); }

/* Aplicación */
.app { background: var(--bg); }
.app-header { background: var(--white); border-bottom: 1px solid var(--line); }
.app-header .brand { font-size: 22px; }
.app-nav { display: flex; gap: 4px; flex: 1; margin-left: 28px; }
.app-nav a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 15px; padding: 8px 12px; border-radius: var(--radius-sm); }
.app-nav a:hover { color: var(--ink); background: var(--bg); }
.app-nav a.active { color: var(--brand); background: var(--tint); }
.app-main { padding-top: 28px; padding-bottom: 56px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 34px; font-weight: 500; }
.balance { background: var(--tint); border: 1px solid var(--tint-line); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 14px; color: var(--ink); }
.balance strong { color: var(--brand); }
.app .card h2 { font-size: 24px; }
.grid-2 { display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }
.dropzone { display: block; border: 2px dashed var(--tint-line); border-radius: var(--radius); padding: 30px 16px; text-align: center; background: var(--tint); cursor: pointer; transition: border-color .15s, background .15s; font-weight: 400; }
.dropzone.drag, .dropzone:hover { border-color: var(--brand); background: var(--tint-2); }
.dropzone strong { display: block; color: var(--ink); margin-bottom: 4px; font-size: 15px; }
.dropzone input { display: none; }
.file-name { font-size: 14px; color: var(--brand); margin-top: 8px; font-weight: 600; word-break: break-all; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); text-align: left; font-size: 14px; vertical-align: middle; }
.table th { background: var(--white); color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.table tr:last-child td { border-bottom: 0; }
.table a { color: var(--ink); text-decoration: none; }
.table a:hover { color: var(--brand); }
.status { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.status-done { background: #ECF7F1; color: var(--green); }
.status-queued, .status-processing { background: var(--tint); color: var(--brand); }
.status-failed { background: #FEF3F2; color: var(--red); }
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .sep { width: 1px; height: 26px; background: var(--line); margin: 0 4px; }
.toolbar .save-state { font-size: 13px; color: var(--muted); margin-left: auto; }
.editor-page { background: var(--white); max-width: 820px; margin: 0 auto; padding: 44px 52px; border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); min-height: 600px; }
.editor-page [contenteditable="true"]:focus { outline: 2px dashed rgba(163, 22, 107, .4); outline-offset: 6px; }
.processing { text-align: center; padding: 64px 20px; }
.spinner { width: 44px; height: 44px; border: 4px solid var(--tint-line); border-top-color: var(--brand); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 18px; }
@keyframes spin { to { transform: rotate(360deg); } }
.template-grid { display: grid; grid-template-columns: 420px 1fr; gap: 24px; align-items: start; }
.preview-frame { width: 100%; height: 900px; border: 1px solid var(--line); border-radius: var(--radius); background: #E9E4E7; }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0 0 16px; background: var(--white); }
.fieldset legend { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--ink); padding: 0 6px; }
.colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.colors input[type=color] { width: 100%; height: 42px; border: 1px solid var(--field-line); border-radius: var(--radius-sm); padding: 3px; background: var(--white); }
.sections-list { list-style: none; padding: 0; margin: 0; }
.sections-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.sections-list li:last-child { border-bottom: 0; }
.sections-list .move { display: flex; gap: 4px; }
.sections-list .move button { background: var(--white); border: 1px solid var(--field-line); color: var(--ink); border-radius: 6px; width: 30px; height: 30px; cursor: pointer; }
.sections-list .move button:hover { border-color: var(--brand); color: var(--brand); }
.sections-list input[type=text] { min-height: 38px; padding: 6px 10px; font-size: 14px; }
.sections-list .sec-name { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.logo-thumb { max-height: 48px; max-width: 200px; display: block; margin-bottom: 8px; background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 12px 12px; }
.danger-zone { border-color: #F5C2BE; }

@media (max-width: 900px) {
    .hero { padding: 48px 0 40px; }
    .hero-grid, .grid-2, .template-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 38px; }
    .section { padding: 56px 0; }
    .section h2 { font-size: 30px; }
    .steps, .features { grid-template-columns: 1fr; }
    .pricing { grid-template-columns: 1fr 1fr; }
    .site-nav a:not(.btn) { display: none; }
    .app-nav { margin-left: 0; overflow-x: auto; }
    .editor-page { padding: 24px; }
    .preview-frame { height: 600px; }
}
@media (max-width: 560px) {
    .wrap { padding: 0 16px; }
    .pricing { grid-template-columns: 1fr; }
    .header-inner { flex-wrap: wrap; padding: 10px 0; }
    .cta-band { padding: 32px 20px; }
}
