/* ALDS · sitio público y área de socios. Paleta tomada del logo real de la
   peña (verde lima, rojo STOP, negro, blanco) muestreada píxel a píxel, no
   inventada. El verde y el rojo no se combinan en degradado entre sí (mezclan
   mal, quedan parduzcos) — se usan como bloques sólidos, como en el propio
   logo: verde para superficies grandes (hero, franjas), rojo para todo lo
   interactivo (enlaces, botones, estados activos). El texto blanco sobre
   verde no cumple contraste (2.3:1) así que el verde nunca lleva texto claro
   encima, solo tinta oscura. */

:root {
  --brand-green: #96b823;
  --brand-green-dark: #78931c;
  --brand-red: #d30b11;
  --brand-red-dark: #a5090c;
  --ink: #0f172a;
  --ink-medium: #374151;
  --ink-quiet: #6b7280;
  --border: #e5e7eb;
  --surface: #ffffff;
  --page-bg: #f5f5f4;
  --status-good: #15803d;
  --status-good-bg: #dcfce7;
  --status-warning: #92400e;
  --status-warning-bg: #fef3c7;
  --status-critical: #b91c1c;
  --status-critical-bg: #fee2e2;
  --status-idle: #4b5563;
  --status-idle-bg: #e5e7eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a { color: var(--brand-red); text-decoration: none; }
a:hover { color: var(--brand-red-dark); }

img { max-width: 100%; display: block; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* --- Cabecera --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.01em;
}

.brand img { height: 42px; width: auto; }

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

.main-nav a {
  color: var(--ink-medium);
  font-weight: 650;
  font-size: 15px;
}

.main-nav a:hover { color: var(--brand-red); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 9px;
  background: var(--brand-red);
  color: #fff !important;
  font-weight: 700;
  font-size: 14px;
}

.nav-cta:hover { background: var(--brand-red-dark); }

.member-chip {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--ink-medium);
}

.member-chip strong { color: var(--ink); }

.member-chip .logout-link { color: var(--status-critical); font-weight: 650; }

/* --- Pie --- */
.site-footer {
  margin-top: 64px;
  padding: 32px 0;
  background: var(--ink);
  color: #cbd5e1;
  font-size: 14px;
}

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

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

.site-footer a { color: var(--brand-green); font-weight: 650; }
.site-footer a:hover { color: #fff; }

/* --- Hero --- */
.hero {
  background: var(--brand-green);
  color: var(--ink);
  padding: 76px 0 88px;
}

.hero .container { max-width: 760px; text-align: center; }

.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 12px;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
}

.hero p {
  margin: 0 auto 28px;
  max-width: 560px;
  font-size: 17px;
  color: var(--ink);
}

.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* --- Cabecera de página interior (Historia, Hazte socio...) --- */
.page-header { background: var(--brand-green); color: var(--ink); padding: 48px 0; text-align: center; }
.page-header h1 { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -.02em; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.button-primary {
  background: var(--brand-red);
  color: #fff;
  box-shadow: 0 10px 24px rgb(0 0 0 / 20%);
}

.button-primary:hover { background: var(--brand-red-dark); color: #fff; transform: translateY(-1px); }

.button-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgb(15 23 42 / 35%);
}

.button-outline:hover { color: var(--ink); background: rgb(15 23 42 / 8%); }

.button-solid {
  background: var(--brand-red);
  color: #fff !important;
  width: 100%;
}

.button-solid:hover { background: var(--brand-red-dark); color: #fff; }

/* --- Secciones genéricas --- */
.section { padding: 56px 0; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section-heading h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.section-heading .text-link { font-weight: 700; font-size: 14px; white-space: nowrap; }

/* --- Tarjetas de noticias --- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.news-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 2px 8px rgb(15 23 42 / 4%);
  transition: transform .15s ease, box-shadow .15s ease;
}

.news-card:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgb(15 23 42 / 8%); }

.news-card time { display: block; color: var(--ink-quiet); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.news-card h3 { margin: 0 0 10px; font-size: 19px; line-height: 1.3; }
.news-card p { margin: 0; color: var(--ink-medium); font-size: 14px; }
.news-card .text-link { display: inline-block; margin-top: 14px; font-weight: 700; font-size: 14px; }

.empty-note { color: var(--ink-quiet); font-size: 15px; padding: 24px 0; }

/* --- Artículo --- */
.article { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 40px; max-width: 760px; margin: 0 auto; }
.article time { color: var(--ink-quiet); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.article h1 { margin: 10px 0 20px; font-size: 32px; letter-spacing: -.02em; }
.article .body { font-size: 16px; color: var(--ink-medium); white-space: pre-line; }
.back-link { display: inline-block; margin-bottom: 20px; font-weight: 650; }

/* --- Mensajes flash --- */
.messages { list-style: none; margin: 20px auto 0; padding: 0; max-width: 1080px; padding-inline: 24px; }
.messages li { padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.messages .success { background: var(--status-good-bg); color: var(--status-good); }
.messages .error { background: var(--status-critical-bg); color: var(--status-critical); }
.messages .info { background: #dbeafe; color: #1d4ed8; }

/* --- Autenticación (tarjeta centrada) --- */
.auth-wrap { min-height: calc(100vh - 72px - 96px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 16px; box-shadow: 0 20px 45px rgb(15 23 42 / 12%); padding: 40px 36px; }
.auth-card img.logo { height: 80px; width: auto; margin: 0 auto 18px; }
.auth-card h1 { margin: 0; font-size: 22px; text-align: center; font-weight: 800; letter-spacing: -.02em; }
.auth-card .subtitle { margin: 6px 0 24px; text-align: center; color: var(--ink-quiet); font-size: 14px; }
.auth-card .button { margin-top: 4px; }
.auth-card .auth-links { margin: 18px 0 0; text-align: center; font-size: 13px; color: var(--ink-quiet); }
.auth-card .auth-links a { font-weight: 700; }
.auth-card .errorlist { list-style: none; margin: 0 0 6px; padding: 0; color: var(--status-critical); font-size: 13px; font-weight: 600; }

.form-row { margin-bottom: 16px; }
.form-row label { display: block; margin-bottom: 6px; color: var(--ink-medium); font-size: 13px; font-weight: 700; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  background: #f9fafb;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgb(211 11 16 / 18%);
  background: #fff;
}

/* --- Área de socios --- */
.member-shell { padding: 32px 0 64px; }

.member-subnav {
  display: flex;
  gap: 6px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.member-subnav a {
  padding: 10px 16px;
  color: var(--ink-medium);
  font-weight: 650;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.member-subnav a:hover { color: var(--brand-red); }
.member-subnav a.active { color: var(--brand-red); border-bottom-color: var(--brand-red); }

.member-heading { margin-bottom: 24px; }
.member-heading .eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 800; color: var(--ink-quiet); margin: 0 0 4px; }
.member-heading h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.01em; }

.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }

.status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 8px rgb(15 23 42 / 4%);
}

.status-card p { margin: 0 0 6px; color: var(--ink-quiet); font-size: 13px; font-weight: 650; }
.status-card strong { display: block; font-size: 22px; font-weight: 800; }
.status-card small { color: var(--ink-quiet); font-size: 12px; }

.pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; }
.pill-good { background: var(--status-good-bg); color: var(--status-good); }
.pill-warning { background: var(--status-warning-bg); color: var(--status-warning); }
.pill-critical { background: var(--status-critical-bg); color: var(--status-critical); }
.pill-idle { background: var(--status-idle-bg); color: var(--status-idle); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; margin-bottom: 24px; box-shadow: 0 2px 8px rgb(15 23 42 / 4%); }
.panel h2 { margin: 0 0 18px; font-size: 17px; font-weight: 800; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data-table th { text-align: left; padding: 10px 12px; color: var(--ink-quiet); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
table.data-table td { padding: 12px; border-bottom: 1px solid var(--border); color: var(--ink-medium); }
table.data-table tr:last-child td { border-bottom: none; }

.order-form { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 12px; align-items: end; margin-bottom: 24px; }
.order-form .form-row { margin-bottom: 0; }

.event-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.event-card:last-child { border-bottom: none; }
.event-card h3 { margin: 0 0 4px; font-size: 15px; }
.event-card small { color: var(--ink-quiet); }

/* --- Responsive --- */
@media (max-width: 900px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .status-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .main-nav { display: none; }
  .hero h1 { font-size: 32px; }
  .news-grid, .status-grid { grid-template-columns: 1fr; }
  .order-form { grid-template-columns: 1fr; }
  .article { padding: 24px; }
}
