:root {
  --ink: #182A22;
  --ink-soft: #24392F;
  --paper: #F1EFE1;
  --paper-white: #FBFAF3;
  --gold: #D6A231;
  --gold-dark: #A87A1B;
  --clay: #B5493A;
  --sage: #7C9082;
  --line: rgba(24, 42, 34, 0.15);
  --line-on-ink: rgba(241, 239, 225, 0.18);
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0 0 0.4em;
  font-weight: 600;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }

a { color: inherit; }

img { max-width: 100%; }

section[id] { scroll-margin-top: 24px; }

/* --- Marca "4 puntos": 4 círculos, el primero relleno --- */
.brand-dots { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; }
.bd {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  flex: none;
}
.bd-fill { background: var(--gold); border-color: var(--gold); }
.brand-dots-sm .bd { width: 9px; height: 9px; }
.brand-dots-xs { gap: 2px; }
.brand-dots-xs .bd { width: 8px; height: 8px; }
.brand-dots-md { gap: 4px; }
.brand-dots-md .bd { width: 14px; height: 14px; }
.brand-dots-lg { gap: 6px; }
.brand-dots-lg .bd { width: 15px; height: 15px; }
.brand-dots-hero { gap: 12px; margin-bottom: 18px; }
.brand-dots-hero .bd { width: 44px; height: 44px; border-width: 3px; }

/* --- Nav --- */
.nav {
  background: var(--ink);
  color: var(--paper-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 40px);
  flex-wrap: wrap;
  gap: 12px;
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  text-decoration: none;
  color: var(--paper-white);
  white-space: nowrap;
}
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a {
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--paper-white);
  border-bottom: 1.5px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.15s ease;
}
.nav-links a:hover { border-color: var(--gold); }
.nav-links a.nav-cta {
  background: var(--gold);
  color: var(--ink);
  padding: 11px 16px;
  border-radius: 3px;
  border-bottom: none;
  transition: background 0.15s ease;
}
.nav-links a.nav-cta:hover { background: var(--gold-dark); }

/* --- Flash messages --- */
.flash-wrap { max-width: 680px; margin: 20px auto 0; padding: 0 24px; }
.flash {
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 0.92rem;
  border: 1px solid var(--line);
}
.flash-ok { background: #E7EEE4; border-color: var(--sage); color: var(--ink-soft); }
.flash-error { background: #F5E5E1; border-color: var(--clay); color: #7A2C20; }

/* --- Layout helpers --- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 40px); }
.section { padding: 72px 40px; }
.section-narrow { max-width: 680px; margin: 0 auto; }
.section-wide { max-width: 1080px; margin: 0 auto; }
.eyebrow-free { margin-top: 0; }

.block { padding: clamp(56px, 8vw, 96px) 0; }
.block-tight { padding-top: 0; }
.block-rule { border-bottom: 1px solid var(--line); }

.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-dark);
  margin: 0 0 14px;
}
.eyebrow-gold { color: var(--gold); }
.text-lg { font-size: 19px; }
.text-soft { color: var(--ink-soft); }
.block h2 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.08; }
.h2-narrow { max-width: 22ch; }
.block h2.h2-big { font-size: clamp(34px, 4.4vw, 56px); font-weight: 700; max-width: 16ch; }
.intro { max-width: 62ch; }

/* --- Botones --- */
.btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: 3px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: var(--ink); font-weight: 700; }
.btn-gold:hover { background: var(--gold-dark); }
.btn-outline { background: transparent; color: var(--paper-white); border-color: rgba(241, 239, 225, 0.45); }
.btn-outline:hover { border-color: var(--gold); }
.btn-ink { background: var(--ink); color: var(--paper-white); }
.btn-ink:hover { background: var(--ink-soft); }
.btn-outline-ink { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline-ink:hover { background: var(--paper); }
.btn-block { display: block; width: 100%; text-align: center; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 12px 28px;
  font-size: 19px;
}

/* --- Hero --- */
.hero {
  background: var(--ink);
  color: var(--paper-white);
  padding: clamp(40px, 6vw, 88px) 0 clamp(48px, 6vw, 96px);
}
.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: clamp(36px, 6vw, 72px);
  align-items: center;
}
.hero h1 {
  font-weight: 700;
  font-size: clamp(40px, 5.2vw, 66px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 14ch;
}
.lede {
  font-size: clamp(19px, 1.6vw, 22px);
  color: rgba(251, 250, 243, 0.88);
  max-width: 42ch;
}
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-actions .btn { flex: 1 1 220px; }
.hero-card-wrap { display: flex; justify-content: center; padding: 16px 0; }

.member-card {
  width: min(100%, 440px);
  aspect-ratio: 1.586;
  background: var(--paper);
  color: var(--ink);
  border-radius: 14px;
  padding: 28px 30px;
  transform: rotate(-4deg);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.member-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.member-card-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
}
.member-card-qr { width: 68px; height: 68px; border-radius: 4px; flex: none; }
.member-card-name { font-family: var(--font-display); font-weight: 600; font-size: 21px; margin-bottom: 4px; }
.member-card-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.member-card-code { font-family: var(--font-display); letter-spacing: 0.08em; font-size: 16px; color: var(--ink-soft); }
.member-card-club { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--sage); }

/* --- Entradas por público --- */
.entries { margin-top: -28px; position: relative; }
.entries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 12px;
}
.entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 16px 22px;
  border-radius: 6px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(24, 42, 34, 0.18);
  transition: background 0.15s ease;
}
.entry strong { display: block; font-family: var(--font-display); font-weight: 600; font-size: 20px; }
.entry small { display: block; font-size: 15px; }
.entry-arrow { font-size: 26px; flex: none; }
.entry-gold { background: var(--gold); color: var(--ink); }
.entry-gold:hover { background: var(--gold-dark); }
.entry-ink { background: var(--paper-white); color: var(--ink); border: 1.5px solid var(--ink); }
.entry-ink:hover { background: var(--paper); }
.entry-soft { background: var(--paper-white); color: var(--ink); border: 1px solid rgba(24, 42, 34, 0.2); }
.entry-soft:hover { background: var(--paper); }

/* --- Cómo funciona --- */
.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: clamp(28px, 5vw, 64px);
}
.how-steps { list-style: none; margin: 0; padding: 0; }
.how-steps li {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 16px;
  align-items: center;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  font-size: 19px;
}
.how-steps li:last-child { border-bottom: 1px solid var(--line); }
.how-steps strong { font-family: var(--font-display); font-weight: 600; }
.how-note { font-size: 16px; margin: 18px 0 0; }

/* --- Circuito del dinero --- */
.circuit {
  background: var(--ink);
  color: var(--paper-white);
  border-radius: 10px;
  padding: clamp(28px, 5vw, 56px);
  text-align: center;
}
.block .circuit h2 { font-size: clamp(28px, 3.4vw, 40px); margin-bottom: 32px; }
.circuit-diagram {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: start;
  gap: 8px;
  max-width: 760px;
  margin: 0 auto 32px;
}
.circuit-node { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.circuit-dot {
  width: clamp(44px, 6vw, 68px);
  height: clamp(44px, 6vw, 68px);
  border-radius: 50%;
  border: 2px solid var(--paper-white);
  margin-bottom: 10px;
}
.circuit-dot-fill { background: var(--gold); border-color: var(--gold); }
.circuit-label { font-family: var(--font-display); font-weight: 600; font-size: clamp(15px, 1.7vw, 21px); }
.circuit-sub { font-size: clamp(13px, 1.3vw, 16px); color: rgba(251, 250, 243, 0.75); }
.circuit-arrow {
  color: var(--gold);
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1;
  margin-top: calc(clamp(44px, 6vw, 68px) / 2 - 0.5em);
}
.circuit-close { font-size: clamp(17px, 1.5vw, 20px); max-width: 52ch; margin: 0 auto; }

/* --- Dos patas --- */
.legs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 20px;
  margin-top: 36px;
}
.leg {
  background: var(--paper-white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(24px, 3vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.leg h3 { font-size: clamp(24px, 2.4vw, 30px); line-height: 1.15; margin: 0; }
.chip-leg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.chip-leg .bd { width: 14px; height: 14px; }
.list-hollow { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 18px; }
.list-hollow li { position: relative; padding-left: 24px; }
.list-hollow li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
}
.list-hollow strong { font-family: var(--font-display); font-weight: 600; }
.callout {
  margin-top: auto;
  background: var(--paper);
  border-radius: 6px;
  padding: 18px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 17px;
}
.callout .brand-dots { margin-top: 8px; color: var(--ink); }
.callout p { margin: 0; }

/* --- Tiendas --- */
.stores-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}
.stores-head p { max-width: 60ch; margin-bottom: 0; }
.link-gold {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 2px;
  white-space: nowrap;
  min-height: 48px;
  display: inline-flex;
  align-items: flex-end;
}
.link-gold:hover { color: var(--gold-dark); }
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin-top: 36px;
}
.store-card {
  background: var(--paper-white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.store-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.store-card h3 { font-size: 22px; margin: 0; }
.store-tag {
  font-size: 13px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 11px;
  white-space: nowrap;
  color: var(--ink-soft);
  flex: none;
}
.store-address { color: var(--ink-soft); font-size: 17px; }
.store-ratio { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.store-ratio .bd { width: 10px; height: 10px; }
.store-discounts {
  list-style: none;
  padding: 12px 0 0;
  margin: 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.store-discounts li { display: flex; justify-content: space-between; gap: 12px; font-size: 17px; }
.store-discounts .cost { font-family: var(--font-display); font-weight: 700; color: var(--gold-dark); white-space: nowrap; }
.store-map {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
}
.store-map:hover { color: var(--gold-dark); }
.store-card-next {
  background: transparent;
  border: 1.5px dashed rgba(24, 42, 34, 0.3);
  justify-content: center;
}
.store-card-next .brand-dots { margin-bottom: 6px; }
.store-card-next p { margin: 0; }
.store-card-next .store-map { margin-top: 4px; }

/* --- Foto del pueblo --- */
.town-photo {
  margin: 0;
  height: clamp(240px, 40vw, 460px);
  border-radius: 10px;
  overflow: hidden;
  background: var(--sage);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.town-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.town-photo figcaption {
  position: absolute;
  inset: auto 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--paper-white);
  padding: 10px;
}

/* --- Para tenderos (banda tinta) --- */
.band-ink { background: var(--ink); color: var(--paper-white); }
.band-ink .lede { color: rgba(251, 250, 243, 0.85); font-size: 19px; }
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(24px, 4vw, 56px);
  margin-top: 32px;
}
.h3-gold { color: var(--gold); font-size: 22px; }
.list-ink { list-style: none; margin: 0; padding: 0; font-size: 18px; }
.list-ink li {
  position: relative;
  padding: 14px 0 14px 26px;
  border-top: 1px solid rgba(241, 239, 225, 0.18);
}
.list-ink li::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(14px + 0.45em);
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.list-ink-hollow li::before { border: 1.5px solid var(--paper-white); }
.list-ink-fill li::before { background: var(--gold); }
.list-ink strong { font-family: var(--font-display); font-weight: 600; }
.shop-cta {
  margin-top: 44px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 16px;
  color: rgba(251, 250, 243, 0.75);
}

/* --- Instituciones --- */
.inst-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.inst-grid .btn { margin-top: 8px; min-height: 56px; }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.figure {
  background: var(--paper-white);
  border-radius: 8px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.figure-num { font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 4vw, 54px); line-height: 1; }
.figure-label { font-size: 16px; color: var(--ink-soft); }

/* --- Hazte socio --- */
.join-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin-top: 36px;
}
.join {
  background: var(--paper-white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.join h3 { font-size: 23px; margin: 0; line-height: 1.15; }
.join p { font-size: 17px; color: var(--ink-soft); margin: 0; }
.join .btn, .join .store-map { margin-top: auto; }
.join .btn { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }
.kicker {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-dark);
}
.kicker-gold { color: var(--gold); }
.join-ink { background: var(--ink); color: var(--paper-white); border-color: var(--ink); }
.join-form { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.join-form label { font-size: 15px; color: rgba(251, 250, 243, 0.8); }
.join-form input {
  min-height: 52px;
  padding: 10px 14px;
  background: var(--paper-white);
  color: var(--ink);
  border: 1px solid rgba(241, 239, 225, 0.3);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 18px;
  margin-bottom: 6px;
}
.join-form .btn { min-height: 56px; margin-top: 4px; }
.join-done {
  background: var(--sage);
  color: var(--ink);
  border-radius: 6px;
  padding: 18px 20px;
  font-size: 17px;
  margin-top: 6px;
}
.join-done strong { font-family: var(--font-display); }

/* --- Cards / forms (portales) --- */
.card {
  background: var(--paper-white);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 32px;
}
.card + .card { margin-top: 20px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input, .field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  background: #fff;
}
.field input:focus, .field select:focus, .join-form input:focus, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold-dark);
  outline-offset: 1px;
}

.balance {
  font-family: var(--font-display);
  font-size: 3.4rem;
  font-weight: 700;
  line-height: 1;
}
.balance-label { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 8px; }
.card-code {
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 6px 12px;
  display: inline-block;
  margin-top: 8px;
}

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--ink-soft); font-weight: 500; font-size: 0.8rem; }
td.num, th.num { text-align: right; }

.discount-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.discount-row:last-child { border-bottom: none; }
.discount-cost { font-size: 0.82rem; color: var(--gold-dark); font-weight: 600; }

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 28px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin: 28px 0 40px;
}
.stat { border: 1px solid var(--line); border-radius: 6px; padding: 20px; background: var(--paper-white); }
.stat-num { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; }
.stat-label { font-size: 0.82rem; color: var(--ink-soft); }

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--line);
  padding: 28px clamp(20px, 5vw, 40px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 16px;
  color: var(--ink-soft);
}
.footer-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { text-decoration: none; font-family: var(--font-display); font-weight: 500; }
.footer-links a:hover { color: var(--gold-dark); }

/* --- Responsive --- */
@media (max-width: 820px) {
  .two-col { grid-template-columns: 1fr; }
  .section { padding: 56px 20px; }
}

@media (max-width: 700px) {
  .hero-actions .btn { flex-basis: 100%; }
  .nav-links { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
