/* Pagina publica: pensada para leerse de una en un celular, a pleno sol,
   por alguien apurado que acaba de encontrar una mascota. */

:root {
  --teal: #0f766e;
  --teal-dark: #0b5b55;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e3e6ec;
  --bg: #f4f5f7;
  --wa: #25d366;
  --danger: #b91c1c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* ------------------------------- Hero ---------------------------------- */

.hero { text-align: center; padding: 8px 0 20px; }

.hero-badge {
  display: inline-block;
  background: #e6f2f1;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.pet-photo {
  display: block;
  width: 160px;
  height: 160px;
  margin: 0 auto 16px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid #fff;
  box-shadow: 0 6px 24px rgba(15, 23, 42, .14);
  background: #fff;
}

.pet-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 68px;
  line-height: 1;
}

.pet-name { margin: 0 0 8px; font-size: 28px; line-height: 1.2; }
.pet-claim { margin: 0; color: var(--muted); font-size: 16px; }

/* ------------------------------ Tarjetas -------------------------------- */

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
}

.card h2 { margin: 0 0 10px; font-size: 17px; }
.card p { margin: 0 0 10px; }
.card p:last-child { margin-bottom: 0; }

.card-primary { border-color: #bfe0dd; box-shadow: 0 4px 16px rgba(15, 118, 110, .08); }
.card-alert { border-left: 5px solid var(--danger); background: #fff5f5; }
.card-alert h2 { color: var(--danger); }
.card-tip { border-left: 5px solid #d97706; background: #fffaf0; }
.card-tip h2 { color: #b45309; }
.card-reward { border-left: 5px solid #7c3aed; background: #faf7ff; }
.card-reward h2 { color: #6d28d9; }
.card-locate { border-color: #bfe0dd; }

.owner-line { margin-bottom: 14px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ------------------------------- Botones -------------------------------- */

.btn {
  display: block;
  width: 100%;
  padding: 15px 18px;
  margin-bottom: 10px;
  border: 0;
  border-radius: 12px;
  background: var(--teal);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
}

.btn:last-child { margin-bottom: 0; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: default; }

.btn-call { background: var(--teal); }
.btn-wa { background: var(--wa); color: #06301a; }
.btn-sms { background: #2563eb; }
.btn-mail { background: #475569; }
.btn-locate { background: #ea580c; font-size: 18px; padding: 17px; }

.btn-ghost {
  background: #fff;
  color: var(--teal-dark);
  border: 1.5px solid #cfe2e0;
  font-weight: 600;
}

/* --------------------------- Direccion oculta ---------------------------- */

.address-box {
  margin-top: 4px;
  padding: 14px;
  background: #f8fafa;
  border: 1px dashed #cfe2e0;
  border-radius: 12px;
}

.address-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 4px;
}

.address-box p { margin: 0 0 8px; font-weight: 600; }
.address-box a { color: var(--teal-dark); }

/* ------------------------------ Compartir -------------------------------- */

.status { margin: 12px 0 0; font-size: 15px; color: var(--muted); }
.status:empty { margin: 0; }

.share-title { margin: 16px 0 10px; font-weight: 700; }
.share-grid { display: grid; grid-template-columns: 1fr; gap: 0; }

.map-preview {
  display: block;
  margin-top: 8px;
  text-align: center;
  color: var(--teal-dark);
  font-size: 15px;
}

/* -------------------------------- Datos ---------------------------------- */

.facts { margin: 0; }
.facts > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); font-size: 15px; }
.facts dd { margin: 0; font-weight: 600; text-align: right; }

.steps { margin: 0; padding-left: 20px; color: var(--muted); }
.steps li { margin-bottom: 8px; }

/* ------------------------ Formularios del dueno --------------------------- */

.card-consent { border-left: 5px solid var(--teal); background: #f7fbfb; }
.card-ok { border-left: 5px solid #15803d; background: #f2fbf5; }

.consent-text {
  font-size: 15px;
  line-height: 1.6;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}

.errors { margin: 0; padding-left: 20px; }
.errors li { margin-bottom: 6px; }

.mono {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 14px;
  word-break: break-all;
}

.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-weight: 700; font-size: 15px; }
.field small { display: block; margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.45; }

.field input, .field select, .field textarea, .copy-row input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid #cfd4dc;
  border-radius: 11px;
  font: inherit;
  font-size: 16px; /* menos de 16px hace que iOS haga zoom al enfocar */
  background: #fff;
  color: var(--ink);
}

.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid #9fd1cb;
  border-color: var(--teal);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0;
  font-size: 15px;
  line-height: 1.5;
  cursor: pointer;
}
.check input { width: 22px; height: 22px; flex: 0 0 auto; margin-top: 1px; }

.copy-row { margin-bottom: 10px; }
.copy-row input { font-size: 14px; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* El PIN del empaque y el codigo OTP se teclean mirando un papel o un correo:
   conviene que se vean grandes y espaciados para no equivocarse. */
.pin-input, .otp-input {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .3em;
  text-align: center;
  text-transform: uppercase;
  padding: 14px 10px;
}

.otp-input { letter-spacing: .38em; text-transform: none; }

.photo-current { margin-top: 12px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.photo-current img { width: 90px; height: 90px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); }

/* ------------------------- Lista de mascotas ------------------------------ */

.pet-list { list-style: none; margin: 0 0 16px; padding: 0; }

.pet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.pet-item:last-child { border-bottom: 0; }

.pet-thumb { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: #eef1f4; }
.pet-thumb-empty { display: flex; align-items: center; justify-content: center; font-size: 24px; }

.pet-item-body { flex: 1; min-width: 120px; display: flex; flex-direction: column; }
.pet-item-actions { display: flex; gap: 8px; align-items: center; }
.pet-item-actions .btn { width: auto; padding: 9px 14px; font-size: 15px; margin: 0; }

/* Enlace para el dueno al pie de la pagina publica. Deliberadamente discreto:
   no debe competir con los botones de contacto, que son lo urgente. */
.owner-link {
  margin: 18px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.owner-link a { color: var(--teal-dark); }

.foot {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

@media (min-width: 520px) {
  .share-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .share-grid .btn { margin-bottom: 0; }
}
