/* Reset, topbar, tipografía y layout responsive */
:root {
  --bg: #F8F8F6;
  --text: #222;
  --muted: #666;
  --blue: #1565C0;
  --blue-dark: #0D47A1;
  --gold: #F5C842;
  --green: #6AAA64;
  --topbar-h: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; cursor: pointer; }
ul, ol { margin: 0; padding: 0; }

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: #fff;
  border-bottom: 1px solid #e3e3e0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}
.topbar-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
  justify-self: start;
}
.topbar-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
}
.topbar-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}
.lang-switch { display: inline-flex; border: 1.5px solid #d0d0d0; border-radius: 8px; overflow: hidden; }
.lang-btn { border: 0; background: #fff; padding: 5px 9px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.lang-btn.active { background: var(--blue); color: #fff; }
.btn-help {
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  padding: 7px 12px;
}
.btn-help:hover { background: var(--blue-dark); }

.main-wrapper {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 12px 40px;
}

/* Modales */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .5);
}
.modal-card {
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  padding: 22px 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
}
.modal-card h2 { margin: 0 0 12px; font-size: 1.3rem; }
.modal-card ol { padding-left: 20px; margin-bottom: 16px; }
.modal-card li { margin-bottom: 6px; }
.btn-primary {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  padding: 10px 18px;
  text-decoration: none;
  text-align: center;
}
.btn-primary:hover { background: var(--blue-dark); }

@media (max-width: 480px) {
  .topbar-logo span { display: none; }
  .topbar-title { font-size: 1.1rem; }
  .btn-help { padding: 6px 9px; font-size: .78rem; }
}
