/* ===== Colores claros para exterior ===== */
:root {
  --bg: #f8f9fb;
  --card: #ffffff;
  --text: #212529;
  --muted: #6c757d;
  --brand: #5b4bdb;
  --brand-strong: #4338ca;
  --ok: #16a34a;
  --warn-bg: #fff8db;
  --warn-border: #ffd666;
  --warn-text: #8a6d00;
  --shadow: 0 12px 28px rgba(0,0,0,.08);
  --radius: 18px;
}

/* ===== Reset / base ===== */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
  color:var(--text);
  background: var(--bg);
  display:flex; flex-direction:column;
}

/* ===== Header ===== */
.site-header{
  background: linear-gradient(90deg, var(--brand), var(--brand-strong));
  color:#fff;
  text-align:center;
  padding: 20px clamp(16px,4vw,32px);
}
.site-header h1{ margin:0; font-size: clamp(1.1rem,3.6vw,1.8rem); font-weight:800 }

/* ===== Layout ===== */
.container{ width:min(920px,92%); margin: clamp(16px,3.6vw,28px) auto; flex:1 }

/* ===== Tarjeta de resultados ===== */
.card{
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(16px,3.5vw,28px);
  border: 1px solid #eef0f4;
}

/* ===== Bloque destacado: Monto + Tiempo ===== */
.highlight{
  display:grid; gap:16px; margin-bottom:18px; grid-template-columns: 1fr;
}
.amount, .elapsed{
  display:flex; align-items:center; justify-content:space-between;
  border:1px solid #e6e8ef; border-radius:14px; padding:14px 16px; background:#f9fafb;
}
.amount-label{ font-weight:700; color:var(--muted) }
.amount-value{ font-weight:900; font-size: clamp(1.8rem,6vw,2.6rem); color:var(--ok); line-height:1 }
.elapsed-label{ font-weight:700; color:var(--muted) }
.elapsed-value{
  font-weight:800; font-size: clamp(1.1rem,4.2vw,1.6rem);
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ===== Detalles: ahora vertical para que no se desajuste nada ===== */
.details-grid{
  display:grid; gap:12px; grid-template-columns: 1fr; margin-bottom: 18px;
}
@media (min-width: 640px){
  .details-grid{ grid-template-columns: 1fr 1fr }
}
.detail{
  background:#f9fafb; border:1px solid #e6e8ef; border-radius:12px;
  padding: 10px 12px; display:flex; flex-direction:column; gap:6px;
}
.label{
  font-size: 13px; letter-spacing:.2px; color:var(--muted); font-weight:800; text-transform: none;
}
.value{
  font-size: 15px; font-weight:800; color:var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; /* para alinear números */
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  word-break: break-word;     /* evita desbordes feos en móvil */
}

/* ===== Botón ===== */
.actions{ margin-top: 6px }
.btn-primary{
  width:100%; padding:14px 16px; font-weight:800; font-size:16px;
  border:none; border-radius:14px; color:#fff;
  background: linear-gradient(90deg, var(--brand), var(--brand-strong));
  cursor:pointer; transition: transform .06s ease, opacity .2s ease, box-shadow .2s ease;
  box-shadow: 0 10px 22px rgba(91,75,219,.25);
}
.btn-primary:hover{ opacity:.95 }
.btn-primary:active{ transform: translateY(1px) }

/* ===== Banner de información / estados ===== */
.info{
  display:flex; align-items:flex-start; gap:10px;
  background:#eef2ff; color:#2b2e83; border:1px solid #c7d2fe;
  padding: 10px 12px; border-radius:12px; margin-bottom:12px; font-weight:700;
}
.info::before{
  content:"ℹ️"; font-size:18px; line-height:1; margin-top:1px;
}
.info.is-warning{
  background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-border);
}
.info.is-warning::before{ content:"⚠️" }

/* ===== Spinner overlay ===== */
.spinner-overlay{
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap:10px;
  background: rgba(255,255,255,.65); /* visible incluso al sol */
  z-index: 9999;
}
.spinner{
  width: 64px; height: 64px; border-radius: 50%;
  border: 6px solid #e6e8ef; border-top-color: var(--brand);
  animation: spin .9s linear infinite;
}
.spinner-text{ color:#3b3f5c; font-weight:800; letter-spacing:.3px }
@keyframes spin{ to{ transform: rotate(360deg) } }

/* ===== Footer ===== */
.site-footer{ text-align:center; padding:16px; color:var(--muted); font-size:14px }
.site-footer a{ color:var(--brand); text-decoration:underline }

/* ===== Utilidades opcionales ===== */
.amount-value, .elapsed-value, .value { -webkit-font-smoothing: antialiased; }
