:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --card-alt: #f9fafb;
  --accent: #ffcb05;
  --accent-soft: rgba(255, 203, 5, 0.12);
  --text: #111827;
  --text-soft: #6b7280;
  --danger: #e11d48;
  --radius-lg: 18px;
  --radius-md: 10px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.15);
  --border-subtle: 1px solid rgba(15, 23, 42, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
}

/* Fondo suave */

.gradient-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 203, 5, 0.15) 0, transparent 55%),
    radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.12) 0, transparent 55%);
  opacity: 1;
  z-index: -1;
}

.app-shell {
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px 16px 80px;
}

/* Header */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 18px;
}

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

.logo-img-wrap {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--accent);
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 13px;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-soft);
}

/* Nav */

.nav {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 12px;
}

.nav a {
  color: var(--text-soft);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.nav a:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
  transform: translateY(-1px);
}

.nav-cta {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #111827;
  color: #f9fafb;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 16px;
  align-items: stretch;
}

.hero-main {
  border-radius: var(--radius-lg);
  border: var(--border-subtle);
  background: linear-gradient(135deg, #ffffff, #fff7d1);
  padding: 22px 18px 18px;
  box-shadow: var(--shadow-soft);
}

.hero-main h1 {
  margin: 0 0 10px;
  font-size: 24px;
}

.hero-main p {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.hero-hint {
  margin: 0;
  font-size: 11px;
  color: var(--text-soft);
}

.hero-side {
  display: flex;
}

.hero-card {
  border-radius: var(--radius-lg);
  border: var(--border-subtle);
  background: #ffffff;
  padding: 18px 16px 14px;
  width: 100%;
  box-shadow: var(--shadow-soft);
}

.hero-card h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

/* Summary cards (con banderas) */

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.summary-card {
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: #ffffff;
  padding: 10px 10px 8px;
  font-size: 12px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.summary-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  border-color: var(--accent);
}

.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.flag {
  font-size: 22px; /* banderita grande */
  filter: drop-shadow(0 2px 3px rgba(15, 23, 42, 0.3));
}

.summary-card .code {
  font-weight: 700;
  font-size: 13px;
}

.summary-card .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.summary-card .value {
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  font-weight: 500;
}

.summary-foot {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--text-soft);
}

/* Buttons */

.btn-primary,
.btn-secondary,
.btn-ghost {
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease,
    color 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #ffd84c, #ffcb05);
  color: #111827;
  box-shadow: 0 8px 20px rgba(234, 179, 8, 0.45);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(234, 179, 8, 0.55);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-soft);
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.btn-secondary:hover {
  background: #f9fafb;
}

.btn-ghost {
  background: transparent;
  color: #111827;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.btn-ghost.small {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-primary.full {
  width: 100%;
  margin-top: 4px;
}

/* Cards generales */

.card {
  border-radius: var(--radius-lg);
  border: var(--border-subtle);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  padding: 18px 16px 16px;
}

.main-card {
  position: relative;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-header h2 {
  font-size: 18px;
  margin: 0;
}

.badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.badge.realtime {
  background: var(--accent-soft);
  color: #854d0e;
}

.subtitle {
  margin: 8px 0 14px;
  font-size: 12px;
  color: var(--text-soft);
}

/* Tabla tasas */

.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.search-wrapper {
  flex: 1;
}

#filter-input,
#search-input,
input[type="password"],
input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
}

input::placeholder {
  color: rgba(148, 163, 184, 0.8);
}

.table-wrapper {
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #ffffff;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead {
  background: #f9fafb;
}

th,
td {
  padding: 10px 12px;
  text-align: left;
}

th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  border-bottom: 1px solid rgba(148, 163, 184, 0.5);
}

tbody tr:nth-child(odd) {
  background: #ffffff;
}

tbody tr:nth-child(even) {
  background: #f9fafb;
}

tbody tr {
  transition: background 0.12s ease, transform 0.08s ease,
    box-shadow 0.12s ease;
}

tbody tr:hover {
  background: #fffbeb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

td:first-child {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

td:first-child .flag {
  font-size: 18px;
}

td:nth-child(2),
td:nth-child(3) {
  font-variant-numeric: tabular-nums;
}

.last-update {
  margin: 10px 2px 0;
  font-size: 11px;
  color: var(--text-soft);
}

/* Search card */

.search-card {
  background: var(--card-alt);
}

/* Historial demo */

.history-card {
  background: #ffffff;
}

.history-content {
  margin-top: 10px;
}

.history-legend {
  font-size: 11px;
  color: var(--text-soft);
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}

.dot.usd {
  background: #fbbf24;
}

.dot.eur {
  background: #0ea5e9;
}

.history-chart {
  position: relative;
  height: 140px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  overflow: hidden;
  background: linear-gradient(135deg, #f9fafb, #fefce8);
}

.history-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      to right,
      rgba(148, 163, 184, 0.15) 1px,
      transparent 1px
    ),
    linear-gradient(
      to bottom,
      rgba(148, 163, 184, 0.15) 1px,
      transparent 1px
    );
  background-size: 14.28% 100%, 100% 33%;
  opacity: 0.7;
}

.history-line {
  position: absolute;
  inset: 10px 4px 22px 4px;
  border-radius: 999px;
  opacity: 0.9;
}

.usd-line {
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.2), #facc15);
  box-shadow: 0 0 14px rgba(234, 179, 8, 0.6);
  transform-origin: left center;
  animation: linePulse 3s ease-in-out infinite;
}

.eur-line {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.2), #0ea5e9);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.6);
  transform-origin: left center;
  animation: linePulse 3s ease-in-out infinite;
  animation-delay: 0.6s;
}

.history-labels {
  position: absolute;
  inset: auto 8px 6px 8px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-soft);
}

/* Info & map & testimonials */

.info-card {
  background: var(--card-alt);
}

.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 18px;
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 10px;
  font-size: 13px;
}

.info-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 4px;
  color: var(--text-soft);
}

.info-list span:first-child {
  font-size: 16px;
}

.info-list a {
  color: #111827;
  font-weight: 500;
  text-decoration: none;
}

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

.info-text {
  font-size: 13px;
  color: var(--text-soft);
  margin: 4px 0 0;
}

.bullet-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-soft);
}

.bullet-list li {
  margin-bottom: 4px;
}

.calc-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: #ffffff;
  padding: 12px 12px 14px;
}

.calc-sub {
  font-size: 12px;
  color: var(--text-soft);
  margin: 0 0 8px;
}

.calc-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
  gap: 4px;
}

.calc-row label {
  font-size: 12px;
  color: var(--text-soft);
}

.toggle-row span {
  font-size: 12px;
  color: var(--text-soft);
}

.toggle-group {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.toggle-group label {
  font-size: 11px;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 4px;
}

.toggle-group input[type="radio"] {
  accent-color: #facc15;
}

.calc-resultado {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-soft);
  min-height: 18px;
}

/* Testimonials */

.testimonials-card {
  background: #ffffff;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.testimonial {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: #ffffff;
  padding: 12px 12px 10px;
  position: relative;
  overflow: hidden;
}

.testimonial::before {
  content: "“";
  position: absolute;
  top: -12px;
  right: 10px;
  font-size: 40px;
  color: rgba(234, 179, 8, 0.35);
}

.quote {
  font-size: 12px;
  margin: 0 0 8px;
  color: var(--text-soft);
}

.author {
  font-size: 11px;
  color: #854d0e;
}

/* Map */

.map-card {
  background: var(--card-alt);
}

.map-wrapper {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.7);
  box-shadow: var(--shadow-soft);
  margin-top: 10px;
}

.map-wrapper iframe {
  width: 100%;
  height: 260px;
  border: 0;
}

/* Footer */

.footer {
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 16px 18px;
  font-size: 11px;
  color: var(--text-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-main {
  display: flex;
  flex-direction: column;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.footer-links a {
  color: #111827;
  text-decoration: none;
  font-size: 11px;
}

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

/* FAB */

.fab {
  position: fixed;
  right: 16px;
  bottom: 20px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: none;
  background: linear-gradient(135deg, #ffd84c, #ffcb05);
  color: #111827;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 16px 40px rgba(234, 179, 8, 0.6);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 50px rgba(234, 179, 8, 0.75);
}

/* Modales */

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(6px);
}

.modal-content {
  position: relative;
  z-index: 40;
  width: min(420px, 92vw);
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-soft);
}

.modal-content.wide {
  width: min(540px, 96vw);
}

.modal-content h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.modal-text {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-soft);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.hint {
  font-size: 11px;
  color: var(--text-soft);
  margin: 4px 0 0;
}

.error-text {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--danger);
}

.error-text.hidden {
  display: none;
}

.admin-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.admin-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: 6px;
  align-items: center;
}

.admin-row label {
  font-size: 12px;
  color: var(--text-soft);
}

.status-text {
  font-size: 12px;
  min-height: 16px;
  color: var(--text-soft);
}

.admin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.extra-title {
  margin-top: 10px;
  font-size: 14px;
}

.extra-grid .admin-row:first-child {
  grid-template-columns: 80px 1fr 1fr;
}

.extra-help {
  font-size: 11px;
  color: var(--text-soft);
}

/* Animaciones base */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes linePulse {
  0% {
    transform: scaleX(0.85);
    opacity: 0.7;
  }
  50% {
    transform: scaleX(1);
    opacity: 1;
  }
  100% {
    transform: scaleX(0.9);
    opacity: 0.8;
  }
}

.fade-in-up {
  animation: fadeInUp 0.5s ease-out both;
}

.fade-in-down {
  animation: fadeInDown 0.5s ease-out both;
}

.float-up {
  animation: floatUp 0.6s ease-out both;
}

.float-up-delayed {
  animation: floatUp 0.6s ease-out 0.15s both;
}

/* Responsive */

@media (max-width: 800px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-side {
    order: -1;
  }
}

@media (max-width: 720px) {
  .nav {
    display: none;
  }
  .info-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .map-wrapper iframe {
    height: 220px;
  }
  .testimonials-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
