/* ClanSingular.com — web pública
   Paleta y tipografía tomadas de la identidad global de la aplicación
   (lib/brand.ts + app/globals.css). Mantener sincronizados ambos lados. */

:root {
  --ink: #172d29;
  --primary: #18342f;
  --secondary: #326658;
  --gold: #e8bd64;
  --paper: #fffefa;
  --cream: #f7f4eb;
  --sage: #dce9d9;
  --muted: #647873;
  --line: rgba(24, 52, 47, 0.13);
  --radius: 20px;
  --shadow: 0 22px 70px rgba(29, 56, 48, 0.09);
  --header-h: 74px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(232, 189, 100, 0.18), transparent 28rem),
    radial-gradient(circle at 94% 18%, rgba(151, 195, 174, 0.26), transparent 32rem),
    var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}

body.menu-open { overflow: hidden; }

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin: 0;
}

p { margin: 0; }
a { color: var(--secondary); }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: white;
  padding: 12px 18px;
  border-radius: 0 0 12px 0;
  z-index: 60;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 2px;
  border-radius: 6px;
}

.shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

/* ---------- Barra superior ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 244, 235, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--header-h);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: inherit;
  flex: 0 0 auto;
}
.brand-mark { width: 44px; height: 44px; object-fit: contain; }
.brand-text strong { display: block; font-weight: 750; letter-spacing: -0.01em; line-height: 1.15; }
.brand-text small { display: block; color: var(--muted); font-size: 0.74rem; }

.nav { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--gold); }
.nav .nav-app { display: none; }

.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: 0 0 auto; }

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 254, 250, 0.8);
  cursor: pointer;
  padding: 0;
}
.menu-bars { display: grid; gap: 5px; justify-items: center; }
.menu-bars i {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform 180ms ease, opacity 140ms ease;
}
[aria-expanded="true"] .menu-bars i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
[aria-expanded="true"] .menu-bars i:nth-child(2) { opacity: 0; }
[aria-expanded="true"] .menu-bars i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.94rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-lg { padding: 15px 28px; font-size: 1rem; }
.btn-solid { background: var(--primary); color: var(--paper); box-shadow: 0 10px 28px rgba(24, 52, 47, 0.22); }
.btn-solid:hover { background: #122a26; }
.btn-outline { border-color: rgba(24, 52, 47, 0.28); color: var(--primary); background: rgba(255, 254, 250, 0.7); }
.btn-outline:hover { border-color: var(--secondary); }
.btn-ghost { color: var(--primary); background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(255, 254, 250, 0.8); border-color: var(--line); }
.btn-gold { background: var(--gold); color: var(--primary); box-shadow: 0 12px 30px rgba(232, 189, 100, 0.35); }
.btn-quiet { color: var(--paper); border-color: rgba(255, 254, 250, 0.4); }
.btn-quiet:hover { background: rgba(255, 254, 250, 0.12); }

/* ---------- Textos comunes ---------- */

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--secondary);
}
.eyebrow.muted { color: #7a8c87; }
.prose { color: #43574f; }
.prose + .prose { margin-top: 14px; }
.prose.small { font-size: 0.92rem; color: var(--muted); }

/* ---------- Hero ---------- */

.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 64px); text-align: center; }
.hero h1 { margin: 16px auto 18px; font-size: clamp(2.5rem, 7vw, 4.6rem); max-width: 16ch; }
.hero .lead {
  margin: 0 auto;
  max-width: 62ch;
  font-size: clamp(1.02rem, 2.2vw, 1.18rem);
  color: #43574f;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.hero-note { margin-top: 18px; color: var(--muted); font-size: 0.88rem; }

.trust {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 48px 0 0;
  padding: 0;
}
.trust li {
  background: rgba(255, 254, 250, 0.82);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 16px;
  text-align: left;
}
.trust strong { display: block; font-size: 1.02rem; }
.trust span { display: block; color: var(--muted); font-size: 0.84rem; margin-top: 2px; }

/* ---------- Secciones ---------- */

.section { padding: clamp(52px, 8vw, 92px) 0; }
.section.alt { background: rgba(255, 254, 250, 0.6); border-block: 1px solid var(--line); }
.band { padding: clamp(44px, 6vw, 72px) 0; }
.manifesto { background: rgba(220, 233, 217, 0.28); border-block: 1px solid var(--line); }

.section-head { max-width: 62ch; margin-bottom: 40px; }
.section-head h2, .split h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); margin-top: 10px; }
.section-sub { margin-top: 14px; color: var(--muted); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.split .prose { margin-top: 18px; }

/* ---------- Pilares ---------- */

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pillar {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 30px 28px 32px;
  box-shadow: 0 14px 44px rgba(29, 56, 48, 0.06);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.pillar:hover { transform: translateY(-3px); border-color: rgba(50, 102, 88, 0.35); box-shadow: var(--shadow); }
.pillar-tag {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--sage);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.pillar h3 { font-size: 1.42rem; margin-bottom: 12px; }
.pillar > p { color: #4c5f58; font-size: 0.96rem; }
.pillar ul { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.pillar li {
  position: relative;
  padding-left: 24px;
  font-size: 0.93rem;
  color: #43574f;
}
.pillar li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

/* ---------- Pasos ---------- */

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.steps.six { grid-template-columns: repeat(3, 1fr); }
.steps li {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px 26px;
  box-shadow: 0 12px 40px rgba(29, 56, 48, 0.05);
}
.step-n {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--sage);
  color: var(--primary);
  font-family: Georgia, serif;
  font-size: 1.05rem;
  margin-bottom: 16px;
}
.steps h3 { font-size: 1.2rem; margin-bottom: 8px; }
.steps p { color: #4c5f58; font-size: 0.94rem; }

/* ---------- Tarjetas ---------- */

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.card:hover { transform: translateY(-3px); border-color: rgba(50, 102, 88, 0.35); box-shadow: var(--shadow); }
.card h3 { font-size: 1.14rem; margin-bottom: 10px; }
.card p { color: #4c5f58; font-size: 0.93rem; }

/* ---------- Niveles e intereses ---------- */

.levels {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.levels span {
  border: 1px solid var(--line);
  background: rgba(220, 233, 217, 0.4);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.9rem;
  font-weight: 550;
}
.levels-note { flex-basis: 100%; margin-top: 8px; color: var(--muted); font-size: 0.82rem; }

.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chips span {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 0.96rem;
  font-weight: 550;
}
.chips span:nth-child(3n) { background: rgba(232, 189, 100, 0.18); }
.chips-note { margin-top: 26px; color: var(--muted); max-width: 70ch; font-size: 0.95rem; }

/* ---------- Para quién ---------- */

.audience { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.audience article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  background: rgba(255, 254, 250, 0.75);
}
.audience h3 { font-size: 1.16rem; margin-bottom: 8px; }
.audience p { color: #4c5f58; font-size: 0.93rem; }

/* ---------- Checklist ---------- */

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.checklist li { position: relative; padding-left: 30px; }
.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sage);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 3px;
}

/* ---------- Postulación ---------- */

.apply { background: rgba(220, 233, 217, 0.3); border-block: 1px solid var(--line); }
.apply-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(28px, 5vw, 60px);
  align-items: start;
}
.form {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: clamp(24px, 3.5vw, 36px);
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
}
.field { display: grid; gap: 7px; }
.field-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.field label { font-size: 0.88rem; font-weight: 650; }
.field small { color: var(--muted); font-size: 0.8rem; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(50, 102, 88, 0.16);
}
.field [aria-invalid="true"] { border-color: #b3453a; }

.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.consent { display: flex; gap: 11px; align-items: flex-start; font-size: 0.9rem; color: #43574f; }
.consent input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--secondary); }

.form .btn { width: 100%; }
.form-status { font-size: 0.9rem; min-height: 1.2em; }
.form-status.error { color: #b3453a; }
.form-status.ok { color: var(--secondary); font-weight: 600; }
.form-legal { color: var(--muted); font-size: 0.8rem; }

/* ---------- Preguntas ---------- */

.faq { display: grid; gap: 10px; max-width: 78ch; }
.faq details {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px 20px;
}
.faq summary {
  cursor: pointer;
  padding: 14px 0;
  font-weight: 650;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--secondary); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 0 16px; color: #4c5f58; font-size: 0.96rem; }

.beta-note {
  margin-top: 26px;
  max-width: 78ch;
  color: var(--muted);
  font-size: 0.88rem;
  border-left: 3px solid var(--gold);
  padding-left: 16px;
}

/* ---------- Cierre y pie ---------- */

.closing {
  background: var(--primary);
  color: var(--paper);
  text-align: center;
  padding: clamp(56px, 8vw, 92px) 0;
}
.closing h2 { font-size: clamp(2rem, 5vw, 3.2rem); }
.closing > .shell > p { margin-top: 14px; color: rgba(255, 254, 250, 0.78); }

.footer { padding: 44px 0 56px; }
.footer-inner { display: grid; gap: 20px; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img { width: 40px; height: 40px; object-fit: contain; }
.footer-brand p { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.footer nav a { color: var(--ink); text-decoration: none; font-size: 0.9rem; border-bottom: 1px solid var(--line); }
.footer nav a:hover { border-bottom-color: var(--secondary); }
.copyright { color: var(--muted); font-size: 0.82rem; }

/* ---------- Adaptación ---------- */

@media (max-width: 1080px) {
  .trust, .cards, .audience { grid-template-columns: repeat(2, 1fr); }
  .pillars { grid-template-columns: 1fr; }
  .steps, .steps.six { grid-template-columns: repeat(2, 1fr); }
  .split, .apply-grid { grid-template-columns: 1fr; }

  /* Menú desplegable bajo la barra fija */
  .nav {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--header-h);
    display: block;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    padding: 8px 20px 26px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px rgba(29, 56, 48, 0.14);
    transform: translateY(-14px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
  }
  .nav.open { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav a {
    display: block;
    padding: 15px 4px;
    font-size: 1.02rem;
    font-weight: 600;
    border-bottom: 1px solid var(--line);
  }
  .nav a:hover { border-bottom-color: var(--line); }
  .nav .nav-app { display: block; color: var(--secondary); border-bottom: none; }
  .menu-toggle { display: grid; place-items: center; }
  .hide-sm { display: none; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .shell { width: calc(100% - 32px); }
  :root { --header-h: 66px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-text small { display: none; }
  .topbar-actions .btn { padding: 10px 16px; font-size: 0.88rem; }
  .menu-toggle { width: 42px; height: 42px; }
  .trust, .cards, .audience, .steps, .steps.six { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
  .chips span { padding: 10px 18px; font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .btn:hover, .card:hover, .pillar:hover { transform: none; }
}
