/* NexZoo — Generador de cartel de mascota perdida  v1.0.0 */

.nz-gen {
  --nz-morado: #6252B0;
  --nz-morado-osc: #4a3d8f;
  --nz-amarillo: #FEDE77;
  --nz-rojo: #D92B2B;
  --nz-tinta: #2b2833;
  --nz-borde: #e3e0ea;
  --nz-fondo: #f7f6fa;
  margin: 2.5rem 0;
  padding: 0;
  border: 1px solid var(--nz-borde);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 18px rgba(43, 40, 51, .07);
  color: var(--nz-tinta);
  font-family: inherit;
}

.nz-gen__head {
  background: linear-gradient(135deg, var(--nz-morado) 0%, var(--nz-morado-osc) 100%);
  color: #fff;
  padding: 1.4rem 1.6rem;
}
.nz-gen__head h2,
.nz-gen__head .nz-gen__t {
  margin: 0 0 .35rem;
  font-size: 1.32rem;
  line-height: 1.25;
  color: #fff;
  font-weight: 700;
}
.nz-gen__head p {
  margin: 0;
  font-size: .95rem;
  line-height: 1.5;
  opacity: .92;
  color: #fff;
}

.nz-gen__cuerpo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
}
@media (max-width: 860px) {
  .nz-gen__cuerpo { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- formulario ---------- */
.nz-gen__form {
  padding: 1.5rem;
  background: #fff;
  min-width: 0;
}
.nz-campo { margin-bottom: 1.05rem; }
.nz-campo:last-child { margin-bottom: 0; }
.nz-campo label {
  display: block;
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .01em;
  margin-bottom: .35rem;
  color: var(--nz-tinta);
}
.nz-campo .nz-ayuda {
  display: block;
  font-weight: 400;
  font-size: .78rem;
  color: #6f6a7d;
  margin-top: .3rem;
  line-height: 1.4;
}
.nz-gen input[type="text"],
.nz-gen input[type="tel"],
.nz-gen textarea,
.nz-gen select {
  width: 100%;
  box-sizing: border-box;
  padding: .62rem .8rem;
  border: 1.5px solid var(--nz-borde);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--nz-tinta);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.nz-gen input[type="text"]:focus,
.nz-gen input[type="tel"]:focus,
.nz-gen textarea:focus,
.nz-gen select:focus {
  outline: none;
  border-color: var(--nz-morado);
  box-shadow: 0 0 0 3px rgba(98, 82, 176, .16);
}
.nz-gen textarea { min-height: 62px; resize: vertical; }

.nz-foto-btn {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  box-sizing: border-box;
  padding: .85rem 1rem;
  border: 2px dashed #c9c3da;
  border-radius: 10px;
  background: var(--nz-fondo);
  cursor: pointer;
  font-size: .93rem;
  font-weight: 600;
  color: var(--nz-morado);
  text-align: left;
  font-family: inherit;
  transition: border-color .15s ease, background .15s ease;
}
.nz-foto-btn:hover { border-color: var(--nz-morado); background: #f1eefb; }
.nz-foto-btn span[aria-hidden] { font-size: 1.3rem; line-height: 1; }
.nz-gen input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.nz-check {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  font-size: .88rem;
  line-height: 1.45;
  cursor: pointer;
}
.nz-check input { margin-top: .18rem; flex: none; }

.nz-aviso {
  margin-top: .5rem;
  padding: .6rem .75rem;
  background: #FFF6DA;
  border-left: 3px solid #E5B800;
  border-radius: 0 6px 6px 0;
  font-size: .8rem;
  line-height: 1.45;
  color: #6b5600;
}

.nz-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1.3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--nz-borde);
}
.nz-btn {
  flex: 1 1 auto;
  padding: .8rem 1.1rem;
  border-radius: 9px;
  border: 2px solid transparent;
  font-size: .97rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.nz-btn:active { transform: translateY(1px); }
.nz-btn--print {
  background: var(--nz-morado);
  color: #fff;
  box-shadow: 0 3px 10px rgba(98, 82, 176, .28);
}
.nz-btn--print:hover { background: var(--nz-morado-osc); }
.nz-btn--limpiar {
  background: #fff;
  color: #6f6a7d;
  border-color: var(--nz-borde);
  flex: 0 1 auto;
}
.nz-btn--limpiar:hover { border-color: #b9b2cc; color: var(--nz-tinta); }

.nz-privacidad {
  margin: .9rem 0 0;
  font-size: .78rem;
  line-height: 1.5;
  color: #6f6a7d;
}

/* ---------- vista previa ---------- */
.nz-gen__preview {
  padding: 1.5rem;
  background: var(--nz-fondo);
  border-left: 1px solid var(--nz-borde);
  min-width: 0;
}
@media (max-width: 860px) {
  .nz-gen__preview { border-left: 0; border-top: 1px solid var(--nz-borde); }
}
.nz-preview-tit {
  margin: 0 0 .8rem;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #6f6a7d;
}

.nz-hoja-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
}
.nz-hoja {
  /* Repetidas aquí a propósito: al imprimir clonamos la hoja fuera de .nz-gen
     y sin esto perdería las variables (el título salía en negro). */
  --nz-rojo: #D92B2B;
  width: 210mm;
  height: 297mm;
  box-sizing: border-box;
  padding: 13mm 12mm;
  background: #fff;
  color: #000;
  transform-origin: top left;
  box-shadow: 0 3px 16px rgba(43, 40, 51, .16);
  display: flex;
  flex-direction: column;
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}

.nz-h-titulo {
  font-size: 30mm;
  line-height: .95;
  font-weight: 900;
  color: var(--nz-rojo);
  text-align: center;
  letter-spacing: .02em;
  margin: 0 0 1mm;
}
.nz-h-sub {
  font-size: 6.4mm;
  line-height: 1.15;
  font-weight: 700;
  text-align: center;
  margin: 0 0 4mm;
  color: #000;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.nz-h-foto {
  width: 100%;
  /* Crece para llenar la hoja: así el cartel queda equilibrado
     tanto si hay muchas señas como si hay pocas. */
  flex: 1 1 auto;
  min-height: 85mm;
  background: #ececec;
  border: 0.8mm solid #000;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 4mm;
}
.nz-h-foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.nz-h-foto .nz-h-foto-ph {
  font-size: 5mm;
  color: #8d8d8d;
  text-align: center;
  padding: 0 8mm;
  line-height: 1.4;
  font-weight: 600;
}

.nz-h-nombre {
  font-size: 15mm;
  line-height: 1.05;
  font-weight: 900;
  text-align: center;
  margin: 0 0 1.5mm;
  color: #000;
  word-break: break-word;
}
.nz-h-desc {
  font-size: 6mm;
  line-height: 1.25;
  text-align: center;
  margin: 0 0 3mm;
  color: #000;
  font-weight: 600;
}

.nz-h-datos {
  font-size: 5.2mm;
  line-height: 1.42;
  margin: 0 0 3mm;
  color: #000;
}
.nz-h-datos p { margin: 0 0 1.4mm; }
.nz-h-datos p:last-child { margin-bottom: 0; }
.nz-h-datos strong { font-weight: 800; }

.nz-h-pie {
  margin-top: auto;
  border: 0.8mm solid #000;
  padding: 3.5mm 4mm;
  display: flex;
  align-items: center;
  gap: 4mm;
}
.nz-h-contacto { flex: 1 1 auto; min-width: 0; }
.nz-h-llama {
  font-size: 4.6mm;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin: 0 0 .8mm;
  color: #000;
}
.nz-h-tel {
  font-size: 14mm;
  line-height: 1;
  font-weight: 900;
  color: #000;
  margin: 0;
  letter-spacing: -.01em;
  word-break: break-word;
}
.nz-h-qr {
  flex: none;
  width: 26mm;
  text-align: center;
}
.nz-h-qr img {
  width: 26mm;
  height: 26mm;
  display: block;
}
.nz-h-qr span {
  display: block;
  font-size: 2.7mm;
  line-height: 1.2;
  margin-top: .8mm;
  font-weight: 700;
  color: #000;
}
.nz-h-qr[hidden] { display: none; }

.nz-h-recompensa {
  text-align: center;
  font-size: 6mm;
  font-weight: 900;
  text-transform: uppercase;
  margin: 0 0 3mm;
  color: var(--nz-rojo);
  letter-spacing: .02em;
}
.nz-h-recompensa[hidden] { display: none; }

.nz-h-marca {
  margin: 2.5mm 0 0;
  font-size: 3.2mm;
  text-align: center;
  color: #666;
  letter-spacing: .02em;
}

/* ---------- impresión ---------- */
@media print {
  @page { size: A4 portrait; margin: 0; }

  html, body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    width: 210mm !important;
    min-width: 210mm !important;
    max-width: 210mm !important;
    overflow: hidden !important;
  }
  body.nz-imprimiendo > * { display: none !important; }
  body.nz-imprimiendo .nz-hoja-impresion { display: block !important; }

  .nz-hoja-impresion {
    position: static !important;
    width: 210mm !important;
    height: 297mm !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }
  .nz-hoja-impresion .nz-hoja {
    transform: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    width: 210mm !important;
    height: 297mm !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }
}
.nz-hoja-impresion { display: none; }
