/* ============================================================
   CalculadoraDeIVA.es — Identidad visual "Recibo Claro"
   Papel cálido + tinta azul medianoche + acento coral/ámbar.
   Sin librerías ni fuentes externas: rápido y ligero.
   ============================================================ */
:root {
  --paper: #f6f1e7;
  --card: #fffdf8;
  --ink: #14213d;
  --ink-soft: #43506b;
  --line: #e5dcc8;
  --coral: #e4572e;
  --amber: #f2a007;
  --amber-soft: #ffd166;
  --teal: #0e7c66;
  --panel: #14213d;
  --panel-line: #2c3d63;
  --panel-text: #e9eefb;
  --panel-dim: #aebadd;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
::selection { background: var(--amber-soft); }
body {
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--ink);
  line-height: 1.55;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% -4%, rgba(228, 87, 46, .12), transparent 42%),
    radial-gradient(circle at 88% 4%, rgba(14, 124, 102, .12), transparent 40%),
    radial-gradient(rgba(20, 33, 61, .055) 1px, transparent 1.1px);
  background-size: auto, auto, 22px 22px;
}
.wrap { max-width: 780px; margin: 0 auto; padding: 0 16px 64px; }

/* ---------- Barra de navegación ---------- */
nav {
  position: sticky; top: 10px; z-index: 20;
  display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center;
  margin-top: 14px; padding: 10px 14px;
  background: rgba(255, 253, 248, .94);
  border: 1.5px solid var(--line); border-radius: 14px;
  box-shadow: 0 6px 18px rgba(20, 33, 61, .07);
}
nav .brand {
  font-weight: 800; font-size: 1.02rem; color: var(--ink);
  text-decoration: none; margin-right: 12px; letter-spacing: -.2px;
}
nav .brand::before {
  content: "%";
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; margin-right: 8px; vertical-align: -8px;
  border-radius: 9px; color: #fff; font-weight: 900; font-size: 1rem;
  background: linear-gradient(135deg, var(--coral), var(--amber));
  box-shadow: 0 3px 8px rgba(228, 87, 46, .35);
}
nav a { color: var(--ink-soft); text-decoration: none; font-size: .92rem; font-weight: 650; }
nav a:hover { color: var(--coral); }
.nav-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-left: auto; align-items: center; }
nav a.active { background: var(--ink); color: #fff; padding: 5px 11px; border-radius: 999px; }
nav a.active:hover { color: var(--amber-soft); }

/* ---------- Cabecera ---------- */
header { text-align: center; padding: 30px 0 20px; }
header::before {
  content: "HERRAMIENTA FISCAL · ESPAÑA";
  display: inline-block; margin-bottom: 14px; padding: 5px 12px;
  font-size: .7rem; font-weight: 800; letter-spacing: 2.2px; color: var(--ink);
  background: #fff; border: 1.5px solid var(--ink); border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
}
h1 {
  display: inline-block; font-size: 2.35rem; line-height: 1.15; letter-spacing: -.6px;
  padding: 0 8px;
  background: linear-gradient(transparent 63%, rgba(242, 160, 7, .45) 63%, rgba(242, 160, 7, .45) 93%, transparent 93%);
}
header p { color: var(--ink-soft); margin-top: 12px; font-size: 1.03rem; }

/* ---------- Tarjeta calculadora (estilo recibo) ---------- */
.card {
  position: relative; overflow: hidden;
  background: var(--card);
  border: 2px solid var(--ink); border-radius: 20px;
  padding: 28px 26px 26px;
  box-shadow: 8px 8px 0 rgba(20, 33, 61, .9);
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 8px;
  background: repeating-linear-gradient(90deg, var(--coral) 0 52px, var(--amber) 52px 104px, var(--teal) 104px 156px);
}
label { display: block; font-weight: 700; margin: 18px 0 7px; font-size: .82rem; letter-spacing: 1.1px; text-transform: uppercase; color: var(--ink-soft); }
label:first-child { margin-top: 2px; }
input, select {
  width: 100%; padding: 13px 15px; font-size: 1.15rem; font-weight: 600; color: var(--ink);
  border: 2px solid var(--ink); border-radius: 12px; background: #fff;
  font-variant-numeric: tabular-nums;
}
input:focus, select:focus { outline: 3px solid rgba(242, 160, 7, .55); outline-offset: 1px; }
.modes { display: flex; gap: 6px; margin-top: 4px; padding: 6px; background: #efe8d8; border-radius: 14px; }
.modes button {
  flex: 1; padding: 11px 8px; font-size: .98rem; font-weight: 700; cursor: pointer;
  border: 2px solid transparent; background: transparent; color: var(--ink-soft); border-radius: 10px;
}
.modes button.active { background: var(--ink); color: #fff; box-shadow: 0 3px 8px rgba(20, 33, 61, .3); }

/* ---------- Panel de resultados (tinta) ---------- */
.results { margin-top: 24px; background: var(--panel); border-radius: 16px; padding: 18px 20px 14px; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; font-size: 1.02rem; color: var(--panel-text); border-bottom: 1px dashed var(--panel-line); }
.row span:first-child { color: var(--panel-dim); }
.row span:last-child { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.row.total { font-size: 1.32rem; border-bottom: none; padding-top: 13px; }
.row.total span:first-child { color: #fff; font-weight: 700; }
.row.total span:last-child { color: var(--amber-soft); }
.copy {
  margin-top: 16px; width: 100%; padding: 12px; cursor: pointer;
  background: linear-gradient(135deg, var(--coral), #d63f1e); color: #fff;
  border: none; border-radius: 12px; font-weight: 700; font-size: .98rem;
  box-shadow: 0 4px 12px rgba(228, 87, 46, .35);
}
.copy:hover { filter: brightness(1.06); }

/* ---------- Secciones de contenido ---------- */
section {
  margin-top: 26px; background: var(--card);
  border: 1.5px solid var(--line); border-radius: 18px;
  padding: 26px 26px 18px;
  box-shadow: 0 3px 12px rgba(20, 33, 61, .05);
}
section.faq { background: #fdf6df; border-color: #ecd9a0; }
h2 { font-size: 1.38rem; letter-spacing: -.3px; margin-bottom: 12px; }
h2::before { content: ""; display: block; width: 34px; height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--coral), var(--amber)); margin-bottom: 10px; }
h3 { font-size: 1.08rem; margin: 18px 0 8px; }
p, li { color: #333d4f; }
p { margin-bottom: 10px; }
ul, ol { padding-left: 22px; margin-bottom: 10px; }
a { color: #c7431f; text-underline-offset: 3px; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; background: #fff; border-radius: 12px; overflow: hidden; }
th, td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
th { background: var(--ink); color: #fff; font-size: .92rem; }
tr:nth-child(even) td { background: #faf6ec; }
code { background: #fdeeda; color: #8a4b00; padding: 2px 7px; border-radius: 6px; font-size: .92em; font-weight: 600; }
.faq p { margin-bottom: 14px; }

/* ---------- Tarjetas de herramientas ---------- */
.tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.tools-grid a {
  display: block; background: #fff; border: 1.5px solid var(--line); border-radius: 14px;
  padding: 16px; text-decoration: none; color: var(--ink); font-weight: 700;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.tools-grid a small { display: block; color: var(--ink-soft); font-weight: 400; margin-top: 4px; }
.tools-grid a::after { content: "→"; display: block; margin-top: 8px; color: var(--coral); font-weight: 900; }
.tools-grid a:hover { border-color: var(--ink); transform: translate(-2px, -2px); box-shadow: 5px 5px 0 rgba(20, 33, 61, .85); }

/* ---------- Pie ---------- */
footer {
  margin-top: 30px; background: var(--panel); color: var(--panel-dim);
  border-radius: 18px; padding: 28px 26px 20px; font-size: .9rem;
}
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 24px; text-align: left; }
.f-brand { display: block; font-size: 1.05rem; font-weight: 800; color: #fff; margin-bottom: 10px; }
.f-brand::before {
  content: "%"; display: inline-grid; place-items: center;
  width: 28px; height: 28px; margin-right: 8px; vertical-align: -7px;
  border-radius: 8px; color: #fff; font-weight: 900; font-size: .95rem;
  background: linear-gradient(135deg, var(--coral), var(--amber));
}
footer h4 { color: #fff; font-size: .78rem; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 10px; }
.f-col a { display: block; color: var(--panel-dim); text-decoration: none; padding: 3px 0; }
.f-col a:hover { color: var(--amber-soft); }
.f-about p { color: var(--panel-dim); margin-bottom: 10px; }
.f-col a.f-mail { color: var(--amber-soft); font-weight: 650; }
.footer-bottom { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--panel-line); text-align: center; font-size: .82rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } .nav-links { margin-left: 0; } }

@media (max-width: 560px) {
  .tools-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.75rem; }
  .card { padding: 24px 18px 20px; box-shadow: 5px 5px 0 rgba(20, 33, 61, .9); }
  section { padding: 22px 18px 14px; }
  nav { position: static; }
}
