/* ==========================================================
   Corporación emaNova · Hoja de estilos
   Estructura: 1 Tokens · 2 Base · 3 Componentes · 4 Secciones · 5 Responsivo
   ========================================================== */

/* ---------- 1. TOKENS ---------- */
:root {
  --navy: #344153;       /* Azul Noche institucional */
  --yellow: #FFB000;     /* Amarillo de marca (acento de interfaz) */
  --green: #96CA00;      /* Verde Brote */
  --rosa: #F2A7A0;       /* Rosa Tierra */
  --monte: #2F5D50;      /* Verde Monte */
  --cielo: #9CCBE8;      /* Cielo */
  --cream: #F7F1E6;      /* Crema */
  --white: #FFFFFF;
  --text-soft: #5b6676;

  --font-head: "Nunito", system-ui, sans-serif;
  --font-body: "Nunito Sans", system-ui, sans-serif;

  --radius: 22px;
  --shadow: 0 6px 20px rgba(52, 65, 83, .10);
  --header-h: 84px;
  --wrap: 1180px;
}

/* ---------- 2. BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body { margin: 0; font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.5; color: var(--navy); background: var(--white); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 900; line-height: 1.12; margin: 0 0 .5em; }
h1, .h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); color: var(--white); font-weight: 900; }
h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
.h3, h3 { font-size: 1.35rem; }
.h4 { font-size: 1rem; color: var(--yellow); }
p { margin: 0 0 1em; }
.container { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.skip { position: absolute; left: -999px; top: 0; background: var(--yellow); color: var(--navy); padding: .6rem 1rem; z-index: 100; font-weight: 700; }
.skip:focus { left: 1rem; top: 1rem; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

/* Subrayado amarillo en palabra clave (recurso gráfico de marca) */
.ul { background: linear-gradient(var(--yellow), var(--yellow)) 0 94% / 100% .16em no-repeat; padding-bottom: .06em; }

/* ---------- 3. COMPONENTES ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem; cursor: pointer;
  font: 800 1rem var(--font-head); text-decoration: none;
  background: var(--yellow); color: var(--navy); border: 2px solid var(--yellow);
  padding: .85rem 1.6rem; border-radius: 999px; min-height: 48px;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(255, 176, 0, .35); }
.btn--ghost { background: transparent; border-color: var(--navy); }
.btn--ghost:hover { background: var(--navy); color: var(--white); box-shadow: none; }

/* ---------- 4. SECCIONES ---------- */
/* Encabezado */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--navy); }
.nav { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); padding-block: .6rem; }
.brand img { width: 170px; height: auto; }
.menu ul { display: flex; gap: clamp(1rem, 2.4vw, 2rem); }
.menu a { color: var(--white); text-decoration: none; font-weight: 700; font-size: .95rem; padding: .5rem 0; position: relative; transition: color .2s; }
.menu a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px; background: var(--yellow); transform: scaleX(0); transition: transform .25s; }
.menu a:hover { color: var(--yellow); }
.menu a.is-active::after { transform: scaleX(1); }
.nav-toggle { display: none; background: none; border: 0; width: 48px; height: 48px; cursor: pointer; padding: 12px; }
.nav-toggle span { display: block; height: 3px; background: var(--white); border-radius: 3px; margin: 5px 0; transition: transform .25s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Hero */
.hero { background: var(--navy); color: var(--white); position: relative; padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(5rem, 9vw, 7rem); }
.hero::after { content: ""; position: absolute; left: -5%; right: -5%; bottom: -1px; height: 70px; background: var(--white); border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; }
.hero-copy { position: relative; z-index: 2; }
.hero-copy .slide { display: none; }
.hero-copy .slide.is-active { display: block; animation: fade .5s ease; }
.hero-copy p { font-size: 1.15rem; max-width: 30em; color: #e7ebf1; margin-bottom: 1.8rem; }
.dots { display: flex; gap: .4rem; margin-top: 2rem; }
.dots button { width: 28px; height: 28px; border: 0; background: none; cursor: pointer; position: relative; }
.dots button::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: rgba(255,255,255,.4); transition: .2s; }
.dots button.is-active::before { background: var(--white); inset: 8px; }
.hero-art { position: relative; min-height: 380px; display: grid; place-items: end center; }
.blob { position: absolute; inset: -4rem -2rem -7rem 8%; background: var(--yellow); border-radius: 48% 52% 0 0 / 60% 60% 0 0; }
.art { position: absolute; bottom: 0; width: min(100%, 520px); height: auto; max-height: 100%; object-fit: contain; opacity: 0; transition: opacity .5s; z-index: 1; }
.art.is-active { opacity: 1; position: relative; }
.art:not(.is-active) { pointer-events: none; }
.hero-art .art { position: absolute; }
.hero-art .art.is-active { position: relative; }
.art--round { border-radius: 24px; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Pilares */
.pillars { background: var(--white); padding: 1rem 0 2.5rem; }
.pillars-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.pillar { text-align: center; padding: .5rem 2rem; }
.pillar + .pillar { border-left: 1px solid #dde2e9; }
.pillar svg { width: 46px; height: 46px; margin: 0 auto .6rem; }
.pillar h2 { margin-bottom: .3rem; }
.pillar p { color: var(--text-soft); margin: 0; font-size: .98rem; }

/* Quiénes somos */
.about-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.about-art { position: relative; max-width: 480px; justify-self: center; }
.about-art .sun { position: absolute; width: 62%; aspect-ratio: 1; border-radius: 50%; background: var(--yellow); top: 4%; left: 20%; }
.about-art img { position: relative; }
.about-copy p { color: var(--text-soft); max-width: 34em; }
.about-copy strong { color: var(--navy); }
.essence { margin-top: 1.5rem; padding: 1.25rem 1.5rem; background: var(--cream); border-radius: var(--radius); animation: fade .4s ease; }
.essence[hidden] { display: none; }
.essence h3 { margin-bottom: .6rem; }
.essence p:last-child { margin: 0; color: var(--navy); }

/* Líneas */
.lines { background: var(--cream); }
.sec-title { position: relative; display: inline-block; margin-bottom: 2rem; padding-bottom: .5rem; }
.sec-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 4px; border-radius: 4px; background: var(--yellow); }
.lines-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.card-line { border-radius: var(--radius); padding: 1.6rem 1.4rem; display: flex; flex-direction: column; align-items: center; text-align: center; box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s; }
.card-line:hover { transform: translateY(-6px); box-shadow: 0 14px 30px rgba(52,65,83,.18); }
.card-line h3 { font-size: 1.2rem; min-height: 3.1em; }
.card-line img { width: 78%; margin: .6rem auto 1rem; flex: 1; object-fit: contain; }
.card-line p { margin: 0; font-size: .98rem; }
.card-line--rosa { background: var(--rosa); color: var(--navy); }
.card-line--monte { background: var(--monte); color: var(--white); }
.card-line--cielo { background: var(--cielo); color: var(--navy); }

/* Alianzas */
.alliances { background: var(--navy); color: var(--white); padding: 3rem 0; text-align: center; }
.alliances h2 { color: var(--yellow); }
.alliances p { max-width: 46em; margin: 0 auto; color: #e7ebf1; }

/* Noticias */
.news-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.link-all { font: 800 .95rem var(--font-head); text-decoration: none; display: inline-flex; gap: .4rem; align-items: center; }
.link-all svg, .news-card a svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.link-all:hover { color: var(--monte); }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.news-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .25s; }
.news-card:hover { transform: translateY(-4px); }
.news-card .cover { aspect-ratio: 16 / 10; display: grid; place-items: center; position: relative; overflow: hidden; }
.news-card .cover img { height: 100%; width: auto; max-width: none; object-fit: contain; }
.news-card .tag { position: absolute; top: .7rem; left: .7rem; background: var(--white); color: var(--navy); font: 800 .75rem var(--font-head); padding: .2rem .7rem; border-radius: 999px; }
.news-card .body { padding: 1.1rem 1.3rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.news-card h3 { font-size: 1.12rem; margin-bottom: .4rem; }
.news-card p { color: var(--text-soft); font-size: .95rem; flex: 1; }
.news-card time { font-size: .85rem; color: var(--text-soft); }
.news-card a { font: 800 .95rem var(--font-head); text-decoration: none; display: inline-flex; gap: .4rem; align-items: center; margin-top: .6rem; color: var(--monte); }
.news-card a:hover { color: var(--navy); }
.demo-note { margin: 1.5rem 0 0; font-size: .85rem; color: var(--text-soft); }

/* Footer */
.site-footer { background: var(--navy); color: var(--white); padding: 3rem 0 1.2rem; border-radius: 28px 28px 0 0; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 2rem; align-items: start; }
.foot-brand img { width: 170px; margin-bottom: 1rem; }
.slogan { font: 800 1.1rem var(--font-head); margin: 0; }
.site-footer li { margin-bottom: .4rem; }
.site-footer a { text-decoration: none; }
.site-footer nav a:hover { color: var(--yellow); }
.contact li { color: #e7ebf1; }
.social { display: flex; gap: .6rem; margin-top: 1rem; }
.social a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; transition: background .2s, color .2s; }
.social a:hover { background: var(--yellow); color: var(--navy); }
.social svg { width: 22px; height: 22px; fill: currentColor; }
.copy { text-align: center; font-size: .85rem; color: #c3cad5; margin: 2.2rem 1.25rem 0; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.15); }

/* Entrada suave (solo si hay JS) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s, transform .6s; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- 5. RESPONSIVO ---------- */
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .menu { position: absolute; top: 100%; left: 0; right: 0; background: var(--navy); border-top: 1px solid rgba(255,255,255,.12); display: none; padding: .5rem 1.25rem 1.2rem; }
  .menu.open { display: block; }
  .menu ul { flex-direction: column; gap: 0; }
  .menu a { display: inline-block; padding: .8rem 0; font-size: 1.05rem; }
  .hero-grid, .about-grid { grid-template-columns: 1fr; }
  .hero-art { min-height: 300px; margin-top: 1rem; }
  .blob { inset: 0 5% -7rem; }
  .lines-grid, .news-grid { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; }
  .card-line h3 { min-height: 0; }
  .foot-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .pillars-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .pillar + .pillar { border-left: 0; border-top: 1px solid #dde2e9; padding-top: 1.4rem; }
  .brand img { width: 140px; }
  :root { --header-h: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ===== AÑADIDOS: formularios, consentimiento, cookies y páginas legales ===== */
.small { font-size: .92rem; color: var(--text-soft); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn--sm { font-size: .9rem; padding: .55rem 1.2rem; min-height: 44px; }
.contact-sec { padding-top: 1rem; }

.contact-card { background: var(--cream); border-radius: 26px; padding: clamp(1.4rem, 3vw, 2.2rem); display: grid; grid-template-columns: 1fr 1.4fr; gap: 2rem; }
.contact-copy p { color: var(--text-soft); }
.field { display: grid; gap: .3rem; margin-bottom: .9rem; }
.f { font-weight: 700; font-size: .9rem; }
input:not([type=checkbox]), select, textarea { font: inherit; width: 100%; border: 2px solid #d5dbe4; border-radius: 12px; padding: .65rem .85rem; background: #fff; color: var(--navy); }
input:focus, select:focus, textarea:focus { border-color: var(--navy); outline: 3px solid var(--yellow); outline-offset: 1px; }
.hp { position: absolute; left: -9999px; }
.consent { border: 0; padding: 0; margin: 1rem 0; }
.consent legend { font: 800 .95rem var(--font-head); margin-bottom: .6rem; padding: 0; }
.consent label { display: flex; gap: .65rem; align-items: flex-start; font-size: .9rem; margin-bottom: .6rem; cursor: pointer; line-height: 1.4; }
.consent input { width: 22px; height: 22px; flex: none; margin: .05rem 0 0; accent-color: var(--navy); }
.consent .all { padding-top: .5rem; border-top: 1px dashed #c9d0db; }
.consent a, .docs-link { color: var(--monte); font-weight: 700; }
.form-status { margin: .8rem 0 0; font-weight: 700; min-height: 1.4em; }
.form-status.ok { color: var(--monte); } .form-status.err { color: #b3261e; }


.foot-legal { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.15); text-align: center; font-size: .85rem; color: #c9d0db; }
.foot-legal ul { display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem 1.1rem; }
.foot-legal a, .foot-legal button { color: #fff; font: inherit; background: none; border: 0; padding: .35rem 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.foot-legal a:hover, .foot-legal button:hover { color: var(--yellow); }
/* ---------- 6. COOKIES Y PÁGINAS LEGALES ---------- */
.cc { position: fixed; z-index: 90; left: 14px; right: 14px; bottom: 14px; max-width: 760px; margin-inline: auto; background: var(--navy); color: #fff; border-radius: 20px; padding: 1.1rem 1.3rem; box-shadow: 0 12px 40px rgba(0,0,0,.35); display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.cc p { margin: 0; font-size: .9rem; flex: 1 1 320px; }
.cc a { color: var(--yellow); }
.cc .acts { display: flex; gap: .5rem; flex-wrap: wrap; }
.cc .btn { padding: .55rem 1.1rem; min-height: 44px; font-size: .9rem; }
.cc .btn--ghost { color: #fff; border-color: #fff; }
.ccm { position: fixed; inset: 0; z-index: 95; background: rgba(20,28,40,.6); display: grid; place-items: center; padding: 1rem; }
.ccm-box { background: #fff; color: var(--navy); border-radius: 22px; padding: 1.5rem; width: min(100%, 560px); max-height: 90vh; overflow: auto; }
.ccm-box h2 { font-size: 1.4rem; }
.ccm-cat { border: 1px solid #dde2e9; border-radius: 14px; padding: .8rem 1rem; margin-bottom: .7rem; }
.ccm-cat label { display: flex; justify-content: space-between; gap: 1rem; font-weight: 800; font-family: var(--font-head); }
.ccm-cat input { width: 22px; height: 22px; accent-color: var(--navy); }
.ccm-cat p { margin: .3rem 0 0; font-size: .88rem; color: var(--text-soft); }

.legal-bar { background: var(--navy); }
.legal-bar .wrap { width: min(100% - 2rem, 1040px); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; min-height: 72px; }
.legal-bar img { width: 150px; }
.legal-bar a.back { color: #fff; font-weight: 700; text-decoration: none; }
.legal-bar a.back:hover { color: var(--yellow); }
.legal { width: min(100% - 2rem, 820px); margin: 2.5rem auto 3rem; }
.legal h1 { color: var(--navy); font-size: clamp(1.8rem, 4vw, 2.5rem); }
.legal h2 { font-size: 1.3rem; margin-top: 2rem; }
.legal h3 { font-size: 1.05rem; margin-top: 1.2rem; }
.legal p, .legal li { font-size: 1rem; }
.legal ul.l { list-style: disc; padding-left: 1.3rem; margin-bottom: 1em; }
.legal li { margin-bottom: .35rem; }
.legal .meta { color: var(--text-soft); font-size: .9rem; }
.legal table { width: 100%; border-collapse: collapse; font-size: .92rem; margin-bottom: 1.2rem; display: block; overflow-x: auto; }
.legal th, .legal td { border: 1px solid #d9dee6; padding: .5rem .7rem; text-align: left; vertical-align: top; }
.legal th { background: var(--cream); }
.ph { background: #FFF3C4; padding: 0 .25rem; border-radius: 4px; }
.draft { background: #FFF3C4; border-left: 5px solid var(--yellow); padding: .8rem 1rem; border-radius: 8px; font-size: .9rem; }
.doc-list { display: grid; gap: 1rem; margin: 1.5rem 0; }
.doc-card { border: 1px solid #d9dee6; border-radius: 16px; padding: 1.1rem 1.3rem; display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.doc-card h3 { margin: 0 0 .2rem; }
.doc-card p { margin: 0; font-size: .9rem; color: var(--text-soft); }


@media (max-width: 900px) { .contact-card { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .cc { flex-direction: column; align-items: stretch; } }
