/* ============================================================
   Latidos por Tony — Sistema de Rifa
   Hoja de estilos compartida (design system)
   ============================================================ */

/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ============================================================
   Tokens
   ============================================================ */
:root {
  /* Brand */
  --red:        #C01F2E;   /* Latidos por Tony rojo */
  --red-700:    #9C1623;
  --red-800:    #7C1019;
  --red-50:     #FBEAEB;
  --red-100:    #F6D6D9;

  --gold:       #C8912B;   /* acento cálido para premios / ganadores */
  --gold-50:    #FBF1DC;

  --green:      #1E8A5B;   /* confirmado */
  --green-50:   #E4F4EC;
  --amber:      #B5791A;   /* pendiente */
  --amber-50:   #FBF0DA;

  /* Neutrals (warm) */
  --ink:        #241C1A;
  --ink-soft:   #463B37;
  --muted:      #786B65;
  --faint:      #A89B94;
  --line:       #ECE2DB;
  --line-soft:  #F3EBE5;
  --cream:      #FAF5F1;
  --cream-deep: #F3E9E2;
  --surface:    #FFFFFF;

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-pill: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(60,30,25,.06), 0 2px 6px rgba(60,30,25,.05);
  --shadow-md: 0 6px 18px rgba(80,30,25,.09), 0 2px 6px rgba(80,30,25,.05);
  --shadow-lg: 0 18px 44px rgba(80,30,25,.16), 0 6px 14px rgba(80,30,25,.07);
  --shadow-red: 0 12px 28px rgba(192,31,46,.30);

  /* Type */
  --font-head: 'Poppins', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;

  --maxw: 1240px;
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
ul { list-style: none; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.08; letter-spacing: -0.015em; color: var(--ink); font-weight: 700; }

/* ============================================================
   Layout helpers
   ============================================================ */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.eyebrow {
  font-family: var(--font-head);
  font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--red); display: inline-flex; align-items: center; gap: 8px;
}
.stack { display: flex; flex-direction: column; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-head); font-weight: 600; font-size: 17px;
  padding: 15px 26px; border-radius: var(--r-pill); min-height: 52px;
  transition: transform .14s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn-primary { background: var(--red); color: #fff; box-shadow: var(--shadow-red); }
.btn-primary:hover { background: var(--red-700); }
.btn-lg { font-size: 19px; padding: 18px 34px; min-height: 60px; }
.btn-block { width: 100%; }
.btn-ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { background: var(--cream); box-shadow: inset 0 0 0 1.5px var(--faint); }
.btn-gold { background: var(--gold); color: #fff; box-shadow: 0 10px 24px rgba(200,145,43,.30); }
.btn-gold:hover { filter: brightness(.96); }
.btn-green { background: var(--green); color: #fff; }
.btn-danger { background: #fff; color: var(--red-700); box-shadow: inset 0 0 0 1.5px var(--red-100); }
.btn-danger:hover { background: var(--red-50); }
.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-sm { font-size: 14px; padding: 9px 16px; min-height: 40px; gap: 6px; }

.wa-btn { background: #25D366; color: #fff; box-shadow: 0 10px 24px rgba(37,211,102,.28); }
.wa-btn:hover { filter: brightness(.96); }

/* ============================================================
   Heart mark (CSS only — no external svg)
   ============================================================ */
.heart {
  --hs: 1em; width: var(--hs); height: var(--hs); position: relative; display: inline-block;
  color: var(--red); top: -0.06em;
}
.heart::before, .heart::after {
  content: ""; position: absolute; top: 0; left: calc(var(--hs) / 2);
  width: calc(var(--hs) / 2); height: calc(var(--hs) * 0.8);
  background: currentColor; border-radius: var(--hs) var(--hs) 0 0;
  transform: rotate(-45deg); transform-origin: 0 100%;
}
.heart::after { left: 0; transform: rotate(45deg); transform-origin: 100% 100%; }

/* ============================================================
   Site header
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250,245,241,.86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand-badge {
  width: 40px; height: 40px; border-radius: 11px; background: var(--red);
  display: grid; place-items: center; box-shadow: var(--shadow-sm); flex: none;
}
.brand-badge .heart { color: #fff; --hs: 19px; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 16px; line-height: 1.05; letter-spacing: -0.01em; }
.brand-name small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.brand-logo { height: 34px; width: auto; display: block; flex: none; }
.header-cta { display: flex; align-items: center; gap: 10px; }

/* ============================================================
   Cards & surfaces
   ============================================================ */
.card {
  background: var(--surface); border-radius: var(--r-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 24px; }

/* ============================================================
   Progress meter
   ============================================================ */
.meter { display: flex; flex-direction: column; gap: 12px; }
.meter-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.meter-raised { font-family: var(--font-head); font-weight: 800; font-size: 34px; color: var(--ink); line-height: 1; letter-spacing: -0.02em; }
.meter-raised span { color: var(--muted); font-weight: 600; font-size: 16px; }
.meter-goal { font-size: 14px; color: var(--muted); font-weight: 600; text-align: right; }
.meter-bar { height: 16px; border-radius: var(--r-pill); background: var(--cream-deep); overflow: hidden; box-shadow: inset 0 1px 2px rgba(80,30,25,.08); }
.meter-fill {
  height: 100%; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--red), #E0413C);
  transition: width 1s cubic-bezier(.2,.7,.2,1);
  position: relative;
}
.meter-stats { display: flex; gap: 22px; flex-wrap: wrap; }
.meter-stat b { font-family: var(--font-head); font-weight: 700; color: var(--ink); }
.meter-stat { font-size: 14px; color: var(--muted); font-weight: 500; }

/* ============================================================
   Badges / status chips
   ============================================================ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-head); font-weight: 600; font-size: 12.5px; letter-spacing: .01em;
  padding: 5px 12px; border-radius: var(--r-pill);
}
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-pending   { background: var(--amber-50); color: var(--amber); }
.chip-confirmed { background: var(--green-50); color: var(--green); }
.chip-rejected  { background: var(--red-50);   color: var(--red-700); }
.chip-available { background: var(--cream-deep); color: var(--muted); }

/* ============================================================
   Forms
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-family: var(--font-head); font-weight: 600; font-size: 14px; color: var(--ink-soft); }
.field label .opt { color: var(--faint); font-weight: 500; }
.input, .textarea, .select {
  width: 100%; padding: 14px 16px; border-radius: var(--r-md);
  background: var(--surface); border: 1.5px solid var(--line); color: var(--ink);
  transition: border .15s ease, box-shadow .15s ease;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 4px var(--red-50);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.textarea { min-height: 96px; resize: vertical; }
.field-hint { font-size: 12.5px; color: var(--muted); }
.field-error { font-size: 12.5px; color: var(--red-700); font-weight: 600; display: none; }
.field.invalid .input, .field.invalid .textarea { border-color: var(--red); }
.field.invalid .field-error { display: block; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { background: var(--ink); color: #E9DED9; padding: 48px 0 36px; }
.site-footer a { color: #fff; }
.site-footer .wrap { display: flex; flex-direction: column; gap: 18px; }
.footer-top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.footer-brand { display: flex; align-items: center; gap: 11px; }
.footer-brand .brand-badge { background: var(--red); }
.footer-brand b { font-family: var(--font-head); font-size: 16px; color: #fff; }
.footer-note { font-size: 13.5px; color: #B6A8A2; max-width: 460px; line-height: 1.6; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 18px; font-size: 13px; color: #9C8E88; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ============================================================
   Utility
   ============================================================ */
.muted { color: var(--muted); }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.divider { height: 1px; background: var(--line); border: 0; }
.toast-wrap { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
  background: var(--ink); color: #fff; padding: 13px 20px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 9px;
}
.toast.ok { background: var(--green); }
@media (prefers-reduced-motion: no-preference) { .toast { animation: toastIn .3s ease; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

/* ============================================================
   Donaciones internacionales (fuera de Perú) — Venezuela / Chile
   Componente compartido: landing (index) + página de pago (comprar)
   ============================================================ */
.intl-don { }
.intl-head { text-align: center; max-width: 640px; margin: 0 auto 30px; }
.intl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.intl-card {
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-lg);
  padding: 22px 22px 18px; box-shadow: var(--shadow-md); text-align: left;
}
.intl-card .intl-country {
  display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-head);
  font-weight: 700; font-size: 17px; color: var(--ink); margin-bottom: 4px;
}
.intl-card .intl-country .flag { font-size: 22px; line-height: 1; }
.intl-card .intl-holder { color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }
.intl-rows { background: var(--cream); border-radius: var(--r-md); padding: 2px 14px; }
.intl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.intl-row:last-child { border-bottom: 0; }
.intl-row .k { color: var(--muted); font-size: 12.5px; flex: none; }
.intl-row .v { font-family: var(--font-head); font-weight: 700; font-size: 14px; color: var(--ink); text-align: right; word-break: break-word; }
.intl-row .v.acct { letter-spacing: .02em; }
.intl-copy {
  flex: none; font-size: 11.5px; color: var(--red); font-weight: 700; background: #fff;
  border: 1px solid var(--line); padding: 4px 10px; border-radius: var(--r-pill); cursor: pointer; transition: all .15s;
}
.intl-copy:hover { border-color: var(--red); background: var(--red-50); }
.intl-copy.copied { color: var(--green); border-color: var(--green); background: var(--green-50); }

/* GoFundMe — worldwide card donation callout */
.gfm-card {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(135deg, #00b964, #009a52); color: #fff;
  border-radius: var(--r-lg); padding: 22px 24px; margin-bottom: 24px;
  box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; text-decoration: none;
}
.gfm-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.gfm-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.gfm-badge { font-size: 12.5px; font-weight: 700; letter-spacing: .03em; opacity: .92; }
.gfm-main b { font-family: var(--font-head); font-size: 18px; }
.gfm-main small { font-size: 13px; opacity: .92; max-width: 460px; }
.gfm-cta {
  flex: none; background: #fff; color: #009a52; font-family: var(--font-head); font-weight: 800;
  font-size: 14.5px; padding: 11px 18px; border-radius: var(--r-pill); white-space: nowrap;
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .section { padding: 44px 0; }
  .meter-raised { font-size: 28px; }
  .intl-grid { grid-template-columns: 1fr; }
  .gfm-card { padding: 20px; }
  .gfm-cta { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
