/* Calendario SRI — papel cuadriculado de tkaed */

:root {
  --paper: #f2f6f3;
  --card: #ffffff;
  --ink: #112a3a;
  --pencil: #4d626e;
  --line: rgba(17, 42, 58, 0.14);
  --amber: #f2b632;
  --amber-soft: rgba(242, 182, 50, 0.32);
  --no: #a8324a;
  --serif: "Young Serif", Georgia, "Times New Roman", serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 28px 28px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

a { color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }

main, .top, .foot { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; }
.brand { font-family: var(--serif); font-size: 1.1rem; text-decoration: none; }
.top nav { display: flex; gap: 1.25rem; font-size: 0.95rem; }
.top nav a { text-decoration: none; border-bottom: 2px solid transparent; }
.top nav a:hover { border-bottom-color: var(--amber); }

/* Intro */
.intro { padding: 0.6rem 0 1.2rem; max-width: 46rem; }
.intro h1 { font-size: clamp(1.85rem, 6vw, 3.2rem); margin-bottom: 0.5rem; }
.lede { font-size: 1.05rem; color: var(--pencil); max-width: 40rem; margin: 0; }

/* Tool card */
.tool {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 7px 7px 0 var(--amber);
  overflow: hidden;
  margin-bottom: 2rem;
}

/* Next deadline band */
.next { background: var(--ink); color: var(--paper); padding: 1rem 1.1rem 1.1rem; border-bottom: 2px solid var(--ink); }
.next p { margin: 0; }
.next-label { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); font-weight: 700; }
.next-date { font-family: var(--serif); font-size: clamp(1.4rem, 4.5vw, 1.9rem); line-height: 1.2; }
.next-what { font-size: 0.98rem; font-weight: 500; opacity: 0.92; }
.next-what b { color: var(--amber); }

.tool-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding: 1.1rem; }
@media (min-width: 880px) {
  .tool-body { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 2rem; }
}

.field-label { display: block; font-weight: 700; margin: 0 0 0.5rem; }
.lbl-gap { margin-top: 1.1rem; }
.hint { font-size: 0.88rem; color: var(--pencil); margin: 0.4rem 0 0; }
.hint:empty { display: none; }
.form-msg { margin: 0.6rem 0 0; font-size: 0.95rem; color: var(--no); font-weight: 500; }
.form-msg:empty { display: none; }

input[type="text"], input[type="date"], select {
  width: 100%; font: inherit; font-size: 1.05rem; color: var(--ink);
  background: #fff; border: 2px solid var(--ink); border-radius: 4px;
  padding: 0.6rem 0.75rem; min-height: 46px;
}
#ruc { font-size: 1.2rem; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
select { cursor: pointer; }

.checks { border: 1px solid var(--line); border-radius: 4px; margin: 1.1rem 0 0; padding: 0.5rem 0.8rem 0.7rem; }
.checks legend { font-weight: 700; padding: 0 0.3rem; }
.checks label, .check { display: flex; gap: 0.55rem; align-items: baseline; padding: 0.3rem 0; cursor: pointer; line-height: 1.35; }
.checks small, .check small { color: var(--pencil); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--ink); flex: none; transform: translateY(3px); }

.btn-ghost {
  font: inherit; font-weight: 500; cursor: pointer;
  background: #fff; color: var(--ink);
  border: 2px solid var(--ink); border-radius: 4px; padding: 0.55rem 0.9rem; min-height: 44px;
}
.btn-ghost:hover { background: var(--amber-soft); }
.btn-ghost:disabled { opacity: 0.45; cursor: not-allowed; background: #fff; }

.more { margin-top: 1rem; }
.more summary { cursor: pointer; font-weight: 500; font-size: 0.95rem; padding: 0.3rem 0; }
.sub { font-weight: 700; margin: 0.9rem 0 0; font-size: 0.95rem; }
.local-row { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.local-row input { flex: 1; min-width: 0; }
.chips { list-style: none; padding: 0; margin: 0.6rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chips li { display: inline-flex; align-items: center; gap: 0.3rem; background: var(--amber-soft); border-radius: 999px; padding: 0.15rem 0.3rem 0.15rem 0.7rem; font-size: 0.9rem; }
.chips button { font: inherit; border: 0; background: none; cursor: pointer; width: 26px; height: 26px; border-radius: 50%; color: var(--ink); }
.chips button:hover { background: rgba(17, 42, 58, 0.12); }

/* Result */
.res-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.6rem; }
.res-msg { background: var(--amber-soft); border-left: 4px solid var(--amber); padding: 0.5rem 0.7rem; font-weight: 500; font-size: 0.95rem; }
.res-msg:empty { display: none; }

.dates { list-style: none; padding: 0; margin: 0; max-height: 30rem; overflow-y: auto; border-top: 1px solid var(--line); }
.dates .month { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pencil); font-weight: 700; padding: 0.8rem 0 0.2rem; }
.dates .item { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); gap: 0.7rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); align-items: start; }
.day { text-align: center; border: 2px solid var(--ink); border-radius: 4px; line-height: 1.1; padding: 0.25rem 0; background: #fff; }
.day b { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.35rem; }
.day small { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--pencil); }
.item.first .day { background: var(--amber); }
.item .what { font-weight: 700; line-height: 1.3; }
.item .det { font-size: 0.88rem; color: var(--pencil); margin-top: 0.15rem; }
.item .moved { font-size: 0.85rem; margin-top: 0.2rem; }
.item .moved::before { content: "↷ "; color: var(--amber); font-weight: 700; }
.dates .empty { padding: 1rem 0; color: var(--pencil); }

.actions { display: grid; grid-template-columns: 1fr auto; gap: 0.6rem; margin-top: 1rem; }
.btn-primary {
  font: inherit; font-weight: 700; font-size: 1.02rem; cursor: pointer;
  background: var(--ink); color: var(--paper);
  border: 2px solid var(--ink); border-radius: 4px; padding: 0.75rem 1rem; min-height: 46px;
}
.btn-primary:hover { background: #0b1d29; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.source { font-size: 0.82rem; color: var(--pencil); margin: 0.9rem 0 0; }

/* Ad slots (placeholders) */
.ad-slot {
  min-height: 90px; margin: 2rem 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line); border-radius: 4px;
  color: rgba(77, 98, 110, 0.55); font-size: 0.8rem;
}

/* Content sections */
.how, .seo, .faq { max-width: 46rem; margin: 3rem 0; }
.how h2, .faq h2 { margin-bottom: 1rem; }
.seo h2 { margin: 1.8rem 0 0.8rem; }
.seo h2:first-child { margin-top: 0; }
.steps { padding-left: 1.4rem; margin: 0; }
.steps li { margin-bottom: 0.8rem; padding-left: 0.3rem; }
.seo p { max-width: 42rem; }

.table-wrap { overflow-x: auto; margin-bottom: 1em; }
table.digits { border-collapse: collapse; background: #fff; border: 2px solid var(--ink); font-variant-numeric: tabular-nums; }
.digits th, .digits td { padding: 0.4rem 0.6rem; border: 1px solid var(--line); text-align: center; white-space: nowrap; }
.digits th { text-align: left; font-size: 0.85rem; }
.digits thead { background: var(--amber-soft); }

.faq summary { cursor: pointer; font-weight: 500; }
.faq details { border-top: 1px solid var(--line); padding: 0.8rem 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq details p { margin: 0.6rem 0 0; color: var(--pencil); }

.foot { padding: 2rem 0 3rem; border-top: 2px solid var(--ink); color: var(--pencil); font-size: 0.9rem; }
.foot p { margin: 0; }
.noscript { background: var(--amber); padding: 1rem; text-align: center; margin: 0; }

@media (max-width: 420px) {
  .top nav a[href="#preguntas"] { display: none; }
  .actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Escondido hasta que AdSense apruebe; entonces borrar esta regla y poner los bloques. */
.ad-slot { display: none !important; }
