/* ===== Local fonts (armonizadas con DiarioBOE) ===== */
/* Public Sans — texto/UI · Source Serif 4 — titulares editoriales */
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/PublicSans-400.woff2') format('woff2'); }
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/PublicSans-500.woff2') format('woff2'); }
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/PublicSans-600.woff2') format('woff2'); }
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/PublicSans-700.woff2') format('woff2'); }
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 800; font-display: swap; src: url('/fonts/PublicSans-800.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/SourceSerif4-600.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/SourceSerif4-700.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/IBMPlexMono-400.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/IBMPlexMono-500.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/IBMPlexMono-600.woff2') format('woff2'); }

/* ===== Design Tokens (Light) — paleta HSL de DiarioBOE ===== */
:root {
  --font-sans: 'Public Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  --accent: hsl(217 92% 55%);
  --accent-hover: hsl(217 92% 46%);
  --accent-subtle: hsl(214 80% 90%);
  --bg-page: hsl(214 64% 87%);
  --bg-card: hsl(217 59% 89%);
  --bg-elevated: hsl(214 60% 96%);
  --bg-header: hsl(214 52% 80%);
  --border: hsl(214 35% 82%);
  --text-primary: hsl(222 47% 11%);
  --text-secondary: hsl(215 25% 32%);
  --text-muted: hsl(215 20% 46%);
  --white: #FFFFFF;
  --badge-active: #2E8B57;
  --badge-active-bg: #D4EDDA;
  --badge-closed: #C0392B;
  --badge-closed-bg: #F5D5D5;
  --success: #2E8B57;
  --success-bg: #D4EDDA;
  --vote-no: #D4850A;
  --vote-info: hsl(215 20% 46%);
  --shadow-card: 0 6px 20px -6px rgba(15, 23, 42, 0.18);
}

/* ===== Design Tokens (Dark) — paleta HSL de DiarioBOE ===== */
[data-theme="dark"] {
  --accent: hsl(217 92% 65%);
  --accent-hover: hsl(217 92% 73%);
  --accent-subtle: hsl(217 40% 26%);
  --bg-page: hsl(222 32% 14%);
  --bg-card: hsl(222 30% 22%);
  --bg-elevated: hsl(222 24% 28%);
  --bg-header: hsl(222 35% 12%);
  --border: hsl(222 28% 20%);
  --text-primary: hsl(214 40% 96%);
  --text-secondary: hsl(215 18% 74%);
  --text-muted: hsl(215 16% 60%);
  --white: hsl(214 40% 96%);
  --badge-active: #3EA86C;
  --badge-active-bg: #1C3328;
  --badge-closed: #E05545;
  --badge-closed-bg: #3A2228;
  --success: #3EA86C;
  --success-bg: #1C3328;
  --vote-no: #F0993E;
  --vote-info: hsl(215 16% 60%);
  --shadow-card: 0 10px 26px rgba(0, 0, 0, 0.55);
}

/* ===== Reset ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== Base ===== */
html {
  color-scheme: light;
}

[data-theme="dark"] {
  color-scheme: dark;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  display: block;
}

/* ===== Typography ===== */
h1 {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.25;
  color: var(--text-primary);
}

h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.4;
  color: var(--text-primary);
}

h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ===== Header ===== */
.site-header {
  width: 100%;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Isotipo DB — enlaza a DiarioBOE (marca matriz) */
.logo-badge {
  display: inline-flex;
  flex-shrink: 0;
  border-radius: 8px;
  transition: opacity 0.15s, transform 0.15s;
}

.logo-badge:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.logo-badge svg {
  width: 34px;
  height: 34px;
  display: block;
}

/* Wordmark "Votaciones" — bitono estilo DiarioBOE (Diario+BOE) */
.logo-word {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.8px;
  text-decoration: none;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.logo-word:hover {
  opacity: 0.8;
}

/* "Vota" en azul claro */
.logo-word .lw-dark {
  color: hsl(213 90% 64%);
}

/* "ciones" en navy; en oscuro adapta al primer plano claro */
.logo-word .lw-blue {
  color: #1e3a5f;
}

[data-theme="dark"] .logo-word .lw-blue {
  color: var(--text-primary);
}

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

.nav-link {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link.active {
  color: var(--accent);
  font-weight: 500;
}

/* ===== Theme Toggle ===== */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.theme-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* ===== Main Content ===== */
main {
  flex: 1;
  width: 100%;
}

.page-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-header .subtitle {
  font-size: 15px;
  color: var(--text-muted);
}

/* ===== Footer ===== */
.site-footer {
  width: 100%;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-inner p {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

.footer-links a {
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* ===== Info Banner ===== */
.info-banner {
  border-radius: 10px;
  background: var(--accent-subtle);
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.info-banner i,
.info-banner > svg {
  flex-shrink: 0;
  color: var(--accent);
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.info-banner .banner-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-banner .banner-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.info-banner p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.info-banner a {
  color: var(--accent);
  font-weight: 500;
}

.info-banner a:hover {
  text-decoration: underline;
}

/* ===== About Author ===== */

.about-author-card {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  padding: 28px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.about-author-info h2 {
  margin: 0 0 12px 0;
  font-size: 22px;
}

.about-author-info p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 8px 0;
}

.about-author-links {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
}

.about-author-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.about-author-links a:hover {
  color: var(--accent);
}

.about-author-links svg {
  width: 20px;
  height: 20px;
}

.about-author-photo {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .about-author-card {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
  }

  .about-author-links {
    justify-content: center;
  }

  .about-author-photo {
    width: 110px;
    height: 110px;
  }
}

/* ===== Voter Counter (header) ===== */
.voter-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 10px;
  background: var(--bg-elevated);
  border-radius: 99px;
}

.voter-counter i,
.voter-counter svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
  flex-shrink: 0;
}

.voter-counter strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* ===== Badge ===== */
.badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-active {
  background: var(--badge-active-bg);
  color: var(--badge-active);
}

.badge-closed {
  background: var(--badge-closed-bg);
  color: var(--badge-closed);
}

/* ===== Voting Card ===== */
.voting-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.voting-card {
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}

.voting-card:hover {
  box-shadow: 0 12px 28px -8px rgba(15, 23, 42, 0.28);
  transform: translateY(-2px);
}

.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.card-top {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
}

.card-description {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.card-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.card-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  transition: opacity 0.15s;
}

.card-link:hover {
  opacity: 0.8;
}

.card-link-secondary {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
  transition: color 0.15s;
}

.card-link-secondary:hover {
  color: var(--text-secondary);
}

/* ===== Featured Card ===== */
.voting-card.featured {
  grid-column: 1 / -1;
  flex-direction: row;
}

.voting-card.featured .card-body {
  padding: 32px;
  gap: 16px;
  flex: 1;
}

.voting-card.featured .card-title {
  font-size: 24px;
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.voting-card.featured .card-description {
  font-size: 15px;
  line-height: 1.7;
}

.voting-card.featured .card-footer {
  border-top: none;
  border-left: 1px solid var(--border);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 32px 48px;
  gap: 16px;
  margin-top: 0;
}

.voting-card.featured .card-link {
  font-size: 15px;
}

@media (max-width: 768px) {
  .voting-card.featured {
    flex-direction: column;
  }

  .voting-card.featured .card-footer {
    border-left: none;
    border-top: 1px solid var(--border);
    flex-direction: row;
    padding: 14px 24px;
  }
}

/* ===== Back Link ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.back-link i,
.back-link svg {
  width: 16px;
  height: 16px;
}

.back-link:hover {
  color: var(--text-primary);
}

/* ===== Subtitle ===== */
.subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.text-muted {
  color: var(--text-muted);
}

/* ===== Vote Card (form container) ===== */
.vote-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--shadow-card);
}

.vote-card h3 {
  margin-bottom: 20px;
}

/* ===== Vote Options ===== */
.vote-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.vote-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  user-select: none;
}

.vote-option:hover {
  border-color: var(--accent);
}

.vote-option.selected {
  border: 2px solid var(--accent);
  background: var(--accent-subtle);
  box-shadow: 0 0 0 1px var(--accent);
}

.vote-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.vote-option.selected .radio-circle {
  border-color: var(--accent);
}

.vote-option.selected .radio-circle::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.option-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ===== Button ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

/* ===== Context Section ===== */
.context-section {
  border-top: 1px solid var(--border);
  padding-top: 32px;
}

.section-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.context-body p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 16px;
}

.context-body p:last-child {
  margin-bottom: 0;
}

/* ===== Results Card ===== */
.results-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.hemicycle-container {
  width: 500px;
  max-width: 100%;
}

.hemicycle-svg {
  width: 100%;
  height: auto;
}

.results-legend {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  width: 100%;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===== Alerts ===== */
.alert {
  padding: 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
}

.alert-error {
  background: var(--badge-closed-bg);
  color: var(--badge-closed);
}

.alert-info {
  background: var(--accent-subtle);
  color: var(--accent);
}

/* ===== Cert Warning ===== */
.cert-warning {
  background: var(--accent-subtle);
  border-radius: 10px;
  padding: 28px;
}

.cert-warning h2 {
  color: var(--accent);
  margin-bottom: 8px;
}

.cert-warning p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ===== Como Funciona Page ===== */
.como-funciona {
  gap: 56px !important;
}

.hero-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 720px;
}

.section-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 760px;
  margin-top: 10px;
  margin-bottom: 28px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-card h3 {
  font-size: 17px;
}

.step-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.divider {
  border: none;
  height: 1px;
  background: var(--border);
}

.principles-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.principle-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.principle-icon {
  color: var(--accent);
  width: 28px;
  height: 28px;
}

.principle-card h3 {
  font-size: 16px;
}

.principle-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.anonymity-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.anon-steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.anon-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-icon {
  color: var(--accent);
  width: 24px;
  height: 24px;
}

.anon-step-card h3 {
  font-size: 15px;
}

.anon-step-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.anon-highlight-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.anon-highlight-card {
  background: var(--accent-bg, rgba(37, 99, 235, 0.06));
  border: 1px solid var(--accent, #2563eb);
  border-radius: 12px;
  padding: 24px;
}

.anon-highlight-card > svg,
.anon-highlight-card > i {
  color: var(--accent, #2563eb);
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
}

.anon-highlight-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.anon-highlight-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (max-width: 600px) {
  .anon-highlight-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Legal Page ===== */
.legal-page {
  display: block;
  max-width: 820px;
  margin: 0 auto;
  line-height: 1.8;
}

.legal-page h1 {
  text-align: center;
  font-size: 40px;
  margin-bottom: 8px;
}

.legal-page h2 {
  font-family: var(--font-sans);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--accent);
  margin-top: 48px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.legal-page h2:first-of-type {
  margin-top: 24px;
}

.legal-page h3 {
  font-size: 19px;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 10px;
}

.legal-page p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 14px;
}

.legal-page strong {
  color: var(--text-primary);
}

.legal-page ul,
.legal-page ol {
  padding-left: 20px;
  margin-bottom: 12px;
}

.legal-page li {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 8px;
}

.legal-page li strong {
  color: var(--text-primary);
}

.legal-page code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  background: var(--accent-subtle);
  color: var(--text-primary);
  padding: 2px 7px;
  border-radius: 5px;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 64px 16px;
  color: var(--text-muted);
}

/* ===== Utility classes (replacing inline styles for CSP) ===== */
.hidden { display: none; }

/* Utilidades (evitan style= inline, bloqueado por la CSP) */
.mb-20 { margin-bottom: 20px; }
.mb-16 { margin-bottom: 16px; }
.mt-8 { margin-top: 8px; }
.mt-6 { margin-top: 6px; }
.fw-bold { font-weight: 700; }
.fs-12 { font-size: 12px; }
.text-center { text-align: center; }
.empty-placeholder { text-align: center; padding: 3rem 1rem; }
.btn-inline-link { display: inline-block; margin-top: 1rem; text-decoration: none; }

/* Legend dot color variants */
.legend-dot--accent { background: var(--accent); }
.legend-dot--no { background: var(--vote-no); }
.legend-dot--info { background: var(--vote-info); }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .steps-grid,
  .anon-steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .page-content {
    padding: 32px 16px;
  }

  .header-inner {
    padding: 14px 16px;
  }

  h1 {
    font-size: 24px;
  }

  .hero-title {
    font-size: 28px;
  }

  h2 {
    font-size: 20px;
  }

  .voting-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .principles-grid {
    grid-template-columns: 1fr;
  }

  .hemicycle-container {
    width: 100%;
  }

  .results-legend {
    gap: 16px;
  }

  .como-funciona {
    gap: 40px !important;
  }
}

@media (max-width: 480px) {
  .header-nav {
    gap: 16px;
  }

  .nav-link {
    font-size: 13px;
  }

  .page-content {
    padding: 24px 16px;
  }

  .voting-grid,
  .steps-grid,
  .anon-steps-grid {
    grid-template-columns: 1fr;
  }

  .info-banner {
    flex-direction: column;
    gap: 10px;
  }

  .vote-card {
    padding: 20px;
  }
}

/* ===== Admin Panel ===== */

.admin-login {
  max-width: 400px;
  margin: 80px auto;
}

.admin-panel {
  max-width: 900px;
  margin: 30px auto;
  padding: 0 20px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-header h2 {
  font-size: 22px;
  color: var(--text-primary);
}

.admin-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.admin-status-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.admin-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

/* ── Admin Form ─── */

.admin-form .field-group {
  margin-bottom: 18px;
}

.admin-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form textarea,
.admin-form select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
}

.admin-form input:disabled,
.admin-form textarea:disabled,
.admin-form select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.admin-form textarea {
  resize: vertical;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* ── Options list ── */

.option-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.option-row .option-input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
}

.option-row .option-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.btn-remove {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--badge-closed);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-remove:hover {
  background: var(--badge-closed-bg);
}

/* ── Admin Table ── */

.table-wrapper {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 8px 12px;
  border-bottom: 2px solid var(--border);
}

.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-primary);
}

.admin-table tr:hover td {
  background: var(--bg-elevated);
}

/* ── Admin Buttons ── */

.btn-primary {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  padding: 10px 20px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-secondary:hover {
  background: var(--bg-elevated);
}

.btn-danger {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: var(--badge-closed);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.btn-link:hover {
  text-decoration: underline;
}

/* ── Status row ── */

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

.status-row select {
  flex: 1;
  max-width: 250px;
}

/* ── Tally display ── */

.tally-display {
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: 12px 16px;
}

.tally-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-primary);
}

.tally-row + .tally-row {
  border-top: 1px solid var(--border);
}

/* ── Alerts ── */

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
}

/* ── Badge draft ── */

.badge-draft {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-elevated);
  color: var(--text-muted);
}
