/* Estilo común de las webs de herramientas. Cada web pone su color en --brand. */

:root {
  --bg: #f2f4f7;
  --card: #ffffff;
  --ink: #1d2433;
  --muted: #5d6676;
  --line: #dde2ea;
  --brand: #2563eb;
  --ok: #1f8f5f;
  --warn: #b45309;
  --error: #b3261e;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
img, canvas { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }

/* cabecera */
.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1400px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; text-decoration: none; }
.logo { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 8px; background: var(--brand); color: #fff; font-size: 0.8rem; }
.donate-top { margin-left: auto; flex: none; padding: 8px 14px; border-radius: 999px; background: #ffc439; color: #111; font-weight: 700; font-size: 0.9375rem; text-decoration: none; }
.donate-top:hover { background: #f2b52a; }

/* columnas y anuncios */
.layout { display: grid; grid-template-columns: 160px minmax(0, 900px) 160px; justify-content: center; gap: 24px; padding: 20px 20px 40px; }
.layout.no-ads { grid-template-columns: minmax(0, 900px); }
.side .ad { position: sticky; top: 16px; }
main { min-width: 0; }
.ad { text-align: center; }
.ad-label { display: block; font-size: 0.6875rem; color: #9aa3b2; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.ad-demo { display: grid; place-items: center; margin: 0 auto; background: #e4e8ee; border: 1px dashed #b9c1cd; color: #8a93a3; font-size: 0.8125rem; }
.ad-side .ad-demo { width: 160px; height: 600px; }
.ad-top { margin-bottom: 20px; }
.ad-top .ad-demo { width: 100%; max-width: 728px; height: 90px; }
.ad-wide { margin: 24px 0; }
.ad-wide .ad-demo { width: 100%; height: 120px; }

/* cabecera de la herramienta */
.tool-head { text-align: center; padding: 8px 0 20px; }
.tool-head h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.4rem); }
.tool-head p { margin: 8px auto 0; max-width: 60ch; color: var(--muted); font-size: 1.0625rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }

/* formularios */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label, .field > .label { font-weight: 600; font-size: 0.9375rem; }
.field small { color: var(--muted); font-size: 0.8125rem; }
.field.check { flex-direction: row; align-items: center; gap: 8px; }
.field.check label { font-weight: 500; cursor: pointer; }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=email], input[type=tel], select, textarea {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid #c9d0db; border-radius: 8px; background: #fff; color: var(--ink); font: inherit;
}
textarea { min-height: 160px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--brand); }
input[type=range] { width: 100%; accent-color: var(--brand); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 0.9375rem; background: #fff; }
.seg label:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, #fff); color: var(--brand); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }

/* botones */
.button, button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 0; border-radius: 8px; background: var(--brand); color: #fff; font: 700 1rem var(--font); text-decoration: none; cursor: pointer; transition: filter 150ms, transform 150ms; }
.button:hover, button:hover { filter: brightness(0.92); }
.button:active, button:active { transform: scale(0.97); }
button.secondary { background: #e8ecf2; color: var(--ink); }
button.small { min-height: 36px; padding: 0 14px; font-size: 0.875rem; }
button.big { min-height: 56px; font-size: 1.2rem; width: 100%; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }

/* resultados */
.result { margin-top: 20px; padding: 18px; border-radius: 12px; background: color-mix(in srgb, var(--brand) 8%, #fff); border: 1px solid color-mix(in srgb, var(--brand) 25%, #fff); }
.big-number { font-size: clamp(2rem, 1.4rem + 3vw, 3rem); font-weight: 800; color: var(--brand); line-height: 1.1; font-variant-numeric: tabular-nums; }
.result .label { color: var(--muted); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.stat b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 0.875rem; }
table.data { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { background: #f6f8fa; font-weight: 700; }
.table-wrap { overflow-x: auto; }
.msg { margin-top: 10px; font-size: 0.9375rem; color: var(--muted); }
.msg.bad { color: var(--error); font-weight: 600; }
.warn { margin-top: 14px; padding: 10px 12px; border-radius: 8px; background: #fff8e1; color: #6b4e00; font-size: 0.875rem; }

.donate { margin-top: 20px; padding: 12px 14px; border-radius: 10px; background: #fff8e1; font-size: 0.9375rem; text-align: center; }
.donate a { font-weight: 700; }
.privacy { margin-top: 12px; text-align: center; font-size: 0.875rem; color: var(--muted); }

/* textos */
.about { margin-top: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.about h1 { font-size: 2rem; margin-bottom: 16px; }
.about h2 { font-size: 1.25rem; margin-bottom: 10px; }
.about p { margin-bottom: 10px; color: #333b4a; }
.legal h2 { margin-top: 20px; }
.faq details { border-top: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 0; }

/* pie */
.foot { border-top: 1px solid var(--line); background: var(--card); padding: 24px 20px; text-align: center; font-size: 0.875rem; color: var(--muted); }
.foot-title { font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.foot-links { list-style: none; margin: 0 auto 16px; padding: 0; max-width: 900px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.foot-links a { color: var(--ink); }

@media (max-width: 1240px) {
  .layout { grid-template-columns: minmax(0, 900px); }
  .side { display: none; }
}
@media (max-width: 700px) {
  .layout { padding: 12px 12px 32px; }
  .card, .about { padding: 14px; }
  .ad-top .ad-demo { height: 60px; }
}
@media (prefers-reduced-motion: reduce) { .button, button { transition: none; } }
