/* ============================================================================
   BASE DEL SITIO (página abierta y zona de socios): letras, colores y piezas comunes.

   MARCA: todo el color sale de las variables de :root y los dos colores de marca salen del logo de la ONG
   (brand/logo): --accent es el verde vivo (lo que se toca) y --accent-2 el amarillo de las letras (rótulos y
   números grandes). Si cambian acá, el sitio entero los toma, flores dibujadas incluidas.

   Formas (una sola regla para todo): botones y pastillas = redondos completos; tarjetas = 22px; campos = 12px.
   Capas: flores del fondo -1 · contenido 0 · barra de arriba 20 · avisos 40 · ventanas 60.
   ========================================================================== */
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/fonts/figtree-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0b0f0c;
  --bg-2: #101611;
  --surface: #151c17;
  --surface-2: #1c2520;
  --line: #28332b;
  --line-2: #3b4a3f;
  --text: #ecefe8;
  --text-2: #bcc5ba;
  --text-3: #8f9b90;
  --accent: #42f553; /* verde vivo del logo: botones, enlaces, lo que se toca */
  --accent-strong: #7afb86;
  --accent-ink: #03200a;
  --accent-soft: rgba(66, 245, 83, 0.14);
  --accent-2: #efd71c; /* amarillo de las letras del logo: rótulos, números grandes, el nombre del cierre */
  --danger: #ff9a94;
  --danger-soft: rgba(255, 120, 112, 0.12);
  --warn: #e7c268;
  --warn-soft: rgba(231, 194, 104, 0.13);
  --flower-alpha: 1;

  --r-pill: 999px;
  --r-card: 22px;
  --r-input: 12px;
  --font-display: "Schibsted Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --max: 1160px;
  --nav-h: 68px;
}

/* Modo claro: solo donde la página no fija el oscuro (la página abierta lo fija: su fondo es una foto oscura). */
@media (prefers-color-scheme: light) {
  :root:not(.tema-oscuro) {
    color-scheme: light;
    --bg: #f2f5ee;
    --bg-2: #e8ede3;
    --surface: #fbfcf8;
    --surface-2: #edf1e8;
    --line: #d6ddd1;
    --line-2: #b6c2b1;
    --text: #121913;
    --text-2: #3a483e;
    --text-3: #57665b;
    --accent: #127a33;
    --accent-strong: #0e6529;
    --accent-ink: #f3fbf5;
    --accent-soft: rgba(18, 122, 51, 0.11);
    --accent-2: #7a6400;
    --danger: #ae2a22;
    --danger-soft: rgba(174, 42, 34, 0.09);
    --warn: #7d5a00;
    --warn-soft: rgba(160, 116, 0, 0.12);
    --flower-alpha: 0.8;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: clamp(18px, 4vw, 40px); }
.muted { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Flores del fondo: una capa fija detrás de todo. Las secciones no tienen fondo propio para que se vean. */
.campo { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

/* ---- Barra de arriba ---- */
.nav {
  position: sticky; top: 0; z-index: 20;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.nav__in { height: 100%; display: flex; align-items: center; gap: 28px; }
.nav__brand { display: inline-flex; align-items: center; gap: 10px; font: 700 17px/1 var(--font-display); letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; }
.nav__links { display: flex; gap: 26px; margin-inline: auto; }
.nav__links a { font-size: 15px; color: var(--text-2); text-decoration: none; white-space: nowrap; transition: color 0.2s; }
.nav__links a:hover { color: var(--text); }
.nav__cta { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav__links + .nav__cta { margin-left: 0; }
/* El logo redondo de la ONG (public/img/logo-192.webp). */
.logo { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%; }

/* ---- Botones ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: transparent; color: var(--text);
  font: 600 15px/1 var(--font-body); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform 0.18s var(--ease), background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn--danger:hover { background: var(--danger-soft); }
.btn--sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.linkbtn { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---- Campos (la etiqueta va arriba, el error abajo) ---- */
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field > span, .field > legend { font-size: 14px; font-weight: 600; color: var(--text-2); padding: 0; }
.field small { font-size: 13px; color: var(--text-3); }
.input, .field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="password"], .field select, .field textarea {
  width: 100%; height: 48px; padding: 0 14px;
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-input);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
fieldset.field { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; color: var(--text-2); margin-bottom: 18px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--accent); }

/* Elegir una opción entre pocas (tipo de cuenta, medio de pago, horario). */
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.option { position: relative; }
.option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.option span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: var(--r-pill); border: 1px solid var(--line-2); font-size: 15px; font-weight: 500; color: var(--text-2); transition: background-color 0.2s, border-color 0.2s, color 0.2s; }
.option input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.option input:disabled + span { opacity: 0.45; }

.alert { padding: 12px 14px; border-radius: var(--r-input); font-size: 15px; margin-bottom: 18px; }
.alert--error { background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.alert--ok { background: var(--accent-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.alert--warn { background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }

.tag { display: inline-flex; align-items: center; padding: 3px 11px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.tag--ok { background: var(--accent-soft); color: var(--accent); }
.tag--warn { background: var(--warn-soft); color: var(--warn); }
.tag--bad { background: var(--danger-soft); color: var(--danger); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }

.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 40; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { padding: 13px 16px; border-radius: var(--r-input); background: var(--surface-2); border: 1px solid var(--line-2); font-size: 15px; box-shadow: 0 16px 40px color-mix(in srgb, var(--bg) 70%, transparent); }
.toast--ok { border-color: var(--accent); }
.toast--error { border-color: var(--danger); }

/* Cargando: bloques con la forma de lo que va a aparecer. */
.skel { border-radius: var(--r-card); background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%); background-size: 240% 100%; animation: skel 1.4s linear infinite; }
@keyframes skel { to { background-position: -240% 0; } }

@media (max-width: 860px) {
  body { font-size: 16px; }
  .nav__links { display: none; }
  .nav__cta, .nav__links + .nav__cta { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
