:root {
  --ink: #171412;
  --muted: #716a61;
  --line: #ddd5ca;
  --paper: #f7f2ea;
  --panel: #fffaf2;
  --brand: #1f6f5f;
  --brand-dark: #0f3f38;
  --accent: #d9683c;
  --ok: #227c56;
  --warn: #a75f00;
  --bad: #9d2d2d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Manrope", sans-serif;
}

a { color: inherit; }

main { min-height: 100vh; }

h1, h2, h3, p { margin-top: 0; }

h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 4vw, 4.8rem);
  line-height: .95;
  letter-spacing: 0;
}

h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

input, select, textarea, button {
  font: inherit;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .85rem .9rem;
  background: #fffdf8;
  color: var(--ink);
}

textarea { resize: vertical; }

label {
  display: grid;
  gap: .45rem;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 800;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: .95rem;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: .75rem;
  text-transform: uppercase;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: .8rem 1.4rem;
  border-bottom: 1px solid rgba(23, 20, 18, .12);
  background: rgba(247, 242, 234, .9);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--brand-dark);
  color: #fffaf2;
  font-size: .72rem;
}

.topbar nav {
  display: flex;
  gap: .9rem;
  margin-left: auto;
}

.topbar nav a {
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.ghost-button, .primary-button, .primary-link {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
}

.ghost-button {
  padding: .65rem .9rem;
  background: transparent;
  color: var(--ink);
}

.primary-button, .primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .8rem 1.1rem;
  background: var(--brand-dark);
  color: #fffaf2;
}

.secondary-link {
  margin-top: .65rem;
  background: var(--accent);
}

.auth-page {
  background:
    linear-gradient(110deg, rgba(31, 111, 95, .18), transparent 42%),
    var(--paper);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.auth-panel {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 2rem;
  align-items: center;
  padding: clamp(1.2rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, .78);
  box-shadow: 0 24px 70px rgba(43, 31, 20, .14);
}

.eyebrow {
  color: var(--accent);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted, .hint {
  color: var(--muted);
  line-height: 1.55;
}

.hint { font-size: .8rem; }

.form-stack {
  display: grid;
  gap: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.template-item {
  display: grid;
  gap: .65rem;
}

.span-2 { grid-column: span 2; }

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  color: var(--ink);
  line-height: 1.45;
}

.checkbox-label input {
  width: auto;
  margin-top: .2rem;
}

.alert {
  padding: .85rem;
  border-radius: 8px;
  background: #ffe2d8;
  color: var(--bad);
  font-weight: 800;
}

.page {
  width: min(1240px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}

.metric-grid article, .panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric-grid article {
  padding: 1rem;
}

.metric-grid span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.metric-grid strong {
  display: block;
  margin-top: .45rem;
  font-size: 1.65rem;
}

.panel {
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.table-wrap {
  overflow-x: auto;
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: .28rem .55rem;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status.active { background: #dcefe5; color: var(--ok); }
.status.available { background: #f2e4cb; color: var(--warn); }
.status.expired, .status.blocked { background: #f4d5d5; color: var(--bad); }
.status.suspended { background: #f2e4cb; color: var(--warn); }
.status.deleted { background: #eadede; color: var(--bad); }
.status.pending { background: #f2e4cb; color: var(--warn); }
.status.paid { background: #dcefe5; color: var(--ok); }
.status.failed, .status.cancelled { background: #f4d5d5; color: var(--bad); }
.status.aguardando { background: #f2e4cb; color: var(--warn); }
.status.em_producao, .status.enviado { background: #dbe8ee; color: #24546b; }
.status.entregue { background: #dcefe5; color: var(--ok); }
.status.cancelado { background: #f4d5d5; color: var(--bad); }

.link-row {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  font-weight: 900;
}

.table-link {
  color: var(--brand-dark);
  font-weight: 900;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.action-row {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.tag-export-form {
  max-width: 560px;
}

.tag-guidance .activity-list article {
  background: #fffdf8;
}

.owner-actions {
  margin: 1rem 0;
}

.log-snippet {
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
  margin: .35rem 0 0;
  font-size: .72rem;
  line-height: 1.35;
}

.tag-preview {
  display: grid;
  place-items: center;
  min-height: 260px;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(31, 111, 95, .08), transparent),
    #fffdf8;
}

.tag-preview svg {
  width: min(100%, 520px);
  max-height: 300px;
  overflow: visible;
}

.tag-preview-base {
  fill: #f6dfb7;
  stroke: #6f4d2d;
  stroke-width: 2;
}

.tag-preview-hole {
  fill: #fffdf8;
  stroke: #6f4d2d;
  stroke-width: 2;
}

.tag-preview-frame {
  fill: #fffdf8;
  stroke: #1f6f5f;
  stroke-width: 2;
}

.tag-preview-window {
  fill: #fffaf0;
  stroke: #e1c58f;
  stroke-width: 2;
}

.tag-preview-qr rect:not(.tag-preview-frame) {
  fill: #133832;
}

.tag-preview text {
  fill: #133832;
  font-family: "Manrope", sans-serif;
  font-size: 18px;
  font-weight: 900;
}

.tag-preview-phone {
  font-size: 13px;
}

.small-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .45rem .65rem;
  background: #fffdf8;
  color: var(--ink);
  cursor: pointer;
  font-size: .76rem;
  font-weight: 900;
}

.small-button.warn { border-color: #d5a85e; color: var(--warn); }
.small-button.ok { border-color: #8cc5a7; color: var(--ok); }
.small-button.danger { border-color: #dba0a0; color: var(--bad); }

.confirm-dialog {
  width: min(520px, calc(100% - 2rem));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.2rem;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 90px rgba(23, 20, 18, .28);
}

.confirm-dialog::backdrop {
  background: rgba(23, 20, 18, .48);
  backdrop-filter: blur(4px);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: .7rem;
}

.danger-submit {
  background: var(--bad);
}

.activity-list {
  display: grid;
  gap: .65rem;
}

.activity-list article {
  display: grid;
  gap: .18rem;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.activity-list span {
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.45;
}

.finance-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.finance-summary article {
  display: grid;
  gap: .35rem;
  min-height: 82px;
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.finance-summary span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
}

.finance-summary strong {
  overflow-wrap: anywhere;
}

.inline-finance-form {
  margin-top: 1rem;
}

.inline-action-form {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
}

.inline-action-form input {
  width: 118px;
  min-height: 34px;
  padding: .45rem .55rem;
  font-size: .78rem;
}

.public-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 10%, rgba(217, 104, 60, .12), transparent 28rem),
    linear-gradient(135deg, #fbf4e7 0%, #eadfcd 44%, #f7f2ea 100%);
}

.pet-hero {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(320px, .86fr) minmax(420px, 1.14fr);
  gap: clamp(1rem, 3vw, 3rem);
  align-items: stretch;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(.75rem, 2vw, 1.6rem);
}

.pet-photo {
  position: relative;
  min-height: calc(100dvh - clamp(1.5rem, 4vw, 3.2rem));
  overflow: hidden;
  border-radius: 8px;
  background: #261d17;
  box-shadow: 0 28px 70px rgba(59, 42, 27, .22);
}

.pet-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(23, 20, 18, .02), rgba(23, 20, 18, .48));
  pointer-events: none;
}

.pet-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pet-photo-caption {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem .95rem;
  border: 1px solid rgba(255, 250, 242, .28);
  border-radius: 8px;
  background: rgba(23, 20, 18, .62);
  color: #fffaf2;
  backdrop-filter: blur(12px);
}

.pet-photo-caption span,
.pet-photo-caption strong {
  min-width: 0;
  font-size: .78rem;
  overflow-wrap: anywhere;
}

.pet-card {
  align-self: center;
  width: min(700px, 100%);
  margin: 2rem auto;
  padding: clamp(1.15rem, 3vw, 2.4rem);
  border: 1px solid rgba(23, 20, 18, .1);
  border-radius: 8px;
  background: rgba(255, 250, 242, .92);
  box-shadow: 0 24px 64px rgba(59, 42, 27, .14);
  backdrop-filter: blur(18px);
}

.public-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: 1rem;
  color: var(--brand-dark);
  font-size: .76rem;
  font-weight: 900;
}

.public-kicker span,
.public-kicker strong {
  overflow-wrap: anywhere;
}

.pet-details {
  color: var(--brand-dark);
  font-weight: 900;
  font-size: 1.05rem;
}

.location-status {
  margin: 1.1rem 0;
  padding: .95rem 1rem;
  border: 1px solid #a7cbb7;
  border-radius: 8px;
  background: #e4f2e9;
  color: var(--brand-dark);
  font-weight: 900;
  line-height: 1.35;
}

.public-assurance {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
  margin-bottom: 1rem;
}

.public-assurance span {
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: .75rem;
  border: 1px solid rgba(31, 111, 95, .18);
  border-radius: 8px;
  background: rgba(255, 253, 248, .7);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 800;
  line-height: 1.35;
}

.public-form-head {
  display: grid;
  gap: .35rem;
  margin-top: .4rem;
}

.public-form-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  text-transform: none;
}

.public-form-head p {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.45;
}

.privacy-note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.45;
}

.activation-shell {
  width: min(1080px, calc(100% - 2rem));
  min-height: 100vh;
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 2rem;
  align-items: start;
  margin: 0 auto;
  padding: 3rem 0;
}

.activation-copy {
  position: sticky;
  top: 2rem;
}

.activation-form {
  display: grid;
  gap: 1.2rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.thanks-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  text-align: center;
}

.thanks-shell > div {
  width: min(720px, 100%);
}

.legal-page {
  text-align: left;
}

.payment-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.payment-card {
  width: min(620px, 100%);
  display: grid;
  gap: 1.1rem;
  padding: clamp(1rem, 4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.pix-image {
  width: min(320px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.pix-placeholder {
  display: grid;
  place-items: center;
  width: min(320px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--brand-dark);
  font-weight: 900;
  font-size: 2rem;
}

.payment-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.payment-status-strip {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .85rem;
  border: 1px solid rgba(31, 111, 95, .18);
  border-radius: 8px;
  background: #e8f4ec;
  color: var(--brand-dark);
  font-weight: 800;
}

.store-shell {
  width: min(1120px, calc(100% - 2rem));
  min-height: 100vh;
  display: grid;
  align-content: start;
  gap: 1.2rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) 0;
}

.store-hero {
  width: min(760px, 100%);
}

.store-hero h1 {
  font-size: clamp(2.8rem, 8vw, 6.5rem);
}

.store-price {
  display: inline-flex;
  margin-top: 1rem;
  padding: .7rem .9rem;
  border-radius: 8px;
  background: var(--brand-dark);
  color: #fffaf2;
  font-weight: 900;
}

.store-panel {
  background: rgba(255, 250, 242, .86);
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
}

.store-grid article {
  display: grid;
  gap: .65rem;
  align-content: start;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.store-grid span {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
}

.home-shell {
  width: min(1180px, calc(100% - 2rem));
  min-height: 100vh;
  display: grid;
  gap: 1.4rem;
  align-content: center;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) 0;
}

.home-hero {
  width: min(820px, 100%);
}

.home-hero h1 {
  font-size: clamp(4rem, 14vw, 10rem);
}

.home-hero .muted {
  max-width: 680px;
  font-size: 1.08rem;
}

.home-proof,
.home-bands {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
}

.home-proof article,
.home-bands article {
  display: grid;
  gap: .35rem;
  padding: 1rem;
  border: 1px solid rgba(23, 20, 18, .12);
  border-radius: 8px;
  background: rgba(255, 250, 242, .78);
}

.home-proof span,
.home-bands span {
  color: var(--muted);
  line-height: 1.45;
}

.home-proof strong {
  color: var(--brand-dark);
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

@media (max-width: 980px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-proof, .home-bands { grid-template-columns: 1fr; }
  .store-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col, .auth-panel, .pet-hero, .activation-shell { grid-template-columns: 1fr; }
  .pet-hero { gap: 0; padding: 0; }
  .pet-photo { min-height: 46vh; border-radius: 0; }
  .pet-hero { min-height: auto; }
  .pet-card { margin: -1.5rem auto 1rem; position: relative; z-index: 2; }
  .activation-copy { position: static; }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .topbar nav {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .page-head {
    align-items: start;
    flex-direction: column;
  }

  .metric-grid, .form-grid {
    grid-template-columns: 1fr;
  }

  .finance-summary {
    grid-template-columns: 1fr;
  }

  .store-grid {
    grid-template-columns: 1fr;
  }

  .template-grid {
    grid-template-columns: 1fr;
  }

  .span-2 { grid-column: auto; }
  .auth-shell { padding: 1rem; }
  .pet-card { width: calc(100% - 1rem); padding: 1rem; }
  .public-assurance { grid-template-columns: 1fr; }
  .public-kicker { align-items: flex-start; flex-direction: column; }
  .pet-photo-caption { flex-direction: column; gap: .25rem; }
}
