/* ==========================================================================
   HuellaQR — sistema de diseño
   ========================================================================== */
:root {
  --brand: #f26b3a;
  --brand-600: #dc5523;
  --brand-700: #b8431a;
  /* Fondos de botón con contraste AA (≥ 4.5:1) para texto blanco */
  --btn: #c84b1c;
  --btn-hover: #a83e16;
  --mint-btn: #17805e;
  --mint-btn-hover: #116b4e;
  --brand-50: #fff3ec;
  --brand-100: #ffe3d4;
  --ink: #1f1a17;
  --ink-2: #3a322c;
  --muted: #6b625b;
  --bg: #fbf7f2;
  --surface: #ffffff;
  --line: #ece4da;
  --line-2: #f4eee7;
  --mint: #1f9d74;
  --mint-50: #e6f6ef;
  --danger: #d23c3c;
  --danger-50: #fdecec;
  --warn-50: #fff6e5;
  --warn-700: #8a5a0b;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(31, 26, 23, .06);
  --shadow: 0 1px 2px rgba(31, 26, 23, .04), 0 8px 24px rgba(31, 26, 23, .06);
  --shadow-lg: 0 24px 60px rgba(31, 26, 23, .12);

  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 16px; line-height: 1.55;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--brand-700); text-underline-offset: 2px; }
a:hover { color: #8f3311; }
a, button, input, select, textarea, label { -webkit-tap-highlight-color: transparent; }
button, .btn, a { touch-action: manipulation; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 800; text-decoration: none; transition: top .15s; }
.skip-link:focus { top: 12px; color: #fff; }
:focus-visible { outline: 3px solid rgba(242, 107, 58, .45); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--brand-100); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(1.75rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.6rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.lead { font-size: 1.08rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.mono, code { font-family: var(--mono); font-weight: 700; letter-spacing: .02em; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main { flex: 1; width: 100%; }
main:focus { outline: none; }
.page { max-width: 1040px; margin: 0 auto; padding: 32px 16px 72px; }
.page.narrow { max-width: 480px; }
.page.medium { max-width: 760px; }

/* --------------------------------------------------------------------------
   Encabezado
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251, 247, 242, .86); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: -.01em; }
.logo img { width: 34px; height: 34px; }
.logo b { font-weight: inherit; }
.logo span { color: var(--brand); }
.logo:hover { color: var(--ink); }

.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 24px; }
.main-nav a { padding: 8px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: .95rem; }
.main-nav a:hover, .main-nav a.active { background: var(--brand-50); color: var(--brand-700); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.user-menu { position: relative; }
.avatar-btn { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font: inherit; font-weight: 700; color: var(--ink); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--btn); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .9rem; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; }
.dropdown .who { padding: 10px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.dropdown .who b { display: block; }
.dropdown a, .dropdown button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 0; background: none; font: inherit; font-weight: 700; color: var(--ink-2); text-decoration: none; cursor: pointer; text-align: left; }
.dropdown a:hover, .dropdown button:hover { background: var(--line-2); color: var(--ink); }

.menu-toggle { display: none; margin-left: auto; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; align-items: center; justify-content: center; }
.menu-toggle svg { width: 22px; height: 22px; }
.mobile-menu { display: none; }

@media (max-width: 820px) {
  .main-nav, .header-actions { display: none; }
  .menu-toggle { display: inline-flex; }
  .mobile-menu.open { display: block; border-top: 1px solid var(--line); background: var(--surface); padding: 8px 16px 16px; }
  .mobile-menu a, .mobile-menu button { display: block; width: 100%; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--line-2); background: none; font: inherit; font-weight: 700; color: var(--ink); text-decoration: none; text-align: left; cursor: pointer; }
  .mobile-menu .btn { margin-top: 12px; border-bottom: 0; text-align: center; }
}

/* --------------------------------------------------------------------------
   Pie de página
   -------------------------------------------------------------------------- */
.site-footer { background: var(--ink); color: #d9d1ca; margin-top: auto; }
.site-footer .container { padding-top: 40px; padding-bottom: 28px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer .logo { color: #fff; }
.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: 12px; }
.site-footer a { color: #d9d1ca; text-decoration: none; display: block; padding: 4px 0; }
.site-footer a:hover { color: #fff; }
.site-footer .legal { grid-column: 1 / -1; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 18px; font-size: .82rem; color: #a59c94; }
@media (max-width: 700px) { .site-footer .container { grid-template-columns: 1fr 1fr; } .site-footer .brand-col { grid-column: 1 / -1; } }

/* --------------------------------------------------------------------------
   Botones
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border-radius: 12px; border: 1.5px solid transparent;
  font: inherit; font-weight: 800; font-size: 1rem; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--btn); color: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, .05), 0 6px 16px rgba(200, 75, 28, .25);
  transition: background .15s, box-shadow .15s, transform .06s, border-color .15s;
}
.btn:hover { background: var(--btn-hover); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-busy=true] { opacity: .6; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn.secondary:hover { background: var(--line-2); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: none; }
.btn.ghost:hover { background: var(--line-2); }
.btn.mint { background: var(--mint-btn); box-shadow: 0 6px 16px rgba(23, 128, 94, .25); }
.btn.mint:hover { background: var(--mint-btn-hover); }
.btn.danger { background: var(--surface); color: var(--danger); border-color: #f3cccc; box-shadow: none; }
.btn.danger:hover { background: var(--danger-50); }
.btn.dark { background: var(--ink); box-shadow: none; }
.btn.dark:hover { background: #000; }
.btn.sm { min-height: 40px; padding: 8px 14px; font-size: .875rem; border-radius: 10px; }
@media (pointer: coarse) { .btn.sm { min-height: 44px; } .btn { min-height: 48px; } }
.btn.lg { min-height: 54px; padding: 14px 26px; font-size: 1.08rem; border-radius: 14px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.btn.google { background: #fff; color: #1f1f1f; border-color: #dadce0; box-shadow: var(--shadow-sm); font-weight: 700; }
.btn.google:hover { background: #f8f9fa; color: #1f1f1f; }
.btn.google svg { width: 20px; height: 20px; }

/* --------------------------------------------------------------------------
   Tarjetas
   -------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.section-title { display: flex; align-items: center; gap: 10px; }
.icon-bubble { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); flex: none; }
.icon-bubble svg { width: 22px; height: 22px; }

/* --------------------------------------------------------------------------
   Formularios
   -------------------------------------------------------------------------- */
.field { margin-bottom: 16px; }
label, .label { display: block; font-weight: 800; font-size: .9rem; margin-bottom: 6px; color: var(--ink-2); }
.hint { font-size: .82rem; color: var(--muted); margin-top: 6px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=search], input[type=url], select, textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; font: inherit; font-size: 1rem; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 12px; background: #fffdfb; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #b0a69d; }
input:hover, select:hover, textarea:hover { border-color: #dcd1c4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(242, 107, 58, .14); background: #fff; }
input:disabled { background: var(--line-2); color: var(--muted); }
textarea { min-height: 100px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b625b' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.input-group { position: relative; }
.input-group input { padding-right: 52px; }
.input-group .toggle-pass { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: none; border-radius: 10px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.input-group .toggle-pass:hover { background: var(--line-2); }
.input-group .toggle-pass svg { width: 20px; height: 20px; }
.code-input { font-family: var(--mono); font-size: 1.35rem !important; letter-spacing: .12em; text-transform: uppercase; text-align: center; font-weight: 700; }

.check { display: flex; align-items: flex-start; gap: 12px; font-weight: 600; cursor: pointer; padding: 10px 0; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line-2); }
.switch-row:first-of-type { border-top: 0; }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #dcd3c9; border-radius: 99px; transition: background .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid rgba(242, 107, 58, .45); outline-offset: 2px; }
.switch.danger input:checked + span { background: var(--danger); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.strength { height: 6px; border-radius: 99px; background: var(--line-2); margin-top: 8px; overflow: hidden; }
.strength i { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .25s, background .25s; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 20px 0; font-weight: 700; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* --------------------------------------------------------------------------
   Mensajes
   -------------------------------------------------------------------------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin: 12px 0; font-weight: 600; font-size: .95rem; }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.alert.error { background: var(--danger-50); color: #a02929; }
.alert.ok { background: var(--mint-50); color: #14704f; }
.alert.warn { background: var(--warn-50); color: var(--warn-700); }
.alert.info { background: var(--brand-50); color: var(--brand-700); }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); z-index: 100;
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px);
  background: var(--ink); color: #fff; padding: 14px 18px; border-radius: 14px; font-weight: 700; box-shadow: var(--shadow-lg);
  transition: transform .3s cubic-bezier(.2, .9, .3, 1.2);
}
#toast.show { transform: translate(-50%, 0); }
#toast.error { background: var(--danger); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: .76rem; font-weight: 800; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--mint-50); color: #14704f; }
.badge.lost { background: var(--danger-50); color: var(--danger); }
.badge.sold { background: #eaf0fe; color: #3256b8; }
.badge.brand { background: var(--btn); color: #fff; }
.badge.brand::before { display: none; }

/* --------------------------------------------------------------------------
   Portada
   -------------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding: 56px 0 72px; }
.hero::before { content: ''; position: absolute; inset: -40% -10% auto auto; width: 680px; height: 680px; background: radial-gradient(circle, var(--brand-100), transparent 65%); z-index: -1; }
.hero .container { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); line-height: 1.05; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lead { font-size: 1.15rem; max-width: 34em; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-weight: 800; font-size: .82rem; color: var(--brand-700); margin-bottom: 18px; }
.trust { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 28px; color: var(--muted); font-weight: 700; font-size: .9rem; }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.trust svg { width: 18px; height: 18px; color: var(--mint); }
@media (max-width: 860px) { .hero .container { grid-template-columns: 1fr; } .hero { padding-top: 32px; } .phone { width: 240px; } .phone-screen .ph-photo { font-size: 4.5rem; } }

.phone { width: 300px; max-width: 100%; margin: 0 auto; background: var(--ink); border-radius: 44px; padding: 12px; box-shadow: var(--shadow-lg); transform: rotate(2deg); }
.phone-screen { background: var(--bg); border-radius: 34px; overflow: hidden; }
.phone-screen .ph-photo { aspect-ratio: 1; background: linear-gradient(135deg, #ffd8c2, #ffb48d); display: grid; place-items: center; font-size: 6rem; }
.phone-screen .ph-body { padding: 16px; }
.phone-screen .ph-alert { background: var(--danger); color: #fff; font-weight: 800; font-size: .8rem; text-align: center; padding: 8px; border-radius: 10px; margin-bottom: 10px; }
.phone-screen .ph-btn { height: 38px; border-radius: 10px; margin-top: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; color: #fff; }

.section { padding: 72px 0; }
.section.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { padding: 24px; border-radius: var(--radius-lg); background: var(--bg); border: 1px solid var(--line); }
.feature .icon-bubble { margin-bottom: 14px; }
.feature p { color: var(--muted); margin: 0; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr; } }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { position: relative; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.step::before { counter-increment: step; content: counter(step); width: 40px; height: 40px; border-radius: 50%; background: var(--btn); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; margin-bottom: 14px; }
.step p { color: var(--muted); margin: 0; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

.buy { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; background: linear-gradient(135deg, #b8431a 0%, #d9581f 100%); color: #fff; border-radius: 28px; padding: 40px; box-shadow: var(--shadow-lg); }
.buy h2 { color: #fff; font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
.buy ul { list-style: none; padding: 0; margin: 0 0 8px; }
.buy li { display: flex; gap: 10px; align-items: center; padding: 6px 0; font-weight: 700; }
.buy li svg { width: 20px; height: 20px; flex: none; }
.price-box { background: #fff; color: var(--ink); border-radius: 22px; padding: 28px; text-align: center; }
.price { font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; color: var(--ink); line-height: 1; margin: 8px 0 4px; }
@media (max-width: 760px) { .buy { grid-template-columns: 1fr; padding: 28px; } }

.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 4px 20px; margin-bottom: 10px; }
.faq summary { cursor: pointer; list-style: none; font-weight: 800; padding: 14px 0; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.4rem; line-height: 1; color: var(--brand); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); }

/* --------------------------------------------------------------------------
   Autenticación
   -------------------------------------------------------------------------- */
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 64px); }
.auth-side { background: linear-gradient(160deg, #b8431a 0%, #d9581f 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-side::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; background: url('/assets/logo.svg') no-repeat center / contain; opacity: .12; transform: rotate(-12deg); }
.auth-side h2 { color: #fff; font-size: 2rem; }
.auth-side ul { list-style: none; padding: 0; margin: 16px 0 0; }
.auth-side li { display: flex; gap: 10px; padding: 8px 0; font-weight: 700; }
.auth-side li svg { width: 22px; height: 22px; flex: none; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 2rem; }
.legal-note { font-size: .8rem; color: var(--muted); text-align: center; margin-top: 14px; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; min-height: 0; } .auth-side { display: none; } }

/* --------------------------------------------------------------------------
   Panel del dueño
   -------------------------------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { margin: 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; margin-bottom: 14px; color: var(--muted); }
.back-link:hover { color: var(--ink); }
.back-link svg { width: 18px; height: 18px; }

.pets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.pet-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.pet-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.pet-card .photo { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--brand-50), var(--brand-100)); display: grid; place-items: center; overflow: hidden; }
.pet-card .photo img { width: 100%; height: 100%; object-fit: cover; }
.pet-card .photo .ph { width: 64px; opacity: .5; }
.pet-card .photo .badge { position: absolute; top: 12px; left: 12px; box-shadow: var(--shadow-sm); }
.pet-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pet-card h3 { margin: 0; font-size: 1.25rem; }
.pet-card .actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.add-card { border: 2px dashed #e2d6c8; background: transparent; box-shadow: none; display: grid; place-items: center; text-align: center; min-height: 280px; text-decoration: none; color: var(--muted); font-weight: 800; }
.add-card:hover { border-color: var(--brand); color: var(--brand-700); background: var(--brand-50); }
.add-card .plus { width: 56px; height: 56px; border-radius: 50%; background: var(--btn); color: #fff; display: grid; place-items: center; margin: 0 auto 12px; font-size: 2rem; line-height: 1; }

.empty { text-align: center; padding: 48px 24px; }
.empty img { width: 96px; margin: 0 auto 16px; opacity: .9; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--line-2); border-radius: 14px; margin-bottom: 20px; overflow-x: auto; }
.tabs button { flex: 1; min-width: max-content; padding: 10px 16px; border: 0; border-radius: 10px; background: none; font: inherit; font-weight: 800; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected=true] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.layout-2 { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.layout-2 aside { position: sticky; top: 84px; }
@media (max-width: 900px) { .layout-2 { grid-template-columns: 1fr; } .layout-2 aside { position: static; } }

.photo-edit { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.photo-edit .thumb { width: 128px; height: 128px; border-radius: 20px; background: linear-gradient(135deg, var(--brand-50), var(--brand-100)); overflow: hidden; display: grid; place-items: center; flex: none; }
.photo-edit .thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-edit .thumb .ph { width: 52px; opacity: .5; }

.sighting { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line-2); }
.sighting:first-child { border-top: 0; padding-top: 0; }
.sighting .dot { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; flex: none; }
.sighting .dot svg { width: 20px; height: 20px; }

/* --------------------------------------------------------------------------
   Perfil público (lo que abre el QR)
   -------------------------------------------------------------------------- */
.profile { max-width: 520px; margin: 0 auto; padding: 20px 16px 64px; }
.profile-photo { position: relative; border-radius: 28px; overflow: hidden; aspect-ratio: 1; background: linear-gradient(135deg, var(--brand-50), var(--brand-100)); display: grid; place-items: center; box-shadow: var(--shadow-lg); }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo .ph { width: 120px; opacity: .5; }
.lost-banner { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--danger); color: #fff; text-align: center; padding: 14px; border-radius: 16px; font-weight: 800; font-size: 1.05rem; margin-bottom: 16px; animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(210, 60, 60, .15); } }
@media (prefers-reduced-motion: reduce) { .lost-banner { animation: none; } html { scroll-behavior: auto; } }
.profile h1 { font-size: 2.2rem; margin: 22px 0 6px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 16px; }
.chip { padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: .9rem; }
.chip b { color: var(--muted); font-weight: 700; margin-right: 4px; }
.medical { display: flex; gap: 12px; background: var(--warn-50); color: var(--warn-700); border-radius: 16px; padding: 14px 16px; margin: 16px 0; }
.medical svg { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.contact-actions { display: grid; gap: 10px; }

/* --------------------------------------------------------------------------
   Admin
   -------------------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat b { display: block; font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .85rem; font-weight: 700; }
.stat.accent { background: var(--ink); border-color: var(--ink); }
.stat.accent b, .stat.accent span { color: #fff; }
.toolbar { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 10px; margin-bottom: 14px; }
@media (max-width: 760px) { .toolbar { grid-template-columns: 1fr; } }
.bulkbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; background: var(--ink); color: #fff; margin-bottom: 12px; font-weight: 700; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--surface); }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { background: #fdfaf6; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; white-space: nowrap; }
tbody tr:hover { background: #fffbf7; }
td.actions { white-space: nowrap; text-align: right; }
td input[type=checkbox], th input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }
.code-pill { display: inline-block; padding: 3px 8px; border-radius: 8px; background: var(--brand-50); color: var(--brand-700); font-family: var(--mono); font-weight: 700; }

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.modal-bg { position: fixed; inset: 0; background: rgba(31, 26, 23, .5); display: grid; place-items: center; padding: 16px; z-index: 60; animation: fade .15s; }
.modal { background: var(--surface); border-radius: var(--radius-lg); padding: 26px; width: 100%; max-width: 460px; max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lg); animation: rise .2s cubic-bezier(.2, .9, .3, 1.1); }
.modal h2 { margin-bottom: 6px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
.qr-preview { width: 240px; margin: 8px auto; border-radius: 16px; border: 1px solid var(--line); padding: 8px; background: #fff; }

/* --------------------------------------------------------------------------
   Páginas legales
   -------------------------------------------------------------------------- */
.prose h2 { margin-top: 1.8em; font-size: 1.3rem; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }

/* Carga */
.skeleton { background: linear-gradient(90deg, var(--line-2), #fff, var(--line-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.secondary .spinner { border-color: var(--line); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
