:root {
  --page: #0d0d0d;
  --surface: #171a21;
  --border: rgba(255, 255, 255, 0.10);
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --gold: #d4af37;
  --accent: #3987e5;
}

* { box-sizing: border-box; }

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

.site-header {
  padding: 22px 16px 14px;
  text-align: center;
}

.site-header h1 {
  margin: 0 0 4px;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}

.brand-eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.country-nav {
  max-width: 480px;
  margin: 0 auto 8px;
  padding: 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.78rem;
}

.country-nav a {
  color: var(--text-secondary);
  text-decoration: none;
}

.country-nav a:hover { color: var(--gold); }

.country-nav .nav-current {
  color: var(--gold);
  font-weight: 600;
}

.intro-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

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

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

.country-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.15s ease;
}

.country-card:hover { border-color: var(--gold); }

.country-flag { font-size: 1.05rem; }

.country-name {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.faq {
  padding: 4px 4px 0;
}

.faq h2 {
  font-size: 1.1rem;
  margin: 0 0 12px;
}

.faq-item {
  margin-bottom: 16px;
}

.faq-item h3 {
  font-size: 0.92rem;
  margin: 0 0 4px;
  color: var(--text-primary);
}

.faq-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.field { margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }

.field label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.pais-summary {
  margin: 6px 2px 0;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.field input, .field select {
  width: 100%;
  padding: 9px 12px;
  background: #0f1115;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

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

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23898781' stroke-width='1.5' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 34px;
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: #0f1115;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 12px;
}

.mode-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 6px;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}

.mode-btn.is-active {
  background: var(--gold);
  color: #151515;
}

.btn-primary {
  width: 100%;
  padding: 11px;
  background: var(--gold);
  color: #151515;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  font-family: inherit;
}

.btn-primary:hover { opacity: 0.92; }

/* Resultado */

.hero {
  text-align: center;
  padding-bottom: 18px;
}

.hero-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.hero-value {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.02em;
}

.stackbar {
  display: flex;
  height: 20px;
  border-radius: 10px;
  overflow: hidden;
  background: #0f1115;
  margin-bottom: 14px;
}

.stackbar span {
  height: 100%;
  border-right: 2px solid var(--surface);
}

.stackbar span:last-child { border-right: none; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 18px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.detail-toggle {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.detail-toggle summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-toggle summary:hover { color: var(--text-primary); }

.breakdown { margin: 14px 0 0; }

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.row dt { color: var(--text-secondary); font-weight: normal; }
.row dd { margin: 0; font-weight: 500; text-align: right; }

.row-total {
  border-bottom: none;
  border-top: 1px solid var(--border);
  margin-top: 2px;
  padding-top: 12px;
}

.row-total dt, .row-total dd {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
}

.indicadores {
  margin: 16px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.site-footer {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 40px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.footer-links {
  margin-top: 10px !important;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

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

.legal-content {
  max-width: none;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.legal-content h2 {
  color: var(--text-primary);
  font-size: 1rem;
  margin: 20px 0 8px;
}

.legal-content h2:first-child { margin-top: 0; }

.legal-content a { color: var(--gold); }
