:root {
  --brand-50: #EEF0FB;
  --brand-100: #D9DEF7;
  --brand-200: #B7C0F0;
  --brand-500: #4F5BD5;
  --brand-700: #333B96;

  --ink: #0F172A;
  --ink-2: #475569;
  --ink-3: #94A3B8;

  --surface: #F8FAFC;
  --card: #FFFFFF;
  --sunken: #F1F5F9;

  --border: #E2E8F0;
  --border-soft: #F1F5F9;
  --border-strong: #CBD5E1;

  --night: #000618;
  --accent: #F39C12;
  --sky: #40A9FF;

  --ok-bg: #DCFCE7;
  --ok-fg: #15803D;
  --warn-bg: #FEF3C7;
  --warn-fg: #B45309;
  --danger-bg: #FEE2E2;
  --danger-fg: #B91C1C;
  --info-bg: #E0F2FE;
  --info-fg: #0369A1;

  --radius: 16px;
  --shadow-sticker: #000 2px 2px 3px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-500); }

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--night);
  padding: 14px 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo img { display: block; height: 30px; width: auto; }

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav a {
  color: #FFFFFF;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  opacity: .85;
}

.nav a:hover { opacity: 1; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  padding: 12px 18px;
  border-radius: 22px;
  text-decoration: none;
  transition: transform .08s ease, filter .15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: var(--night); }
.btn-primary:hover { filter: brightness(1.06); }

.btn-sky { background: var(--sky); color: #FFFFFF; }
.btn-sky:hover { filter: brightness(1.06); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--sunken); }

.btn-danger { background: var(--danger-bg); color: var(--danger-fg); }
.btn-danger:hover { filter: brightness(.97); }

.btn[disabled] { opacity: .55; cursor: not-allowed; }

.btn-sticker {
  background: #FFFFFF url("assets/sticker1.png") center/cover;
  color: var(--night);
  border-radius: 20px;
  padding: 12px 24px;
  font-size: 14px;
  box-shadow: var(--shadow-sticker);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), filter .15s ease;
}
.btn-sticker:hover { transform: scale(1.04); }
.btn-sticker:active { transform: translateY(1px); }

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

.hero {
  background: var(--night);
  color: #FFFFFF;
  padding: 32px 0 40px;
}

.hero h1 {
  margin: 0 0 12px;
  /* Va en una sola línea, así que la pendiente está calibrada para que el texto
     quepa siempre en el .wrap: subirla desborda en los anchos intermedios. */
  font-size: clamp(21px, 3.7vw - 1.5px, 38px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.02em;
  max-width: none;
  white-space: nowrap;
}

.hero .lede {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 1.5;
  color: #C7CEDB;
  max-width: 900px;
}

.overline {
  display: block;
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand-200);
}

.hero-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  max-width: 560px;
}

.hero-form input[type="email"] {
  flex: 1 1 260px;
  min-width: 0;
  padding: 12px 16px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 15px;
}

.hero-form input[type="email"]::placeholder { color: #7C879B; }
.hero-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255,255,255,.1);
}

.hero-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: #7C879B;
}

.hero-note a { color: var(--brand-200); }

/* ---------- Sections ---------- */

.section { padding: 44px 0; }

/* La agenda es lo que queremos que se vea sin bajar: menos aire encima. */
#agenda { padding-top: 32px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.section-head h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -.01em;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 15px;
}

/* ---------- Filters ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.filters input[type="search"],
.filters select {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
}

.filters input[type="search"] { flex: 1 1 220px; min-width: 0; }

.filters input:focus, .filters select:focus {
  outline: none;
  border-color: var(--brand-500);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  background: var(--card);
}

.toggle input { accent-color: var(--brand-500); margin: 0; }
.toggle:hover { background: var(--sunken); }

/* ---------- Event grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s ease, transform .15s ease;
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.card-media {
  height: 132px;
  background: var(--sunken) center/cover no-repeat;
  border-bottom: 1px solid var(--border-soft);
}

.card-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }

.card-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-500);
  letter-spacing: .01em;
  margin: 0 0 8px;
  text-transform: capitalize;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 600;
}

.card p.desc {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }

.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--ink-2);
}

.tag-type { background: var(--brand-50); color: var(--brand-700); }
.tag-free { background: var(--ok-bg); color: var(--ok-fg); }
.tag-online { background: var(--info-bg); color: var(--info-fg); }

.card-link {
  margin-top: auto;
  align-self: flex-start;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 1px;
}

.card-link:hover { color: var(--brand-500); }

/* ---------- Detalle del evento ---------- */

.card { cursor: pointer; }

.card:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

/* Igual que en el panel: el `display:flex` de abajo gana al `display:none` que
   el navegador aplica por el atributo `hidden`. */
.evmodal[hidden] { display: none; }

.evmodal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 6, 24, .6);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}

.evmodal-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 620px;
  margin: auto;
  overflow: hidden;
}

.evmodal-media {
  height: 190px;
  background: var(--sunken) center/cover no-repeat;
}

.evmodal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(0, 6, 24, .28);
}

.evmodal-x:hover { background: #FFFFFF; }

.evmodal-body { padding: 24px; }

.evmodal-body h2 {
  margin: 0 0 12px;
  font-size: 23px;
  line-height: 1.3;
  font-weight: 700;
}

.evmodal-desc {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
  white-space: pre-wrap;
}

.evmodal-facts {
  margin: 0 0 22px;
  padding: 16px 18px;
  background: var(--sunken);
  border-radius: 12px;
  display: grid;
  gap: 10px;
}

.evmodal-facts div {
  display: flex;
  gap: 12px;
  font-size: 14px;
  line-height: 1.45;
}

.evmodal-facts dt {
  flex: 0 0 92px;
  margin: 0;
  color: var(--ink-3);
  font-weight: 600;
}

.evmodal-facts dd { margin: 0; color: var(--ink); min-width: 0; word-break: break-word; }

/* ---------- States ---------- */

.empty {
  text-align: center;
  padding: 56px 24px;
  background: var(--card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.empty h3 { margin: 0 0 10px; font-size: 22px; font-weight: 600; }
.empty p { margin: 0 auto 22px; max-width: 46ch; color: var(--ink-2); font-size: 15px; }

.skeleton {
  height: 210px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #F1F5F9 25%, #E8EDF3 37%, #F1F5F9 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.notice {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  margin: 0 0 16px;
}

.notice-ok { background: var(--ok-bg); color: var(--ok-fg); }
.notice-err { background: var(--danger-bg); color: var(--danger-fg); }
.notice-info { background: var(--info-bg); color: var(--info-fg); }

/* ---------- Panels / forms ---------- */

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.panel-narrow { max-width: 640px; margin: 0 auto; }

.field { margin: 0 0 18px; }

.field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 6px;
}

.field .hint { font-size: 13px; color: var(--ink-3); margin: 6px 0 0; }

.field input[type="text"],
.field input[type="url"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="datetime-local"],
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--card);
}

.field textarea { min-height: 130px; resize: vertical; line-height: 1.55; }

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand-500);
}

.checks { display: flex; flex-wrap: wrap; gap: 8px; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  background: var(--card);
}

/* `.field label` es display:block y gana en especificidad, así que una píldora
   suelta dentro de un .field se estiraría a todo el ancho. */
.field label.check {
  display: inline-flex;
  width: auto;
  font-weight: 400;
  margin: 0;
}

.check input { accent-color: var(--brand-500); margin: 0; }
.check:hover { background: var(--sunken); }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.steps .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 10px;
}

.steps h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.steps p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.55; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--night);
  color: #7C879B;
  padding: 36px 0 44px;
  margin-top: 40px;
}

.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.site-footer a { color: #C7CEDB; text-decoration: none; font-size: 14px; }
.site-footer a:hover { color: #FFFFFF; }

.site-footer .initiative img { display: block; height: 46px; width: auto; }

.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .hero { padding: 24px 0 32px; }
  .hero h1 { font-size: 28px; white-space: normal; }
  .section-head h2 { font-size: 23px; }
  .nav { gap: 14px; }
  .nav .nav-hide { display: none; }
  .panel { padding: 20px; }
}
