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

/* ─── Base ───────────────────────────────────────────────────── */
html, body {
  font-family: Poppins, system-ui, sans-serif;
  background: transparent;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ─── Animations ─────────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}

/* ─── Inputs: hide spinners ──────────────────────────────────── */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}
input[type="number"] {
  -moz-appearance: textfield;
}
input:focus {
  outline: none;
}

/* ─── Focus rings ────────────────────────────────────────────── */
.cuf-input:focus {
  border-color: rgba(34, 211, 238, .55) !important;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .10) !important;
}
.cuf-input-usd:focus {
  border-color: rgba(129, 140, 248, .55) !important;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, .10) !important;
}
button:focus-visible {
  outline: 2px solid rgba(34, 211, 238, .7) !important;
  outline-offset: 2px !important;
}

/* ─── Layout ─────────────────────────────────────────────────── */
.ifc {
  width: 100%;
  background: transparent;
}

/* Mobile: padding ajustado, sin desperdicio vertical */
.ifc-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 16px 12px 48px;
}

/* ─── Card ───────────────────────────────────────────────────── */
/* Mobile: padding más compacto */
.ifc-card {
  width: 100%;
  max-width: 820px;
  background:
    radial-gradient(400px 300px at 10% 8%, rgba(34, 211, 238, .15), transparent 55%),
    radial-gradient(350px 300px at 88% 90%, rgba(34, 211, 238, .08), transparent 55%),
    rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 16px 14px;
}

/* ─── Indicator grid — mobile: 1 col / desktop: 2 col ────────── */
.ifc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

/* ─── Tabs bar ───────────────────────────────────────────────── */
.ifc-tabs {
  display: flex;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}

/* ─── Panels ─────────────────────────────────────────────────── */
.ifc-panel {
  display: none;
}
.ifc-panel.on {
  display: block;
}

/* ─── Generic box ────────────────────────────────────────────── */
.ifc-box {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 8px;
}

/* ─── Loading state ──────────────────────────────────────────── */
.ifc-load {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  gap: 12px;
}
.spin {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .1);
  border-top-color: #22d3ee;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

/* ─── Copy button — touch target mínimo 44px ────────────────── */
.copy {
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  color: rgba(255, 255, 255, .32);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all .15s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.copy.ok {
  background: rgba(34, 211, 238, .10);
  border-color: rgba(34, 211, 238, .25);
  color: #22d3ee;
}

/* ─── Utility ────────────────────────────────────────────────── */
.hide {
  display: none !important;
}
.ifc-note strong { color: rgba(255, 255, 255, .6); }
.ifc-note em     { font-style: normal; color: rgba(255, 255, 255, .45); }

/* ─── Reference table ────────────────────────────────────────── */
.tbl {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.tbl table {
  width: 100%;
  border-collapse: collapse;
  min-width: 220px;
}

/* ─── Code block ─────────────────────────────────────────────── */
.code {
  flex: 1;
  background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 10px;
  padding: 9px 12px;
  font-family: "Courier New", monospace;
  font-size: clamp(10px, 1.8vw, 12px);
  overflow: auto;
  white-space: nowrap;
}

/* ─── CTA block ──────────────────────────────────────────────── */
.cta {
  margin-top: 12px;
  position: relative;
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg,
    rgba(34, 211, 238, .5),
    rgba(45, 212, 191, .12),
    rgba(255, 255, 255, .08)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.cta-in {
  background: rgba(255, 255, 255, .04);
  border-radius: 16px;
  padding: 16px;
  position: relative;
}

/* ─── Generic button base ────────────────────────────────────── */
.ifc-btn {
  border: none;
  cursor: pointer;
  transition: all .18s;
  font-family: Poppins, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* ─── Dual calc — mobile: 1 col ─────────────────────────────── */
.calc-2col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.calc-card {
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 12px;
  padding: 12px;
}

/* ─── Tablet y desktop: 2 columnas ──────────────────────────── */
@media (min-width: 520px) {
  .ifc-wrap {
    padding: 20px 16px 72px;
  }

  .ifc-card {
    border-radius: 24px;
    padding: 20px 18px;
  }

  .ifc-box {
    border-radius: 16px;
    padding: 16px;
  }

  .calc-card {
    border-radius: 14px;
    padding: 14px;
  }

  .calc-2col {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .ifc-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
  }
}

@media (min-width: 768px) {
  .ifc-wrap {
    padding: 24px 20px 100px;
  }

  .ifc-card {
    border-radius: 28px;
    padding: 22px 20px;
  }

  .cta-in {
    padding: 18px;
  }
}
