/* ═══════════════════════════════════════════════════
   DOLARIO.MX — Estilos Premium
   ═══════════════════════════════════════════════════ */

/* ── Variables de la Suite Premium ── */
:root {
  /* Paleta de Colores Finanzas Modernas */
  --bg-app: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-element: #F1F5F9;

  --primary-core: #0F204C;
  /* Navy Azul Oscuro para la marca */
  --primary-text: #1E3A8A;
  /* Soft Blue para texto */
  --secondary-text: #64748B;
  /* Slate light */

  --brand-blue: #2563EB;
  --brand-blue-hover: #1D4ED8;
  --brand-blue-light: #EFF6FF;

  --brand-green: #10B981;
  --brand-green-hover: #059669;
  --brand-green-light: #ECFDF5;

  --brand-red: #EF4444;
  --brand-red-light: #FEF2F2;

  --border-light: rgba(15, 23, 42, 0.08);
  --border-focus: rgba(37, 99, 235, 0.4);

  /* Sombras Modernas (Suaves y Difuminadas) */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 20px 40px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 24px rgba(37, 99, 235, 0.15);

  /* Radios */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* Transiciones */
  --ease-out: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset y Base ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-app);
  color: var(--primary-text);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Numeración tabular para precios */
.tabular {
  font-variant-numeric: tabular-nums;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Layout Global y Helpers ── */
.hide-mobile {
  display: table-cell;
}

/* ── Ticker Animado (En Vivo) ── */
.ticker-bar {
  background: var(--primary-core);
  color: white;
  padding: 8px 0;
  overflow: hidden;
  position: relative;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ticker-track {
  display: flex;
  white-space: nowrap;
  will-change: transform;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 32px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.ticker-item .lbl {
  opacity: 0.6;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ticker-item .val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.t-up {
  color: #86EFAC;
}

.t-dn {
  color: #FCA5A5;
}

/* ── Header ── */
header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow var(--ease-out);
}

header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-core);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--brand-green);
}

nav ul {
  display: flex;
  gap: 8px;
  list-style: none;
}

nav a {
  color: var(--secondary-text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  transition: all var(--ease-out);
}

nav a:hover,
nav a.active {
  color: var(--brand-blue);
  background: var(--brand-blue-light);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-green-light);
  color: var(--brand-green);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.dot {
  width: 6px;
  height: 6px;
  background: var(--brand-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--brand-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Menú Mobile */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: var(--bg-element);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  padding: 10px;
  width: 44px;
  height: 44px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--primary-core);
  border-radius: 2px;
  transition: transform var(--ease-spring), opacity var(--ease-out);
  margin: 0 auto;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Botones ── */
.btn-primary {
  background: var(--primary-core);
  color: white;
  padding: 16px 28px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: all var(--ease-spring);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: var(--brand-blue-hover);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--primary-core);
  padding: 16px 28px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: all var(--ease-spring);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border-light);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: var(--primary-core);
  background: var(--bg-app);
  transform: translateY(-2px);
}

.btn-ir {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--brand-blue-light);
  color: var(--brand-blue);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all var(--ease-out);
  white-space: nowrap;
}

.btn-ir:hover {
  background: var(--brand-blue);
  color: white;
}

/* ── Avisos ── */
.fallback-warning {
  background: var(--brand-red-light);
  color: var(--brand-red);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 20px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.fallback-warning a {
  color: var(--brand-red);
  text-decoration: underline;
}

/* ── Animaciones Base ── */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.6s var(--ease-spring) forwards;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Estructura Común ── */
.sec-lbl {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-blue);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.sec-title {
  font-size: 36px;
  font-weight: 800;
  color: var(--primary-core);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.sec-desc {
  color: var(--secondary-text);
  font-size: 18px;
  margin-bottom: 48px;
  line-height: 1.6;
  max-width: 600px;
}

/* AdSense */
.ad-slot {
  background: transparent;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  color: var(--secondary-text);
  font-size: 11px;
  text-transform: uppercase;
  margin: 32px auto;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════
   INDEX
   ═══════════════════════════════════════════════════ */
.hero {
  background: radial-gradient(circle at top left, #EFF6FF 0%, #FFFFFF 40%, #F8FAFC 100%);
  padding: 80px 0 100px;
  border-bottom: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  right: -10%;
  top: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.05) 0%, transparent 70%);
  z-index: 0;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  color: var(--primary-core);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 56px;
  font-weight: 800;
  color: var(--primary-core);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.hero h1 span {
  color: var(--brand-blue);
}

.hero-desc {
  color: var(--secondary-text);
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Tarjeta Principal de TC */
.rate-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  position: relative;
}

.rate-card::before {
  display: none;
}

.rate-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.rate-card-lbl {
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary-text);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.rate-src {
  font-size: 12px;
  color: var(--brand-blue);
  background: var(--brand-blue-light);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
}

.rate-big {
  font-size: 72px;
  font-weight: 800;
  color: var(--primary-core);
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: 4px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.rate-big .prefix {
  font-size: 40px;
  color: var(--secondary-text);
  font-weight: 600;
}

.rate-currency {
  color: var(--secondary-text);
  font-size: 15px;
  margin-bottom: 24px;
  font-weight: 500;
}

.change-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 32px;
}

.change-badge.up {
  background: var(--brand-red-light);
  color: var(--brand-red);
}

.change-badge.down {
  background: var(--brand-green-light);
  color: var(--brand-green);
}

.change-badge.neutral {
  background: var(--bg-element);
  color: var(--secondary-text);
}

.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.mini-item {
  background: var(--bg-app);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-light);
}

.mini-lbl {
  font-size: 12px;
  font-weight: 700;
  color: var(--secondary-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.mini-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-core);
}

.footer-copy {
  font-size: 14px;
  color: var(--secondary-text);
  margin-bottom: 16px;
  font-weight: 500;
}

.footer-source {
  font-size: 12px;
  color: var(--secondary-text);
  text-align: center;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--border-light);
  line-height: 1.6;
  opacity: 0.8;
}

.rate-footer {
  font-size: 13px;
  color: var(--secondary-text);
  margin-top: 24px;
  text-align: center;
}

/* Grid de Herramientas */
.tools-sec {
  padding: 100px 0;
  background: var(--bg-surface);
}

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

.tool-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  text-decoration: none;
  color: inherit;
  transition: all var(--ease-spring);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tool-card:not(.tool-card-disabled):hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-card);
  border-color: var(--brand-blue);
}

.tool-card-disabled {
  opacity: 0.6;
  cursor: default;
}

.tool-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--brand-blue-light);
  color: var(--brand-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 24px;
}

.tool-card:nth-child(2) .tool-icon {
  background: var(--brand-green-light);
  color: var(--brand-green);
}

.tool-card:nth-child(3) .tool-icon {
  background: var(--bg-element);
  color: var(--secondary-text);
}

.tool-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-core);
  margin-bottom: 12px;
}

.tool-desc {
  color: var(--secondary-text);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 24px;
  flex-grow: 1;
}

.tool-link {
  color: var(--brand-blue);
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tool-card:hover .tool-link {
  gap: 8px;
}

/* Stats Bar */
.stats-bar {
  background: var(--primary-core);
  padding: 64px 0;
  position: relative;
  overflow: hidden;
}

.stats-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 150%, rgba(37, 99, 235, 0.4) 0%, transparent 60%);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.stat-val {
  font-size: 40px;
  font-weight: 800;
  color: white;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.stat-lbl {
  font-size: 14px;
  color: #94A3B8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Tabla Global Home */
.global-sec {
  padding: 100px 0;
  background: var(--bg-app);
  border-top: 1px solid var(--border-light);
}

.global-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 24px;
}

.global-note {
  font-size: 14px;
  color: var(--primary-core);
  background: var(--bg-surface);
  padding: 12px 20px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.global-note a {
  color: var(--brand-blue);
  text-decoration: none;
}

.global-table-wrap {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Tablas Premium */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  background: #F8FAFC;
  padding: 16px 24px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--secondary-text);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border-light);
}

tbody tr {
  transition: background var(--ease-out);
}

tbody tr:not(:last-child)>td {
  border-bottom: 1px solid var(--border-light);
}

tbody tr:hover {
  background: #F8FAFC;
}

tbody tr.fila-mejor {
  background: var(--brand-green-light);
  position: relative;
}

tbody tr.fila-mejor:hover {
  background: #D1FAE5;
}

tbody td {
  padding: 20px 24px;
  font-size: 15px;
  vertical-align: middle;
}

.banco-cell-g {
  display: flex;
  align-items: center;
  gap: 16px;
}

.banco-logo {
  width: auto;
  min-width: 44px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0 8px;
  box-shadow: none;
  flex-shrink: 0;
}

.banco-nombre-g {
  font-weight: 700;
  color: var(--primary-core);
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.banco-tipo-g {
  font-size: 13px;
  color: var(--secondary-text);
  margin-top: 2px;
}

.badge-mejor {
  background: var(--brand-green);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.05em;
}

.badge-aprox {
  font-size: 11px;
  color: var(--secondary-text);
  background: var(--bg-element);
  border: 1px solid var(--border-light);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.global-footer-note {
  margin-top: 24px;
  font-size: 13px;
  color: var(--secondary-text);
  text-align: center;
  line-height: 1.6;
}

/* FAQ Acordeones estilo Premium */
.faq-sec {
  padding: 100px 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
}

.faq-grid {
  max-width: 800px;
  margin: 40px auto 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: box-shadow var(--ease-out);
}

.faq-item:hover {
  box-shadow: var(--shadow-sm);
}

.faq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  list-style: none;
  color: var(--primary-core);
  transition: background var(--ease-out);
}

.faq-q:hover {
  background: var(--bg-app);
}

.faq-q::-webkit-details-marker {
  display: none;
}

.faq-q::after {
  content: '+';
  font-size: 24px;
  color: var(--brand-blue);
  font-weight: 400;
  transition: transform var(--ease-spring);
}

details[open] .faq-q::after {
  content: '−';
  transform: rotate(180deg);
}

.faq-a {
  padding: 0 24px 24px;
  font-size: 15px;
  color: var(--secondary-text);
  line-height: 1.7;
  animation: slideDown 0.3s var(--ease-out);
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Footer ── */
footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  padding: 48px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.footer-links a {
  color: var(--secondary-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color var(--ease-out);
}

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

.footer-copy {
  color: var(--secondary-text);
  font-size: 14px;
}


/* ═══════════════════════════════════════════════════
   COMPARADOR
   ═══════════════════════════════════════════════════ */
.page-header {
  background: radial-gradient(circle at 50% -20%, #EFF6FF 0%, #FFFFFF 100%);
  padding: 64px 0;
  border-bottom: 1px solid var(--border-light);
  text-align: center;
}

.page-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  color: var(--brand-blue);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  background: var(--brand-blue-light);
  padding: 6px 16px;
  border-radius: var(--radius-full);
}

.page-title {
  font-size: 48px;
  font-weight: 800;
  color: var(--primary-core);
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  line-height: 1.1;
}

.page-desc {
  color: var(--secondary-text);
  font-size: 18px;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.main-content {
  padding: 64px 0 100px;
}

.form-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  margin-bottom: 32px;
  position: relative;
  z-index: 10;
}

.form-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-core);
  margin-bottom: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 24px;
  align-items: flex-end;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-core);
  margin-bottom: 8px;
}

/* Inputs Estilo Premium */
.field input,
.field select {
  width: 100%;
  background: var(--bg-element);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  color: var(--primary-core);
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  outline: none;
  transition: all var(--ease-out);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.field input:hover,
.field select:hover {
  background: #E2E8F0;
}

.field input:focus,
.field select:focus {
  border-color: var(--brand-blue);
  background: var(--bg-surface);
  box-shadow: 0 0 0 4px var(--brand-blue-light);
}

.tc-strip {
  background: var(--brand-blue-light);
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.tc-strip-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--brand-blue);
}

.tc-strip-lbl {
  font-size: 14px;
  color: var(--brand-blue);
  font-weight: 600;
  opacity: 0.8;
}

.results-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.results-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #F8FAFC;
}

.results-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-core);
}

.results-subtitle {
  font-size: 14px;
  color: var(--secondary-text);
  font-weight: 500;
}

.resultado-cell {
  font-size: 20px;
  font-weight: 800;
}

.resultado-cell.ganador-num {
  color: var(--brand-green);
  font-size: 22px;
}

.diferencia-cell {
  font-size: 14px;
  font-weight: 600;
}

.diferencia-cell.perdida {
  color: var(--brand-red);
}

.diferencia-cell.igual {
  color: var(--brand-green);
}

.tip-card {
  background: linear-gradient(135deg, var(--brand-blue-light), #DBEAFE);
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  margin-top: 32px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.tip-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.tip-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-blue);
  margin-bottom: 8px;
}

.tip-text {
  font-size: 15px;
  color: #1E3A8A;
  line-height: 1.6;
  font-weight: 500;
}

.disclaimer {
  margin-top: 24px;
  font-size: 13px;
  color: var(--secondary-text);
  text-align: center;
}


/* ═══════════════════════════════════════════════════
   CONVERSOR
   ═══════════════════════════════════════════════════ */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}

.conv-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.conv-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-core);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.conv-block {
  margin-bottom: 24px;
}

.conv-block label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-core);
  margin-bottom: 12px;
}

/* Input Group */
.conv-input-row {
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  transition: box-shadow var(--ease-out);
}

.conv-input-row:focus-within {
  box-shadow: 0 0 0 4px var(--brand-blue-light);
}

.conv-currency {
  background: var(--primary-core);
  color: white;
  padding: 20px;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  font-weight: 800;
  font-size: 16px;
  min-width: 80px;
  text-align: center;
}

.conv-input {
  flex: 1;
  min-width: 0; /* Crucial para flex behavior con inputs */
  width: 100%;
  background: var(--bg-element);
  border: 2px solid transparent;
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 18px 24px;
  font-family: 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--primary-core);
  outline: none;
  transition: background var(--ease-out);
}

.conv-input:hover {
  background: #E2E8F0;
}

.conv-input:focus {
  background: var(--bg-surface);
  border-color: var(--brand-blue);
}

.conv-result {
  background: var(--brand-green-light);
  border: 1px solid #A7F3D0;
  border-radius: var(--radius-md);
  padding: 24px;
}

.conv-result-lbl {
  font-size: 13px;
  font-weight: 800;
  color: var(--brand-green);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.conv-result-val {
  font-size: 40px;
  font-weight: 800;
  color: var(--primary-core);
  letter-spacing: -1px;
  word-break: break-word;
  overflow-wrap: break-word;
}

.conv-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 32px 0;
}

.conv-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.btn-swap {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: all var(--ease-spring);
  box-shadow: var(--shadow-sm);
  color: var(--primary-core);
}

.btn-swap:hover {
  background: var(--brand-blue-light);
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  transform: rotate(180deg);
}

.quick-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.quick-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--secondary-text);
  cursor: pointer;
  transition: all var(--ease-out);
  box-shadow: var(--shadow-sm);
}

.quick-btn:hover {
  background: var(--primary-core);
  border-color: var(--primary-core);
  color: white;
  transform: translateY(-2px);
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.info-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
}

.info-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-core);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-row-lbl {
  font-size: 14px;
  color: var(--secondary-text);
  font-weight: 500;
}

.info-row-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary-core);
}

.verde {
  color: var(--brand-green);
}

.rojo {
  color: var(--brand-red);
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media(max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero h1 {
    font-size: 48px;
  }

  .hero-desc {
    margin: 0 auto 32px;
  }

  .hero-actions {
    justify-content: center;
  }

  .main-grid {
    grid-template-columns: 1fr;
  }

  .conv-tabla-grande {
    display: none;
  }

  .sidebar {
    grid-template-columns: 1fr 1fr;
  }
}

@media(max-width: 768px) {

  /* Mobile Header */
  .menu-toggle {
    display: flex;
  }

  nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 24px;
    box-shadow: var(--shadow-md);
  }

  nav.open {
    display: block;
    animation: fadeUp 0.3s var(--ease-out);
  }

  nav ul {
    flex-direction: column;
    gap: 8px;
  }

  nav a {
    display: block;
    padding: 12px 16px;
    font-size: 16px;
    border-radius: var(--radius-md);
  }

  .live-badge {
    padding: 4px 8px;
    font-size: 10px;
    gap: 4px;
    display: flex;
  }
  
  .header-right {
    gap: 12px;
  }

  .container {
    padding: 0 16px;
  }

  .hide-mobile {
    display: none;
  }

  /* Typos y Espacios */
  .hero h1 {
    font-size: 36px;
  }

  .rate-big {
    font-size: 56px;
  }

  .rate-big .prefix {
    font-size: 32px;
  }

  .sec-title,
  .page-title {
    font-size: 32px;
  }

  /* Grids */
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .mini-grid {
    grid-template-columns: 1fr;
  }

  /* Tablas Mobile */
  table {
    border: 0;
  }

  thead {
    display: none;
  }

  tbody tr {
    display: block;
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 8px;
  }

  tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    text-align: right;
  }

  tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--secondary-text);
    font-size: 12px;
    text-transform: uppercase;
    margin-right: 16px;
    text-align: left;
  }

  tbody td:last-child {
    border-bottom: 0;
  }

  .banco-cell-g,
  .banco-cell {
    flex-direction: row;
    text-align: right;
    justify-content: flex-end;
  }

  /* Forms */
  .form-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .tc-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* Conversor Mobile */
  .conv-card, .info-card {
    padding: 24px;
  }
  
  .conv-title {
    font-size: 18px;
  }
  
  .conv-title svg {
    flex-shrink: 0;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .conv-input {
    font-size: 20px;
    padding: 16px;
  }

  .conv-currency {
    padding: 16px;
    font-size: 14px;
    min-width: 60px;
  }

  .conv-result-val {
    font-size: 28px;
  }

  .conv-divider {
    margin: 24px 0;
  }

  .btn-primary {
    width: 100%;
  }
}

/* Fixes para pantallas estrechas (320px - 400px) */
@media(max-width: 400px) {
  .rate-big {
    font-size: 44px;
  }
  .rate-big .prefix {
    font-size: 24px;
  }
  .page-title, .hero h1 {
    font-size: 28px;
  }
  .form-card, .conv-card, .results-header {
    padding: 24px;
  }
  .hero-inner {
    gap: 24px;
  }
}