/* ====== Base (LIGHT THEME) ====== */
:root {
  --green: #2ecc71;
  --blue: #3498db;
  --ink: #0f172a;
  --muted: #6b7280;
  --bg: #f7fafc;
  --card: #ffffff;
  --ring: rgba(52, 152, 219, 0.25);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji';
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

.container { width: min(100%, 1080px); margin-inline: auto; padding: 1.25rem; }

/* ====== Header ====== */
.site-header.light {
  background: linear-gradient(135deg, rgba(52,152,219,.1), rgba(46,204,113,.1)), #ffffff;
  border-bottom: 1px solid #eaecef;
}
.header-container {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: .95rem; text-decoration: none; color: inherit;
}
.brand-logo {
  width: 88px; height: 88px; object-fit: contain; display: block;
  border-radius: 14px; background: #fff; box-shadow: 0 6px 24px rgba(52,152,219,.2);
}
.brand-text { display: flex; flex-direction: column; }
.brand-title { font-weight: 800; font-size: clamp(1.25rem, 3vw, 1.75rem); letter-spacing: -0.02em; }
.brand-sub { font-size: .95rem; color: var(--muted); }

/* ====== Country buttons ====== */
.country-select { display: flex; gap: .4rem; flex-wrap: wrap; }
.country-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  background: #ffffff; color: var(--ink); border: 1px solid #e5e7eb;
  border-radius: 999px; padding: .45rem .7rem; font-weight: 700; cursor: pointer;
  transition: transform .08s ease, background .2s ease, border-color .2s ease; user-select: none;
}
.country-btn[aria-selected="true"] { background: linear-gradient(90deg, #3498db, #2ecc71); color: white; border-color: transparent; }
.country-btn:hover { transform: translateY(-1px); }
.flag-img { width: 22px; height: 16px; border-radius: 3px; display: inline-block; object-fit: cover; box-shadow: 0 2px 8px rgba(0,0,0,.08); }

.notice { margin-top: .5rem; color: var(--muted); }

/* ====== Cards ====== */
.card { background: var(--card); border: 1px solid #e5e7eb; border-radius: 14px; padding: 1.25rem; margin: 1rem 0; box-shadow: 0 6px 22px rgba(0,0,0,0.05); }
.card h2 { margin-top: 0; font-size: 1.15rem; }
.badge { background: #eef2ff; color: #3730a3; padding: .2rem .5rem; border-radius: 999px; font-size: .8rem; margin-left: .35rem; }
.helper { color: var(--muted); margin-top: -.25rem; }

/* ====== Forms ====== */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: .75rem; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: .9rem; color: var(--muted); }

input[type="number"] {
  padding: .7rem .8rem; border: 1px solid #d1d5db; border-radius: 10px; font-size: 1rem; outline: none; background: #fff; transition: box-shadow .2s, border-color .2s;
}
input[type="number"]:focus { border-color: var(--blue); box-shadow: 0 0 0 4px var(--ring); }

.actions { display: flex; align-items: end; gap: .5rem; }

.btn { padding: .7rem 1rem; border: none; border-radius: 10px; cursor: pointer; font-weight: 700; }
.btn.primary { background: linear-gradient(90deg, #3498db, #2ecc71); color: white; }
.btn.secondary { background: var(--green); color: white; }
.btn.ghost { background: transparent; border: 1px solid #d1d5db; color: var(--ink); }

.result { margin-top: .9rem; padding: .9rem 1rem; background: #f8fafc; border: 1px dashed #d1d5db; border-radius: 10px; min-height: 48px; display: flex; align-items: center; font-weight: 600; color: var(--ink); }

/* ====== Performance Bar ====== */
.bar-wrapper { margin-top: .75rem; }
.bar-bg { width: 100%; height: 14px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #2ecc71, #3498db); transition: width .5s ease; }
.bar-label { margin-top: .35rem; font-size: .9rem; color: var(--muted); }

/* ====== Ponderador ====== */
.ponderador-list { display: grid; gap: 8px; margin-top: .75rem; }
.ponder-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.ponder-row .field { margin: 0; }
.remove-btn { border: 1px solid #ef4444; color: #ef4444; background: white; border-radius: 10px; padding: .5rem .7rem; cursor: pointer; }
.remove-btn:hover { background: #fee2e2; }
.ponder-actions { display: flex; align-items: center; justify-content: space-between; margin-top: .75rem; }

/* ====== Share ====== */
.share-feedback { margin-left: .75rem; font-size: .9rem; color: var(--muted); }

/* ====== Footer ====== */
.site-footer { margin-top: 1rem; padding: 2rem 0 3rem; text-align: center; color: var(--muted); }

/* ====== Responsive ====== */
@media (max-width: 860px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .actions { margin-top: .25rem; }
  .ponder-row { grid-template-columns: 1fr 1fr auto; }
  .brand-logo { width: 72px; height: 72px; }
}
