/* ─── 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 ────────────────────────────────────────────── */
.dolar-input:focus {
  border-color: rgba(99, 102, 241, .55) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .10) !important;
}
button:focus-visible {
  outline: 2px solid rgba(99, 102, 241, .7) !important;
  outline-offset: 2px !important;
}

/* ─── Layout ─────────────────────────────────────────────────── */
.dolar-app {
  width: 100%;
  background: transparent;
}

.dolar-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 16px 12px 48px;
}

/* ─── Card ───────────────────────────────────────────────────── */
.dolar-card {
  width: 100%;
  max-width: 820px;
  background:
    radial-gradient(400px 300px at 10% 8%, rgba(99, 102, 241, .15), transparent 55%),
    radial-gradient(350px 300px at 88% 90%, rgba(99, 102, 241, .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;
}

/* ─── Generic box ────────────────────────────────────────────── */
.dolar-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 ──────────────────────────────────────────── */
.dolar-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: #6366f1;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

/* ─── Copy button ────────────────────────────────────────────── */
.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(99, 102, 241, .10);
  border-color: rgba(99, 102, 241, .25);
  color: #6366f1;
}

/* ─── Utility ────────────────────────────────────────────────── */
.hide {
  display: none !important;
}
.dolar-note strong { color: rgba(255, 255, 255, .6); }
.dolar-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(99, 102, 241, .5),
    rgba(129, 140, 248, .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 ─────────────────────────────────────────── */
.dolar-btn {
  border: none;
  cursor: pointer;
  transition: all .18s;
  font-family: Poppins, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* ─── Dual calc ──────────────────────────────────────────────── */
.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+ ────────────────────────────────────────────────── */
@media (min-width: 520px) {
  .dolar-wrap {
    padding: 20px 16px 72px;
  }
  .dolar-card {
    border-radius: 24px;
    padding: 20px 18px;
  }
  .dolar-box {
    border-radius: 16px;
    padding: 16px;
  }
  .calc-card {
    border-radius: 14px;
    padding: 14px;
  }
  .calc-2col {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

@media (min-width: 768px) {
  .dolar-wrap {
    padding: 24px 20px 100px;
  }
  .dolar-card {
    border-radius: 28px;
    padding: 22px 20px;
  }
  .cta-in {
    padding: 18px;
  }
}
