/* Estilo copiado del formulario oficial "Registro de clientes DTE" (PDF/Excel de LeonSol):
   Arial, tabla con borde negro, barras rojas #C00000 con texto blanco, etiquetas en negrita,
   franja inferior de tres rojos y notas en gris. */
:root {
  --red: #C00000;
  --red-2: #FF0F0F;
  --red-3: #FF5F5F;
  --logo-red: #FF1E12;
  --ink: #000;
  --gray: #808080;
  --line: #000;
  --soft: #FFF4F4;
  --bg: #EDEDED;
  --font: Arial, "Helvetica Neue", Helvetica, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.35 var(--font); }
[hidden] { display: none !important; }
.wrap { max-width: 900px; margin: 0 auto; padding: 0 16px; }
.mono { font-family: var(--font); }
.opt { color: var(--gray); font-weight: normal; }
.hint { margin: 4px 0 0; font-size: 12px; color: var(--gray); }

/* Hoja */
.sheet { background: #fff; max-width: 900px; margin: 28px auto; padding: 44px 48px 36px; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.06); }
.sheet-top { display: flex; justify-content: flex-end; margin: -24px -28px 8px 0; }
.lang { display: inline-flex; border: 1px solid #000; }
.lang button { background: #fff; border: 0; border-right: 1px solid #000; font: bold 11px var(--font); padding: 5px 10px; cursor: pointer; }
.lang button:last-child { border-right: 0; }
.lang button[aria-pressed="true"] { background: var(--red); color: #fff; }

.doc-head { display: flex; align-items: center; gap: 26px; margin-bottom: 26px; }
.logo { display: block; width: 172px; flex: none; color: var(--logo-red); }
.logo svg { width: 100%; height: auto; display: block; }
.logo svg path { fill: var(--logo-red); }
.doc-head h1 { margin: 0; font-size: 17px; line-height: 1.3; font-weight: bold; text-transform: uppercase; }
.instr { font-weight: bold; font-size: 14.5px; margin: 0 0 18px; max-width: 640px; }

/* Tabla del formulario */
.form-table { border: 2px solid var(--line); }
.bar { background: var(--red); color: #fff; font-weight: bold; text-align: center; padding: 8px 10px; font-size: 14px; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.row { display: grid; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.c { padding: 8px 8px; border-right: 1px solid var(--line); min-width: 0; position: relative; display: flex; flex-direction: column; justify-content: center; }
.c:last-child { border-right: 0; }
.lbl { font-weight: bold; font-size: 13.5px; }
.lbl .req, .block-lbl .req { color: var(--red); margin-left: 2px; }
.r-name { grid-template-columns: 150px 1fr; min-height: 56px; }
.r-ids  { grid-template-columns: 150px 1fr 180px 1fr; min-height: 56px; }
.r-nrc  { grid-template-columns: 150px 1fr 2fr; }
.r-code { grid-template-columns: 1fr 300px; min-height: 36px; }
.r-dte  { grid-template-columns: 240px 1fr; min-height: 36px; }
.r-half { grid-template-columns: 1fr 1fr; }

input[type=text], input[type=email], input[type=tel], input[type=password], textarea, select {
  width: 100%; border: 0; background: transparent; font: 14px var(--font); color: #1F3864; padding: 6px 4px; outline: none; border-radius: 0;
}
textarea { resize: vertical; min-height: 70px; }
.c:focus-within, .block:focus-within { background: var(--soft); }
input::placeholder, textarea::placeholder { color: #B5B5B5; }

/* Categoría de contribuyente */
.cat { padding: 0; }
.cat-title { text-align: center; font-weight: bold; padding: 6px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.cat-opts { display: grid; grid-template-columns: 1fr 36px 1fr 36px 1fr 36px; }
.cat-opts label { display: contents; cursor: pointer; }
.cat-opts .name { text-align: center; font-weight: bold; padding: 6px 4px; border-right: 1px solid var(--line); font-size: 13.5px; cursor: pointer; }
.cat-opts .box { border-right: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-weight: bold; color: #1F3864; font-size: 16px; cursor: pointer; }
.cat-opts label:last-child .box { border-right: 0; }
.cat-opts input { position: absolute; opacity: 0; pointer-events: none; }
.cat-opts input:checked + .name + .box::after { content: "X"; }
.cat-opts input:focus-visible + .name { outline: 2px solid var(--red); outline-offset: -3px; }

/* Bloques con líneas numeradas */
.block { padding: 8px 8px 10px; border-right: 1px solid var(--line); min-width: 0; }
.block:last-child, .row:not(.r-half) > .block { border-right: 0; }
.block-lbl { font-weight: bold; font-size: 13.5px; display: block; margin-bottom: 4px; }
.line { display: grid; grid-template-columns: 24px 1fr; align-items: end; margin-left: 14px; }
.line .n { font-weight: bold; padding-bottom: 6px; }
.line input { border-bottom: 1px solid var(--line); }
.inline2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.inline2 .line input { border-bottom: 1px solid #BDBDBD; }
.note { text-align: center; font-size: 11px; color: var(--gray); font-weight: bold; padding: 12px 20px 6px; }
.dte-lbl { background: var(--red); color: #fff; }
.stripe { display: grid; grid-template-columns: 30% 38% 32%; height: 14px; border-top: 2px solid var(--line); }
.stripe span:nth-child(1) { background: var(--red); }
.stripe span:nth-child(2) { background: var(--red-2); }
.stripe span:nth-child(3) { background: var(--red-3); }

.importante { color: var(--gray); font-weight: bold; margin: 16px 0 10px; }

/* Formulario de descubrimiento: filas etiqueta | valor, listas y casillas con X */
.r-one  { grid-template-columns: 230px 1fr; min-height: 40px; }
.r-pair { grid-template-columns: 170px 1fr 170px 1fr; min-height: 40px; }
select { cursor: pointer; appearance: none; -webkit-appearance: none; padding-right: 22px;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23C00000'/%3E%3C/svg%3E") no-repeat right 6px center; }
input[type=date] { width: 100%; border: 0; background: transparent; font: 14px var(--font); color: #1F3864; padding: 6px 4px; outline: none; }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 24px; margin: 4px 0 0 14px; }
.chk { display: grid; grid-template-columns: 22px 1fr; align-items: start; gap: 8px; padding: 4px 0; cursor: pointer; font-size: 13.5px; }
.chk input { position: absolute; opacity: 0; pointer-events: none; }
.chk .box { width: 20px; height: 20px; border: 1px solid #000; display: flex; align-items: center; justify-content: center; font-weight: bold; color: #1F3864; background: #fff; }
.chk input:checked + .box::after { content: "X"; }
.chk input:focus-visible + .box { outline: 2px solid var(--red); outline-offset: 1px; }
.chk.solo { grid-template-columns: 22px auto; align-items: center; font-weight: bold; }

/* Adjunto */
.drop { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border: 1px dashed #000; padding: 14px; cursor: pointer; background: #fff; }
.drop.over { background: var(--soft); border-color: var(--red); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop .file-name { font-weight: bold; word-break: break-all; color: #1F3864; }
.drop .muted { color: var(--gray); }
.adj-title { font-weight: bold; margin: 0 0 8px; }
.adj-title .req { color: var(--red); }

/* Errores */
.invalid { background: #FFECEC !important; box-shadow: inset 0 0 0 2px var(--red); }
.line.invalid { background: transparent !important; box-shadow: none; }
.line.invalid input { border-bottom: 2px solid var(--red); }
.error-msg { margin: 3px 0 0; font-size: 11.5px; color: var(--red); font-weight: bold; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--red); color: #fff; border: 0; padding: 12px 22px; font: bold 14px var(--font); cursor: pointer; text-decoration: none; border-radius: 0; text-transform: uppercase; letter-spacing: .02em; }
.btn:hover { background: #A00000; }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-light { background: #fff; color: #000; border: 1px solid #000; padding: 8px 14px; font-size: 12px; text-transform: none; letter-spacing: 0; }
.btn-light:hover { background: #000; color: #fff; }
.submit-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 20px; }
#captcha { margin-top: 16px; }

.banner { border: 2px solid var(--red); background: var(--soft); padding: 14px 16px; font-weight: bold; margin-bottom: 18px; }
.done { border: 2px solid #000; }
.done .bar { text-align: left; }
.done-body { padding: 24px; }
.done-body h2 { margin: 0 0 8px; font-size: 20px; }
.done-body p { margin: 0 0 18px; max-width: 60ch; }

.foot { text-align: center; color: var(--gray); font-size: 11px; padding: 0 16px 28px; }

@media (max-width: 760px) {
  .sheet { margin: 0; padding: 24px 14px 28px; box-shadow: none; }
  .sheet-top { margin: -8px 0 10px; }
  .doc-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .doc-head h1 { font-size: 14px; }
  .logo { width: 130px; }
  .r-name, .r-ids, .r-nrc, .r-code, .r-dte, .r-half, .r-one, .r-pair { grid-template-columns: 1fr; }
  .opt-grid { grid-template-columns: 1fr; margin-left: 0; }
  .c, .block { border-right: 0; border-bottom: 1px solid var(--line); }
  .row > :last-child { border-bottom: 0; }
  .c.lbl { padding-bottom: 0; border-bottom: 0; }
  .dte-lbl.c { padding-bottom: 8px; }
  .cat-opts { grid-template-columns: 1fr 32px 1fr 32px 1fr 32px; }
  .cat-opts .name { font-size: 12px; }
  .inline2 { grid-template-columns: 1fr; gap: 0; }
}
