:root {
  --bg: #0b1220;
  --bg2: #121a2b;
  --card: #172033;
  --line: #27324a;
  --text: #eef3ff;
  --muted: #9aabC7;
  --accent: #22c55e;
  --accent2: #16a34a;
  --warn: #fbbf24;
  --danger: #f87171;
  --blue: #38bdf8;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 600px at 10% -10%, #1a2a4a 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100%;
}

body {
  padding: 0 0 40px;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
}

header {
  padding: 8px 4px 18px;
}

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

/* Logo: imagen en frontend/logo.png (fondo negro) */
.logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  box-shadow: var(--shadow);
  background: #000;
  flex-shrink: 0;
}

h1 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.card {
  background: linear-gradient(180deg, var(--card), var(--bg2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

input,
select,
button {
  font: inherit;
}

input[type="text"],
input[type="number"],
select {
  background: #0d1526;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  width: 100%;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--blue);
}

.grow {
  flex: 1;
  min-width: 120px;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  color: #04210f;
}

.btn-secondary {
  background: #22304a;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-ghost {
  background: transparent;
  color: var(--blue);
  padding: 8px 10px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.best {
  display: grid;
  gap: 6px;
}

.best .price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
}

.best .meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: #1f2b44;
  color: var(--muted);
  border: 1px solid var(--line);
}

.badge.user {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent);
  border-color: rgba(34, 197, 94, 0.35);
}

.badge.estimate {
  background: rgba(251, 191, 36, 0.12);
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.3);
}

.badge.eia {
  background: rgba(56, 189, 248, 0.12);
  color: var(--blue);
  border-color: rgba(56, 189, 248, 0.35);
}

.station {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.station:last-child {
  border-bottom: 0;
}

.station-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.station-name {
  font-weight: 700;
  margin: 0 0 2px;
}

.station-sub {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0;
}

.station-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}

.station-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.best-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.best-actions .grow {
  flex: 1;
  min-width: 120px;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #1c2740;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  z-index: 80;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.toast.show {
  opacity: 1;
}

.rank {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #1c2740;
  display: inline-grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  margin-right: 8px;
}

.rank.gold {
  background: rgba(34, 197, 94, 0.2);
  color: var(--accent);
}

.loading,
.empty,
.error {
  text-align: center;
  color: var(--muted);
  padding: 18px 8px;
}

.error {
  color: var(--danger);
}

.disclaimer {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 8px;
}


.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  padding: 12px;
}

.modal-bg.open {
  display: flex;
}

.modal {
  width: min(520px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px 18px 14px 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.modal h3 {
  margin: 0 0 10px;
}

.modal .row {
  margin-top: 10px;
}

footer,
.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 12px;
  line-height: 1.55;
  padding: 8px 4px 16px;
}

.site-footer strong {
  color: var(--text);
  font-weight: 600;
}

.site-footer a {
  color: var(--blue);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (min-width: 600px) {
  .app {
    padding-top: 24px;
  }
}
