/* =========================================================
   NFC Pet Profile — styles.css
   Mobile-first, clean, premium. Green accent #16A34A.
   ========================================================= */

:root {
  --green: #16A34A;
  --green-dark: #15803D;
  --green-soft: #DCFCE7;
  --whatsapp: #25D366;
  --whatsapp-dark: #1FA855;
  --lost: #EA580C;          /* warm orange for "lost" */
  --lost-bg: #FFF1E8;

  --ink: #111827;
  --ink-soft: #4B5563;
  --ink-faint: #6B7280;
  --line: #E5E7EB;
  --bg: #F3F4F6;
  --card: #FFFFFF;

  --radius: 18px;
  --radius-lg: 24px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Skip link — visible on keyboard focus */
.skip-link {
  position: absolute;
  left: 50%;
  top: -100px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 12px 12px;
  z-index: 100;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0; }

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 32px;
}

/* ===================== HERO ===================== */
.hero { padding-top: 20px; }

.hero__photo-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 1 / 1;
  background: #e9eaec;
}

.hero__photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: #fff;
  box-shadow: var(--shadow);
  backdrop-filter: saturate(1.2);
}
.badge--lost { background: var(--lost); }

.badge__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.hero__intro {
  text-align: center;
  padding: 20px 8px 4px;
}
.hero__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green);
}
.hero__name {
  margin: 4px 0 2px;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero__plea {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

/* ===================== BUTTONS ===================== */
.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 22px 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.08s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  color: #fff;
}
.btn:active { transform: scale(0.985); }

.btn__icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
  flex: none;
}

.btn--primary { background: var(--green); }
.btn--primary:hover { background: var(--green-dark); }

.btn--whatsapp { background: var(--whatsapp); }
.btn--whatsapp:hover { background: var(--whatsapp-dark); }

.btn--secondary {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow);
}
.btn--secondary:hover { border-color: #d1d5db; background: #fafafa; }

.btn--block { width: 100%; }

/* Focus visibility for keyboard users */
.btn:focus-visible,
.skip-link:focus-visible,
a:focus-visible {
  outline: 3px solid #86efac;
  outline-offset: 2px;
}

/* ===================== CARDS ===================== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 14px;
}
.card--muted { background: #fbfbfc; }
.card--steps { padding-bottom: 8px; }

.card__title {
  margin: 0 0 14px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.card__title--sm { font-size: 1rem; }

.card__text { margin: 0; color: var(--ink-soft); }
.card__text--sm { font-size: 0.92rem; }
.card__note {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: var(--ink-faint);
}

/* Definition list grids */
.info-grid { margin: 0; }
.info-grid__row,
.loc-details__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.info-grid__row:last-child,
.loc-details__row:last-child { border-bottom: none; }

.info-grid dt,
.loc-details dt {
  color: var(--ink-faint);
  font-weight: 600;
}
.info-grid dd,
.loc-details dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
  word-break: break-word;
}

/* ===================== LOCATION PANEL ===================== */
.location__explainer {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.loc-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.loc-state__msg {
  margin: 0;
  color: var(--ink-soft);
  text-align: center;
}
.loc-state__msg--error { color: #b91c1c; font-weight: 600; }

.loc-result { width: 100%; }
.loc-result__confirm {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  padding: 14px;
  background: var(--green-soft);
  border-radius: 14px;
  color: var(--green-dark);
  font-weight: 700;
}
.loc-result__check {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  font-size: 0.9rem;
}

.loc-details {
  margin: 0 0 16px;
  padding: 4px 16px;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.loc-details + .btn { margin-bottom: 10px; }

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== STEPS ===================== */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
}
.steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
.steps li:last-child { border-bottom: none; }
.steps__num {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: var(--green-soft);
  color: var(--green-dark);
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.85rem;
}

/* ===================== FOOTER ===================== */
.footer {
  text-align: center;
  padding: 24px 0 8px;
  color: var(--ink-faint);
  font-size: 0.85rem;
}

/* ===================== RESPONSIVE (desktop) ===================== */
@media (min-width: 640px) {
  .page { max-width: 560px; padding-top: 8px; }
  .hero__name { font-size: 2.7rem; }
  .actions { flex-direction: row; flex-wrap: wrap; }
  .actions .btn { flex: 1 1 100%; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
