/* CreSer · sitio público */
:root {
    --bg: #faf9f6;
    --surface: #ffffff;
    --tint: #eef2e6;
    --ink: #22302a;
    --muted: #55625a;
    --primary: #3a7350;
    --primary-dark: #244a34;
    --accent: #a0c078;
    --soft: #e3ebd8;
    --line: #dde3d2;
    --wa: #167a46;
    --danger: #a3372b;
    --radius: 16px;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--sans); }
img, svg, iframe { max-width: 100%; display: block; }
a { color: var(--primary); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.25rem; }
h3.small { font-size: 1.05rem; margin-top: 1.4rem; font-family: var(--sans); font-weight: 700; }
p { margin: 0 0 1em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 780px; }
.center { text-align: center; }
.eyebrow { font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--primary); margin-bottom: .8em; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 34em; }
.section-sub { color: var(--muted); max-width: 40em; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 48px; padding: 12px 24px; border-radius: 999px; border: 2px solid transparent; font: 600 1rem var(--sans); text-decoration: none; cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-ghost:hover { background: var(--primary); color: #fff; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: #146339; }
.btn-small { min-height: 40px; padding: 8px 18px; font-size: .95rem; }
.link { font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6rem; }

/* Cabecera */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(250, 249, 246, .97); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--primary); }
.brand-mark { height: 50px; width: auto; flex: none; }
.brand-logo { height: 50px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font: 700 1.5rem var(--sans); letter-spacing: .04em; color: var(--ink); }
.brand-text strong b { color: var(--primary); font-weight: 700; }
.brand-text small { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 500; font-size: .98rem; }
.nav a:hover { background: var(--tint); }
.nav a.btn { color: #fff; margin-left: 6px; }
.nav a.btn:hover { background: #146339; }
.nav-toggle { display: none; background: none; border: 0; width: 46px; height: 46px; border-radius: 10px; cursor: pointer; padding: 0; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px auto; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Secciones */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.tint { background: var(--tint); }

/* Inicio */
.hero { padding: clamp(40px, 7vw, 88px) 0 0; background: linear-gradient(180deg, var(--bg) 0%, var(--soft) 100%); }
.hero-inner { display: grid; gap: 40px; align-items: center; }
.hero-art { max-width: 420px; margin: 0 auto; width: 100%; }
.hero-art img { width: 100%; height: auto; border-radius: 28px; object-fit: cover; aspect-ratio: 8/9; }
.stats { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 28px 0 36px; margin: 40px 0 0; border-top: 1px solid rgba(58, 115, 80, .22); }
.stats li { display: flex; flex-direction: column; }
.stats strong { font: 600 clamp(1.8rem, 4.4vw, 2.8rem)/1.1 var(--serif); color: var(--primary); }
.stats span { color: var(--muted); font-size: .95rem; }

.checks { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 12px; }
.checks li { position: relative; padding-left: 34px; font-weight: 500; }
.checks li::before { content: ""; position: absolute; left: 0; top: .3em; width: 22px; height: 22px; border-radius: 50%; background: var(--soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%233a7350' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }

/* Tarjetas */
.cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); margin-top: 2rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; overflow: hidden; margin: 0; display: flex; flex-direction: column; gap: .4rem; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(38, 48, 47, .08); }
.card p { color: var(--muted); flex: 1; }
.card .link { margin-top: .4rem; }
.quote blockquote { margin: 0; font: italic 1.12rem/1.6 var(--serif); color: var(--ink); }
.quote figcaption { color: var(--muted); font-size: .92rem; font-weight: 600; margin-top: .6rem; }

/* Video, mapa */
.video, .map iframe { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #ddd; }
.video { aspect-ratio: 16/9; margin: 1.6rem 0; }
.video iframe { width: 100%; height: 100%; border: 0; }
.map iframe { width: 100%; height: 100%; min-height: 320px; border: 0; }

/* Proceso */
.steps { list-style: none; counter-reset: paso; padding: 0; margin: 2rem 0 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.steps li { counter-increment: paso; position: relative; padding: 70px 4px 0 0; }
.steps li::before { content: counter(paso); position: absolute; top: 0; left: 0; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: #fff; font: 600 1.4rem var(--serif); }
.steps p { color: var(--muted); }

/* Fundador */
.founder { display: grid; gap: 36px; align-items: center; }
.founder-photo { width: 100%; max-width: 360px; height: auto; border-radius: 24px; object-fit: cover; aspect-ratio: 9/11; }
.role { color: var(--primary); font-weight: 600; margin-top: -.3em; }
blockquote { margin: 1.6rem 0 0; padding-left: 20px; border-left: 4px solid var(--accent); font: italic 1.35rem/1.5 var(--serif); }

/* Preguntas */
.faq { margin-top: 1.6rem; display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 22px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 16px 28px 16px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font: 400 1.6rem var(--sans); color: var(--primary); }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); margin: 0 0 1em; }

/* Dos columnas */
.two { display: grid; gap: 40px; }
address { font-style: normal; margin-bottom: .4rem; }
.plain { list-style: none; padding: 0; margin: .4rem 0 1rem; }
.note { background: var(--soft); border-radius: 12px; padding: 14px 16px; color: var(--primary-dark); font-size: .95rem; }
.contact-list { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 14px; justify-items: start; }

/* Formulario */
.form { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: clamp(22px, 4vw, 36px); display: grid; gap: 18px; align-content: start; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .95rem; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field select, .field textarea { width: 100%; min-height: 48px; padding: 11px 14px; border: 1.5px solid #c9bfb0; border-radius: 12px; background: #fff; font: inherit; color: var(--ink); }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgba(58, 115, 80, .35); border-color: var(--primary); }
.field.check label { font-weight: 400; display: flex; gap: 10px; align-items: flex-start; font-size: .93rem; }
.field.check input { margin-top: .3em; width: 18px; height: 18px; flex: none; accent-color: var(--primary); }
.field-error { color: var(--danger); font-size: .88rem; margin: 0; min-height: 0; }
.field-error:empty { display: none; }
.field [aria-invalid="true"] { border-color: var(--danger); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { margin: 0; padding: 14px 16px; border-radius: 12px; font-weight: 500; }
.alert.ok { background: #e3f1e8; color: #17512f; }
.alert.error { background: #fbe7e4; color: var(--danger); }
.small-note { font-size: .85rem; color: var(--muted); margin: 0; }
.form .btn[disabled] { opacity: .6; cursor: wait; }

/* Texto legal */
.prose p { max-width: 42em; }

/* Pie */
.site-footer { background: var(--primary-dark); color: #e3ecde; padding: 40px 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-end; }
.footer-brand { font: 600 1.3rem var(--serif); margin: 0; color: #fff; }
.footer-tag { margin: .2rem 0 0; color: #c6d8c4; }
.footer-links { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.footer-links a { color: #fff; }

/* Chat CreSi */
.chat { position: fixed; right: 18px; bottom: 18px; z-index: 60; }
.chat-fab { display: flex; align-items: center; gap: 10px; background: var(--primary); color: #fff; border: 0; padding: 14px 20px; border-radius: 999px; font: 600 .98rem var(--sans); cursor: pointer; box-shadow: 0 10px 28px rgba(36, 74, 52, .35); }
.chat-fab:hover { background: var(--primary-dark); }
.chat-panel { position: absolute; right: 0; bottom: 64px; width: min(380px, calc(100vw - 28px)); max-height: min(560px, calc(100vh - 110px)); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 60px rgba(38, 48, 47, .25); display: flex; flex-direction: column; overflow: hidden; }
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; justify-content: space-between; align-items: center; background: var(--primary); color: #fff; padding: 14px 16px; }
.chat-head div { display: flex; flex-direction: column; line-height: 1.2; }
.chat-head small { opacity: .85; font-size: .8rem; }
.chat-head button { background: none; border: 0; color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; padding: 0 6px; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); min-height: 200px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: .96rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.bot { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.me { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.msg.typing { color: var(--muted); font-style: italic; }
.msg a { color: inherit; font-weight: 600; }
.chat-note { margin: 0; padding: 8px 14px; font-size: .75rem; color: var(--muted); background: var(--tint); }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.chat-form input { flex: 1; min-width: 0; min-height: 44px; border: 1.5px solid #c9bfb0; border-radius: 999px; padding: 0 16px; font: inherit; }
.chat-form button { background: var(--primary); color: #fff; border: 0; border-radius: 999px; padding: 0 18px; font: 600 .95rem var(--sans); cursor: pointer; }
.chat-form button[disabled] { opacity: .6; }

/* Pantallas medianas y grandes */
@media (min-width: 900px) {
    .hero-inner { grid-template-columns: 1.15fr .85fr; }
    .two { grid-template-columns: 1fr 1fr; align-items: start; gap: 56px; }
    .founder { grid-template-columns: 360px 1fr; gap: 56px; }
    .founder:not(:has(.founder-photo)) { grid-template-columns: 1fr; max-width: 780px; }
}

/* Teléfonos y tabletas */
@media (max-width: 899px) {
    .nav-toggle { display: block; }
    .nav { position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 22px 18px; display: none; }
    .nav.open { display: flex; }
    .nav a { padding: 14px 10px; font-size: 1.05rem; }
    .nav a.btn { margin: 8px 0 0; justify-content: center; }
    .chat-fab span { display: none; }
    .chat-fab { padding: 15px; }
}
@media (max-width: 520px) {
    body { font-size: 16.5px; }
    .stats { gap: 6px; }
    .stats span { font-size: .82rem; }
    .actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}

/* Fotos en tarjetas y en Nosotros */
.card.has-photo { padding: 0; }
.card.has-photo .card-body { padding: 24px 26px 26px; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.card-photo { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.about { display: grid; gap: 32px; align-items: center; }
.about-photo { width: 100%; max-width: 420px; height: auto; border-radius: 24px; aspect-ratio: 4/5; object-fit: cover; margin: 0 auto; }
@media (min-width: 900px) {
    .about.with-photo { grid-template-columns: 1fr 380px; gap: 56px; }
    .about.with-photo .about-photo { margin: 0; }
}
.footer-logo { height: 54px; width: auto; margin-bottom: 10px; }
.card-plain { display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.card-plain p, .card-body p { color: var(--muted); flex: 1; }
.founder-photo { aspect-ratio: 1/1; }
