:root {
  --blue: #0086ff;
  --blue-dark: #0068c9;
  --blue-soft: #e8f4ff;
  --ink: #202124;
  --muted: #5f6368;
  --line: #e6e8eb;
  --bg: #ffffff;
  --bg-soft: #f4f6f8;
  --card: #ffffff;
  --danger: #c62828;
  --ok: #137333;
  --shadow: 0 8px 24px rgba(32, 33, 36, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.5;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 104, 201, 0.25);
}

.header-inner,
.container {
  width: min(1100px, calc(100% - 1.5rem));
  margin: 0 auto;
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.logo {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  flex-shrink: 0;
  gap: 0.35rem;
  text-decoration: none;
  color: #fff;
}

.logo-maga {
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: -0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-dora {
  font-weight: 700;
  font-size: 1.15rem;
  background: #fff;
  color: var(--blue);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #fff;
}

.page {
  min-height: calc(100vh - 160px);
}

.hero {
  background: linear-gradient(180deg, var(--blue-soft), var(--bg));
  padding: 1.6rem 0 1.2rem;
}

.hero h1 {
  font-size: clamp(1.6rem, 5vw, 2.3rem);
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--muted);
  max-width: 46rem;
  font-size: 1.05rem;
  line-height: 1.55;
}

.steps {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
}

.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

.step-num {
  flex: 0 0 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.step strong {
  display: block;
  margin-bottom: 0.1rem;
}

.step span {
  color: var(--muted);
  font-size: 0.98rem;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin: 1.4rem 0 0.9rem;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.tab {
  min-height: 54px;
  border: 2px solid var(--blue);
  border-radius: 12px;
  background: #fff;
  color: var(--blue-dark);
  font-weight: 800;
  cursor: pointer;
  padding: 0.7rem 0.6rem;
}

.tab.is-active {
  background: var(--blue);
  color: #fff;
}

.choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.choice label {
  margin: 0;
  border: 2px solid var(--line);
  border-radius: 12px;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-weight: 800;
  padding: 0.6rem;
}

.choice input {
  width: auto;
  margin: 0;
}

.choice label:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.section-title h2 {
  font-size: 1.25rem;
}

.section-title p {
  color: var(--muted);
  font-size: 0.95rem;
}

.mosaic {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  padding-bottom: 2rem;
}

.product-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.product-card:focus-visible,
.btn:focus-visible,
.back-link:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.product-photo,
.detail-photo {
  background: var(--bg-soft);
  aspect-ratio: 1;
  object-fit: cover;
  width: 100%;
}

.product-body {
  padding: 0.8rem 0.8rem 1rem;
}

.product-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  min-height: 2.6em;
}

.price {
  color: var(--blue-dark);
  font-weight: 800;
  font-size: 1.15rem;
}

.price-lg {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  background: var(--bg-soft);
  border-radius: 16px;
  padding: 2.2rem 1rem;
  color: var(--muted);
}

.product-page {
  padding: 1rem 0 2.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--blue-dark);
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.detail {
  display: grid;
  gap: 1.2rem;
}

.detail-photo {
  border-radius: 18px;
  border: 1px solid var(--line);
}

.explain {
  background: var(--blue-soft);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin: 1rem 0;
  color: var(--ink);
}

.buy-actions {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.btn {
  border: 0;
  border-radius: 12px;
  min-height: 54px;
  padding: 0.8rem 1rem;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-primary:hover {
  background: var(--blue-dark);
}

.btn-secondary {
  background: #fff;
  color: var(--blue-dark);
  border: 2px solid var(--blue);
}

.btn-ghost {
  background: var(--bg-soft);
  color: var(--ink);
}

.btn-danger {
  background: #fff;
  color: var(--danger);
  border: 2px solid #f5c2c0;
}

.btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.gift-box,
.admin-card,
.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  margin-top: 1rem;
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

input,
textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
  margin-bottom: 0.9rem;
  background: #fff;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 28, 0.55);
  display: grid;
  place-items: center;
  padding: 0.75rem;
  z-index: 50;
}

.modal-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 1.2rem;
  max-height: calc(100dvh - 1.5rem);
  overflow: auto;
}

.modal-card.pix-sheet {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.85rem 0.95rem 1rem;
  overflow: hidden;
}

.pix-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.pix-head h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.pix-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.pix-total-label {
  margin: 0.15rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.pix-total {
  margin: 0;
  text-align: center;
  color: var(--blue-dark);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.pix-payee {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.pix-payee strong {
  color: var(--ink);
}

.qr {
  width: min(200px, 48vw);
  margin: 0.15rem auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.pix-or {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.pix-copy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  align-items: center;
}

.pix-code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 0.62rem 0.7rem;
  color: var(--ink);
}

.pix-copy-btn {
  width: auto;
  min-height: 42px;
  padding: 0.4rem 0.9rem;
}

.pix-sheet .btn-primary {
  min-height: 48px;
}

.pix-status {
  margin: 0.1rem 0 0;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 700;
  color: #8a5a00;
}

.pix-status.is-ok {
  color: var(--ok);
}

.pix-status.is-error {
  color: var(--danger);
}

.pix-expire {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.pix-note {
  background: #fff7e6;
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  margin: 0.2rem 0 0.35rem;
  font-size: 0.92rem;
}

.thanks-popup {
  text-align: center;
}

.thanks-popup h2 {
  margin: 0 0 0.85rem;
  font-size: 1.55rem;
}

.thanks-photo {
  width: min(220px, 56vw);
  height: auto;
  object-fit: contain;
  border-radius: 0;
  margin: 0.2rem auto 0.7rem;
  display: block;
  background: transparent;
}

.thanks-note {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 0 0 1rem;
}

.site-footer {
  background: #0f1720;
  color: #d7dde4;
  padding: 1.4rem 0 1.6rem;
  margin-top: auto;
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.7;
}

.site-footer a {
  color: #fff;
  font-weight: 700;
}

.dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0 0 1.2rem;
}

.dash-card {
  background: var(--blue-soft);
  border: 1px solid #cfe6ff;
  border-radius: 16px;
  padding: 1rem 0.9rem;
  text-align: center;
}

.dash-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
}

.dash-card strong {
  display: block;
  font-size: 2rem;
  color: var(--blue-dark);
  line-height: 1.1;
}

.dash-card .dash-money {
  margin-top: 0.75rem;
  font-size: 1.35rem;
}

.dash-card span {
  color: var(--muted);
  font-weight: 600;
}

.card-list {
  display: grid;
  gap: 0.8rem;
}

.letter-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  background: #fff;
}

.letter-card p {
  white-space: pre-wrap;
  margin: 0.5rem 0 0;
}

.letter-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  margin-left: 0.35rem;
}

.badge-ok {
  background: #e6f4ea;
  color: var(--ok);
}

.badge-wait {
  background: #fff7e6;
  color: #8a5a00;
}

.admin-list {
  display: grid;
  gap: 0.8rem;
  margin: 1rem 0 2rem;
}

.admin-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.8rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.7rem;
}

.admin-item img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--bg-soft);
}

.admin-item-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.error {
  color: var(--danger);
  font-weight: 600;
  margin: 0.4rem 0 0.8rem;
}

.photo-preview {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 0.8rem;
  background: var(--bg-soft);
}

@media (max-width: 480px) {
  .header-inner,
  .container {
    width: min(1100px, calc(100% - 1rem));
  }

  .header-inner {
    gap: 0.5rem;
  }

  .header-icon {
    width: 36px;
    height: 36px;
  }

  .modal {
    padding: 0.5rem;
    place-items: center;
  }

  .modal-card,
  .modal-card.pix-sheet {
    width: 100%;
    min-height: 0;
    max-height: calc(100dvh - 1rem);
    border-radius: 18px;
    padding: 0.75rem 0.85rem calc(0.85rem + env(safe-area-inset-bottom));
  }

  .modal-card.pix-sheet {
    justify-content: flex-start;
    gap: 0.36rem;
  }

  .pix-head h2 {
    font-size: 1.08rem;
  }

  .pix-total {
    font-size: 1.65rem;
  }

  .qr {
    width: min(168px, 46vw);
  }

  .pix-sheet .btn-primary {
    min-height: 46px;
  }

  .thanks-photo {
    width: min(150px, 38vw);
    margin-bottom: 0.55rem;
  }

  .thanks-popup h2 {
    font-size: 1.3rem;
  }
}

@media (min-width: 720px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .mosaic {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .detail {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .login-card {
    width: min(420px, 100%);
    margin: 2rem auto;
  }
}
