:root {
  --ink: #17312e;
  --ink-soft: #36504c;
  --muted: #687a76;
  --paper: #ffffff;
  --canvas: #f5f7f3;
  --canvas-warm: #fbf9f3;
  --line: #dce5e1;
  --primary: #164b45;
  --primary-dark: #0c3733;
  --primary-light: #2b6c64;
  --teal-soft: #dff1ec;
  --coral: #ef6c50;
  --coral-soft: #ffe7df;
  --yellow: #efbd53;
  --yellow-soft: #fff3d2;
  --success: #277a5b;
  --danger: #a43e35;
  --danger-soft: #fff0ed;
  --shadow-sm: 0 8px 24px rgba(20, 59, 54, .08);
  --shadow-md: 0 22px 60px rgba(20, 59, 54, .13);
  --radius-sm: .75rem;
  --radius-md: 1.25rem;
  --radius-lg: 2rem;
  --max-width: 1180px;
}

* { box-sizing: border-box; }

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Aptos", "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

main { flex: 1; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.container {
  width: min(var(--max-width), calc(100% - 2.5rem));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 100;
  padding: .75rem 1rem;
  background: var(--paper);
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.skip-link:focus { top: 1rem; }

:focus-visible {
  outline: 3px solid rgba(239, 108, 80, .45);
  outline-offset: 3px;
}

h1, h2, h3, p { text-wrap: pretty; }

h1, h2, h3 {
  margin-top: 0;
  color: var(--primary-dark);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(22, 75, 69, .1);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px);
}

.header-inner {
  min-height: 5.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  color: var(--primary-dark);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 3rem;
  height: 3rem;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 1rem;
  background: var(--primary);
  color: var(--paper);
  box-shadow: 0 8px 20px rgba(22, 75, 69, .2);
}

.brand-mark svg { width: 2.2rem; height: 2.2rem; stroke-width: 2.2; }

.brand-copy {
  display: grid;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 1rem;
  letter-spacing: -.01em;
}

.brand-copy small {
  margin-top: .3rem;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 1 1 40rem;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-actions form { margin: 0; }

.nav-link, .location-label {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem .7rem;
  border-radius: .75rem;
  color: var(--ink-soft);
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-link:hover { background: var(--teal-soft); color: var(--primary-dark); }
.nav-link svg, .location-label svg { width: 1.15rem; height: 1.15rem; }
.location-label { color: var(--muted); }

.link-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem .85rem;
  border-radius: .75rem;
  background: var(--teal-soft);
  color: var(--primary-dark);
  font-weight: 700;
  user-select: none;
  transition: background .2s ease, color .2s ease;
}

.dropdown-toggle::-webkit-details-marker {
  display: none;
}

.dropdown-toggle:hover,
.nav-dropdown[open] .dropdown-toggle {
  background: var(--primary);
  color: var(--paper);
}

.chevron-icon {
  width: .9rem !important;
  height: .9rem !important;
  stroke-width: 2.5;
  transition: transform .2s ease;
}

.nav-dropdown[open] .chevron-icon {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  min-width: 16.5rem;
  padding: .5rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--paper);
  box-shadow: 0 18px 42px rgba(20, 59, 54, .16);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  animation: dropdownFade .18s ease-out;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
  padding: .4rem .75rem .25rem;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid var(--line);
  margin-bottom: .25rem;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem .85rem;
  border-radius: .6rem;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.dropdown-item:hover {
  background: var(--teal-soft);
  color: var(--primary-dark);
}

.dropdown-item svg {
  width: 1.15rem;
  height: 1.15rem;
  color: var(--primary);
  flex-shrink: 0;
}

.organization-chip {
  max-width: 18rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .45rem .75rem .45rem .5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.organization-chip > span:first-child {
  width: 2rem;
  height: 2rem;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--coral-soft);
  color: #a33e2c;
  font-size: .78rem;
  font-weight: 800;
}

.organization-copy {
  min-width: 0;
  display: grid;
  line-height: 1.15;
}

.organization-copy small {
  color: var(--muted);
  font-size: .65rem;
  text-transform: uppercase;
}

.organization-copy strong {
  overflow: hidden;
  font-size: .76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button {
  min-height: 3.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  padding: .75rem 1.25rem;
  border: 1px solid transparent;
  border-radius: .9rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.button svg { width: 1.15rem; height: 1.15rem; stroke-width: 2.2; }
.button:hover { transform: translateY(-2px); }

.button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--paper);
  box-shadow: 0 12px 25px rgba(22, 75, 69, .19);
}

.button.primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 15px 30px rgba(22, 75, 69, .25);
}

.button.secondary {
  border-color: var(--line);
  background: var(--paper);
  color: var(--primary);
}

.button.secondary:hover {
  border-color: var(--primary);
  background: var(--teal-soft);
}

.button-small {
  min-height: 2.65rem;
  padding: .55rem 1rem;
  border-radius: .75rem;
  font-size: .88rem;
}

.button-full { width: 100%; }

.eyebrow {
  margin: 0 0 .9rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  color: var(--primary-light);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.eyebrow > span {
  width: 1.75rem;
  height: 2px;
  border-radius: 2px;
  background: var(--coral);
}

.eyebrow.light { color: #b9d9d3; }
.eyebrow.light > span { background: var(--yellow); }

/* Portada */

.hero {
  position: relative;
  padding: clamp(4rem, 8vw, 7.5rem) 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 20%, rgba(223, 241, 236, .9), transparent 30%),
    radial-gradient(circle at 87% 10%, rgba(255, 231, 223, .75), transparent 26%),
    var(--canvas-warm);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .35;
  background-image: radial-gradient(rgba(22, 75, 69, .16) .7px, transparent .7px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to right, black, transparent 48%);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(25rem, .9fr);
  align-items: center;
  gap: clamp(3rem, 7vw, 7rem);
}

.hero-copy h1 {
  max-width: 12ch;
  margin-bottom: 1.5rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.25rem, 6.5vw, 5.8rem);
  font-weight: 500;
}

.hero-copy h1 em {
  position: relative;
  color: var(--coral);
  font-weight: 500;
}

.hero-copy h1 em::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -.13em;
  left: 0;
  height: .14em;
  border-radius: 50%;
  background: var(--yellow);
  transform: rotate(-2deg);
}

.lead {
  max-width: 38rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  margin-top: 2rem;
}

.text-link {
  color: var(--primary);
  font-weight: 800;
  text-underline-offset: .25rem;
}

.trust-line {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-top: 2.2rem;
  color: var(--muted);
  font-size: .84rem;
}

.avatar-stack { display: flex; padding-left: .4rem; }

.avatar-stack i {
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  margin-left: -.4rem;
  border: 3px solid var(--canvas-warm);
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--primary);
  font-size: .62rem;
  font-style: normal;
  font-weight: 800;
}

.avatar-stack i:nth-child(2) { background: var(--coral-soft); color: #a33e2c; }
.avatar-stack i:nth-child(3) { background: var(--yellow-soft); color: #866018; }

.community-visual {
  position: relative;
  min-height: 32rem;
  isolation: isolate;
}

.visual-glow {
  position: absolute;
  top: 8%;
  right: 3%;
  bottom: 8%;
  left: 3%;
  z-index: -2;
  border-radius: 45% 55% 52% 48%;
  background: linear-gradient(145deg, var(--teal-soft), #c7e7df);
  transform: rotate(-5deg);
}

.community-visual::before {
  content: "";
  position: absolute;
  top: 4%;
  right: 0;
  width: 5.5rem;
  height: 5.5rem;
  z-index: -1;
  border-radius: 50%;
  background: var(--yellow);
  opacity: .9;
}

.community-visual::after {
  content: "";
  position: absolute;
  bottom: 4%;
  left: 0;
  width: 4rem;
  height: 4rem;
  z-index: -1;
  border: .8rem solid var(--coral);
  border-radius: 50%;
  opacity: .85;
}

.orbit {
  position: absolute;
  border: 1px dashed rgba(22, 75, 69, .24);
  border-radius: 50%;
}

.orbit-one { inset: 12% 12%; transform: rotate(18deg); }
.orbit-two { inset: 23% 22%; transform: rotate(-12deg); }

.community-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10.5rem;
  height: 10.5rem;
  display: grid;
  place-content: center;
  place-items: center;
  border: .65rem solid rgba(255, 255, 255, .75);
  border-radius: 50%;
  background: var(--primary);
  color: var(--paper);
  box-shadow: var(--shadow-md);
  transform: translate(-50%, -50%);
}

.community-center svg { width: 2.4rem; height: 2.4rem; margin-bottom: .4rem; color: var(--yellow); }
.community-center strong { font-family: Georgia, serif; font-size: 1.3rem; }
.community-center span { color: #c9e1dc; font-size: .75rem; }

.person-bubble {
  position: absolute;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .45rem .7rem .45rem .45rem;
  border: 1px solid rgba(22, 75, 69, .08);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow-sm);
  color: var(--ink-soft);
  font-size: .72rem;
  font-weight: 700;
}

.person-bubble span {
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: .64rem;
  font-weight: 900;
}

.person-one { top: 13%; left: 4%; }
.person-one span { background: var(--coral-soft); color: #a33e2c; }
.person-two { top: 18%; right: -2%; }
.person-two span { background: var(--yellow-soft); color: #866018; }
.person-three { right: 2%; bottom: 20%; }
.person-three span { background: var(--paper); color: var(--primary); box-shadow: inset 0 0 0 1px var(--line); }

.exchange-card {
  position: absolute;
  bottom: 6%;
  left: 8%;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .8rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-md);
}

.exchange-icon {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: .8rem;
  background: var(--teal-soft);
  color: var(--primary);
}

.exchange-icon svg { width: 1.35rem; height: 1.35rem; }
.exchange-card > span:nth-child(2) { display: grid; line-height: 1.25; }
.exchange-card small { color: var(--muted); font-size: .64rem; }
.exchange-card strong { font-size: .78rem; }

.exchange-card i {
  width: 1.65rem;
  height: 1.65rem;
  display: grid;
  place-items: center;
  margin-left: .75rem;
  border-radius: 50%;
  background: var(--success);
  color: var(--paper);
  font-size: .72rem;
  font-style: normal;
}

.section { padding: clamp(4rem, 8vw, 7rem) 0; }

.section-heading { max-width: 47rem; }
.section-heading.centered { margin-inline: auto; text-align: center; }
.section-heading.centered .eyebrow { justify-content: center; }

.section-heading h2, .steps-copy h2 {
  margin-bottom: 1.1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 4.5vw, 4rem);
  font-weight: 500;
}

.section-heading > p:last-child {
  max-width: 42rem;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.05rem;
}

.value-section { background: var(--paper); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 3rem;
}

.feature-grid article {
  position: relative;
  min-height: 20rem;
  padding: 1.75rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--canvas-warm);
  transition: transform .25s ease, box-shadow .25s ease;
}

.feature-grid article:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-5px);
}

.feature-icon, .metric-icon {
  width: 3.4rem;
  height: 3.4rem;
  display: grid;
  place-items: center;
  border-radius: 1rem;
}

.feature-icon svg { width: 1.65rem; height: 1.65rem; }
.feature-icon.coral, .metric-icon.coral { background: var(--coral-soft); color: #a33e2c; }
.feature-icon.teal, .metric-icon.teal { background: var(--teal-soft); color: var(--primary); }
.feature-icon.yellow, .metric-icon.yellow { background: var(--yellow-soft); color: #866018; }

.feature-number {
  position: absolute;
  top: 1.8rem;
  right: 1.8rem;
  color: #b1bbb7;
  font-family: Georgia, serif;
  font-size: 1.2rem;
}

.feature-grid h3 {
  margin: 3.2rem 0 .75rem;
  font-size: 1.45rem;
  letter-spacing: -.02em;
}

.feature-grid p { margin: 0; color: var(--muted); }

.steps-section {
  position: relative;
  overflow: hidden;
  background: var(--primary-dark);
  color: var(--paper);
}

.steps-section::after {
  content: "";
  position: absolute;
  top: -8rem;
  right: -8rem;
  width: 26rem;
  height: 26rem;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 50%;
  box-shadow: 0 0 0 5rem rgba(255, 255, 255, .025), 0 0 0 10rem rgba(255, 255, 255, .02);
}

.steps-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(25rem, 1fr);
  align-items: center;
  gap: clamp(3rem, 8vw, 8rem);
}

.steps-copy h2 { color: var(--paper); }
.steps-copy > p:last-child { color: #b9d0cc; }

.steps-list {
  margin: 0;
  padding: 0;
  display: grid;
  list-style: none;
}

.steps-list li {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: 1rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.steps-list li:last-child { border-bottom: 0; }

.steps-list > li > span {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: var(--yellow);
  font-family: Georgia, serif;
  font-size: 1.1rem;
}

.steps-list div { display: grid; }
.steps-list strong { font-size: 1.05rem; }
.steps-list small { margin-top: .25rem; color: #b9d0cc; font-size: .87rem; }

/* Acceso */

.auth-page .site-footer { display: none; }

.auth-section {
  min-height: calc(100vh - 5.25rem);
  display: grid;
  align-items: center;
  padding: 3rem 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(239, 189, 83, .18), transparent 30%),
    radial-gradient(circle at 85% 80%, rgba(239, 108, 80, .2), transparent 25%),
    var(--primary-dark);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(22rem, 29rem);
  align-items: center;
  gap: clamp(3rem, 9vw, 9rem);
}

.auth-welcome { color: var(--paper); }

.auth-welcome h1 {
  max-width: 12ch;
  margin-bottom: 1.25rem;
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 5vw, 4.8rem);
  font-weight: 500;
}

.auth-welcome > p:not(.eyebrow) { max-width: 34rem; color: #c4d8d4; font-size: 1.05rem; }

.auth-quote {
  max-width: 32rem;
  display: flex;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, .15);
}

.auth-quote svg { width: 2rem; height: 2rem; flex: 0 0 auto; color: var(--yellow); }
.auth-quote p { margin: 0; color: #dce9e6; font-family: Georgia, serif; font-size: 1.05rem; font-style: italic; }

.auth-card {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .23);
}

.auth-card-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mini-mark {
  width: 3.3rem;
  height: 3.3rem;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 1rem;
  background: var(--teal-soft);
  color: var(--primary);
}

.mini-mark svg { width: 1.6rem; height: 1.6rem; }
.auth-card-heading .eyebrow { margin: 0 0 .25rem; }
.auth-card h2 { margin: 0; font-size: 1.65rem; }
.auth-intro { margin: 1.5rem 0; color: var(--muted); font-size: .92rem; }
.auth-form { margin-top: 1.5rem; }
.auth-help { margin: 1.25rem 0 0; color: var(--muted); font-size: .78rem; text-align: center; }

.input-shell {
  min-height: 3.35rem;
  display: flex;
  align-items: center;
  border: 1px solid #b9c7c2;
  border-radius: .85rem;
  background: var(--paper);
  transition: border .2s ease, box-shadow .2s ease;
}

.input-shell:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(22, 75, 69, .1);
}

.input-shell svg {
  width: 1.2rem;
  height: 1.2rem;
  margin-left: 1rem;
  color: var(--muted);
}

.input-shell input,
.input-shell select {
  width: 100%;
  min-width: 0;
  padding: .75rem 1rem .75rem .7rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: .95rem;
}

.input-shell textarea {
  width: 100%;
  min-width: 0;
  padding: .75rem 1rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: .95rem;
  resize: vertical;
}

/* Gestión */

.management-page { background: var(--canvas); }

/* Acceso y contactos: reutilizar los campos del sitio y permitir textos largos. */
.onboarding-page .content-panel { padding: clamp(1rem, 4vw, 2rem); }
.onboarding-page .content-panel > :first-child { margin-top: 0; }
.onboarding-page .content-panel > :last-child { margin-bottom: 0; }
.onboarding-page .page-summary { margin-bottom: 1.5rem; }
.contact-state-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.contact-state-grid > *, .onboarding-page .field-group { min-width: 0; }
.onboarding-page .button { max-width: 100%; white-space: normal; text-align: center; }
.onboarding-page .content-panel, .onboarding-page .page-summary { overflow-wrap: anywhere; }
.onboarding-page .field-group input { min-width: 0; font-size: 1rem; }
.onboarding-page .help-text { font-size: .85rem; }
.onboarding-page .help-text ul { padding-left: 1.25rem; }
@media (max-width: 640px) {
  .contact-state-grid { grid-template-columns: minmax(0, 1fr); }
}

.management-hero {
  min-height: calc(100vh - 5.25rem);
  padding: clamp(2.5rem, 5vw, 4.5rem) 0 5rem;
  background:
    radial-gradient(circle at 95% 0, rgba(223, 241, 236, .9), transparent 24rem),
    var(--canvas);
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.25rem;
}

.page-title {
  max-width: none;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 500;
}

.page-summary {
  max-width: 44rem;
  margin: .8rem 0 0;
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: minmax(11rem, .55fr) minmax(11rem, .55fr) minmax(20rem, 1.3fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.metric-grid article {
  min-height: 7.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow-sm);
}

.metric-icon { width: 3rem; height: 3rem; flex: 0 0 auto; }
.metric-icon svg { width: 1.45rem; height: 1.45rem; }
.metric-grid article > div { min-width: 0; display: grid; }
.metric-grid small { color: var(--muted); font-size: .73rem; font-weight: 700; text-transform: uppercase; }
.metric-grid strong { overflow: hidden; font-size: 1.55rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.metric-wide strong { font-size: 1rem; }

.content-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.panel-heading {
  min-height: 6.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.4rem 1.6rem;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 { margin: 0 0 .25rem; font-size: 1.2rem; letter-spacing: -.02em; }
.panel-heading p { margin: 0; color: var(--muted); font-size: .85rem; }

.limit-badge {
  flex: 0 0 auto;
  padding: .45rem .75rem;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--primary);
  font-size: .75rem;
  font-weight: 800;
}

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }

.data-table th, .data-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: #fafbf9;
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: #fafcfb; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td > strong { display: block; font-size: .93rem; }
.data-table td > small { display: block; max-width: 28rem; margin-top: .2rem; color: var(--muted); font-size: .75rem; }

.data-table code {
  padding: .3rem .55rem;
  border-radius: .45rem;
  background: #f1f4f2;
  color: var(--ink-soft);
  font-size: .76rem;
}

.order-chip {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: .6rem;
  background: var(--canvas);
  color: var(--primary);
  font-weight: 800;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .6rem;
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 800;
}

.status-pill i { width: .4rem; height: .4rem; border-radius: 50%; }
.status-pill.active { background: #e3f4eb; color: #216148; }
.status-pill.active i { background: #32956d; }
.status-pill.pending { background: #fef3d6; color: #865f13; }
.status-pill.pending i { background: #d99a22; }
.status-pill.inactive { background: #eff1f0; color: #697570; }
.status-pill.inactive i { background: #8d9793; }

.button.secondary {
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--line);
}
.button.secondary:hover {
  background: #e6edea;
  border-color: #b9c7c2;
}

.button-small {
  padding: .45rem .85rem;
  font-size: .8rem;
  min-height: 2.2rem;
}

.callout {
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--primary);
  background: var(--teal-soft);
  border-radius: 0 .6rem .6rem 0;
  margin: 1rem 0;
}
.callout.warning {
  border-left-color: var(--yellow);
  background: var(--yellow-soft);
  color: #5c430e;
}

.required {
  color: var(--coral);
  font-weight: bold;
}

.form-section-title {
  margin-bottom: 1.25rem;
}
.form-section-title h3 {
  font-size: 1.15rem;
  color: var(--primary-dark);
  margin-bottom: .25rem;
}
.form-section-title p {
  color: var(--muted);
  font-size: .85rem;
  margin: 0;
}

.action-card:hover, .zone-checkbox-card:hover {
  border-color: var(--primary) !important;
  background: var(--canvas-warm) !important;
}


.edit-link {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  color: var(--primary);
  font-size: .8rem;
  font-weight: 800;
  text-decoration: none;
}

.edit-link svg { width: .95rem; height: .95rem; }
.edit-link:hover { text-decoration: underline; text-underline-offset: .2rem; }

.empty-state {
  max-width: 34rem;
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5rem) 1.5rem;
  text-align: center;
}

.empty-illustration {
  width: 6rem;
  height: 6rem;
  display: grid;
  place-items: center;
  margin: 0 auto 1.25rem;
  border-radius: 2rem;
  background: var(--teal-soft);
  color: var(--primary);
  transform: rotate(-3deg);
}

.empty-illustration svg { width: 3.7rem; height: 3.7rem; }
.empty-state h2 { margin-bottom: .6rem; font-size: 1.5rem; }
.empty-state p { margin: 0 0 1.5rem; color: var(--muted); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-bottom: 2rem;
  color: var(--primary);
  font-size: .82rem;
  font-weight: 800;
  text-decoration: none;
}

.back-link svg { width: 1rem; height: 1rem; }
.back-link:hover { text-decoration: underline; text-underline-offset: .2rem; }
.editor-heading { max-width: 48rem; margin-bottom: 2rem; }

.editor-layout {
  display: grid;
  grid-template-columns: minmax(16rem, .65fr) minmax(28rem, 1.35fr);
  align-items: start;
  gap: 1.25rem;
}

.editor-guide, .form-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.editor-guide {
  position: sticky;
  top: 7rem;
  padding: 1.5rem;
}

.guide-icon {
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  border-radius: 1rem;
  background: var(--yellow-soft);
  color: #866018;
}

.guide-icon svg { width: 1.6rem; height: 1.6rem; }
.editor-guide h2 { margin: 1.25rem 0 1rem; font-size: 1.2rem; }

.editor-guide ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: .9rem;
  list-style: none;
}

.editor-guide li {
  display: grid;
  grid-template-columns: 1.65rem 1fr;
  gap: .65rem;
  color: var(--muted);
  font-size: .85rem;
}

.editor-guide li span {
  width: 1.65rem;
  height: 1.65rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--primary);
  font-size: .7rem;
  font-weight: 900;
}

.institution-note {
  display: grid;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.institution-note small { color: var(--muted); font-size: .7rem; }
.institution-note strong { margin-top: .25rem; font-size: .82rem; }

.form-card { padding: clamp(1.5rem, 4vw, 2.25rem); }
.editor-form { margin: 0; }

.field-group {
  display: grid;
  gap: .45rem;
  margin-bottom: 1.35rem;
}

.field-group > label {
  color: var(--ink);
  font-size: .84rem;
  font-weight: 800;
}

.field-group input:not([type="checkbox"]), .field-group textarea, .field-group select {
  width: 100%;
  min-height: 3.2rem;
  padding: .75rem .9rem;
  border: 1px solid #b9c7c2;
  border-radius: .8rem;
  outline: 0;
  background: var(--paper);
  color: var(--ink);
  transition: border .2s ease, box-shadow .2s ease;
}

.field-group textarea { min-height: 7rem; resize: vertical; }

.field-group input:not([type="checkbox"]):focus,
.field-group textarea:focus,
.field-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(22, 75, 69, .1);
}

.field-group input::placeholder, .field-group textarea::placeholder { color: #96a4a0; }
.help-text { color: var(--muted); font-size: .74rem; }
.field-error, .has-error > label { color: var(--danger); }

.has-error input:not([type="checkbox"]), .has-error textarea, .has-error select {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.check-field { margin: .5rem 0 1.75rem; }

.check-row {
  display: grid;
  grid-template-columns: 1.35rem 1fr;
  gap: .75rem;
  align-items: start;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: var(--canvas);
  cursor: pointer;
}

.check-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.check-control {
  width: 1.3rem;
  height: 1.3rem;
  display: grid;
  place-items: center;
  margin-top: .1rem;
  border: 2px solid #93a39e;
  border-radius: .35rem;
  background: var(--paper);
}

.check-row input:checked + .check-control {
  border-color: var(--primary);
  background: var(--primary);
}

.check-row input:checked + .check-control::after {
  content: "";
  width: .55rem;
  height: .3rem;
  border-bottom: 2px solid var(--paper);
  border-left: 2px solid var(--paper);
  transform: translateY(-1px) rotate(-45deg);
}

.check-row input:focus-visible + .check-control {
  outline: 3px solid rgba(239, 108, 80, .4);
  outline-offset: 3px;
}

.check-row > span:last-child { display: grid; }
.check-row strong { font-size: .85rem; }
.check-row small { margin-top: .2rem; color: var(--muted); font-size: .74rem; font-weight: 400; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  padding-top: .5rem;
}

.messages { padding-top: 1rem; }

.message {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--paper);
  font-size: .86rem;
}

.message svg { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; }
.message.success { border-color: #9dceb9; background: #e5f5ed; color: #205e46; }
.message.error { border-color: #e5aaa3; background: var(--danger-soft); color: #842f28; }

.site-footer {
  padding: 2.4rem 0;
  background: #092e2b;
  color: var(--paper);
}

.footer-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.site-footer strong { font-family: Georgia, serif; font-size: 1.05rem; font-weight: 500; }
.site-footer p { margin: .25rem 0 0; color: #a9c4bf; font-size: .8rem; }

.footer-meta {
  display: flex;
  gap: 1.25rem;
  color: #8fada8;
  font-size: .72rem;
}

@media (max-width: 980px) {
  .organization-chip { max-width: 11rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { max-width: 45rem; }
  .community-visual { width: min(100%, 34rem); margin-inline: auto; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .feature-grid article:last-child { grid-column: 1 / -1; min-height: 16rem; }
  .steps-layout { grid-template-columns: 1fr; }
  .auth-layout { gap: 3rem; }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-guide { position: static; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-wide { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .container { width: min(100% - 1.5rem, var(--max-width)); }
  .site-header { position: relative; }
  .header-inner { min-height: auto; align-items: flex-start; flex-direction: column; padding-block: .8rem; }
  .header-actions { width: 100%; flex: auto; justify-content: flex-start; }
  .nav-dropdown .dropdown-menu { position: absolute; right: 0; left: auto; width: min(calc(100vw - 2rem), 18rem); }
  .organization-chip { max-width: none; flex: 1; order: -1; }
  .location-label { display: none; }
  .hero { padding-top: 3.5rem; }
  .hero-copy h1 { font-size: clamp(2.8rem, 14vw, 4.2rem); }
  .community-visual { min-height: 27rem; transform: scale(.95); }
  .person-two { right: 0; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid article:last-child { grid-column: auto; min-height: 20rem; }
  .auth-section { min-height: auto; padding: 2.5rem 0; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-welcome h1 { font-size: clamp(2.5rem, 12vw, 3.5rem); }
  .auth-quote { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading .button { width: 100%; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-grid article { min-height: 6rem; padding: 1rem; }
  .metric-wide { grid-column: 1 / -1; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .data-table th, .data-table td { padding: .85rem 1rem; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
  .footer-meta { flex-direction: column; gap: .25rem; }
}

@media (max-width: 480px) {
  .brand-copy strong { font-size: .9rem; }
  .header-actions .nav-link { padding-inline: .5rem; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .button { width: 100%; }
  .text-link { text-align: center; }
  .trust-line { align-items: flex-start; }
  .community-visual { min-height: 23rem; margin-inline: -1rem; transform: scale(.86); }
  .person-bubble small { display: none; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-wide { grid-column: auto; }
  .form-actions { flex-direction: column; }
  .form-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Formularios de participantes: resumen legible y controles sin desborde. */
.form-error-summary { border: 2px solid var(--danger); border-radius: 8px; padding: 1rem; margin-bottom: 1.5rem; background: var(--danger-soft); overflow-wrap: anywhere; }
.form-error-summary h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
.form-error-summary p { margin: 0 0 .5rem; }
.form-error-summary ul { padding-left: 1.25rem; margin: 0; }
.form-error-summary a { color: inherit; text-decoration: underline; }
.participant-form .coverage-fields { min-width: 0; border: 0; padding: 0; margin-inline: 0; }
.participant-form .coverage-fields legend { font-weight: 700; margin-bottom: .75rem; }
.participant-form .zone-checkbox-card { min-width: 0; overflow-wrap: anywhere; }
.participant-form .form-actions { flex-wrap: wrap; }
.agreement-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2rem; align-items: start; }
.agreement-layout > * { min-width: 0; }
.agreement-heading { flex-wrap: wrap; gap: 1rem; }
.agreement-detail-page .card, .my-agreements-page .agreement-card { overflow-wrap: anywhere; }
.agreement-detail-page .button { white-space: normal; text-align: center; }
@media (max-width: 820px) {
  .agreement-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .participant-form-panel { padding: 1rem !important; }
  .agreement-detail-page .card { padding: 1rem !important; }
  .participant-form .form-actions { align-items: stretch; }
  .participant-form .form-actions .button { white-space: normal; text-align: center; }
}
