:root {
  --bg: #f6f1ea;
  --paper: #fffdfb;
  --espresso: #3c2415;
  --coffee: #6f4e37;
  --coffee-dark: #56392a;
  --caramel: #b08968;
  --text-dim: #8a7866;
  --border: #e4d9c9;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--espresso);
  font-family: 'Inter', system-ui, sans-serif;
}

h1, h2, h3, .brand-name {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}

/* ---------- header ---------- */
.topbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 48px 20px 24px;
  text-align: center;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  width: 26px;
  height: 26px;
}
.brand-mark i {
  border-radius: 3px;
  background: var(--coffee);
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--espresso);
}
.brand-name em {
  font-style: normal;
  color: var(--coffee);
}

.tagline {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin: 0;
}

/* ---------- ad slots ---------- */
.ad-slot {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
}
.ad-slot--skyscraper { width: 160px; height: 600px; }
.ad-slot--footer { max-width: 468px; height: 60px; margin: 0 auto 20px; }

/* ---------- layout ---------- */
.layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
}

.page {
  max-width: 1000px;
  width: 100%;
  min-width: 0;
}

.ad-rail {
  flex: 0 0 160px;
  position: sticky;
  top: 24px;
}

@media (max-width: 1300px) {
  .ad-rail { display: none; }
}

.hero {
  padding: 20px 20px 10px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
}

.panel {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.panel h1 { margin: 0 0 6px; font-size: 1.4rem; }
.panel-sub { color: var(--text-dim); margin: 0 0 22px; font-size: 0.9rem; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field span { font-size: 0.82rem; color: var(--text-dim); }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }

input[type="text"], select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--espresso);
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
input[type="text"]:focus, select:focus {
  border-color: var(--coffee);
}
input[type="file"] {
  color: var(--text-dim);
  font-size: 0.82rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
}
input[type="file"]::file-selector-button {
  border: none;
  background: var(--coffee);
  color: #fff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 6px;
  margin-right: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}
input[type="file"]::file-selector-button:hover {
  background: var(--coffee-dark);
}

/* ---------- range (opções da logo) ---------- */
.field-range {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.25s ease, opacity 0.2s ease;
  margin-bottom: 16px;
}
.field-range.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}
.field-range-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.field-range span { font-size: 0.8rem; color: var(--text-dim); }
.field-range b { color: var(--coffee); font-weight: 600; }
.field-range input[type="range"] {
  accent-color: var(--coffee);
  width: 100%;
}

.btn-primary, .btn-secondary, .btn-ghost {
  border: none;
  border-radius: 8px;
  padding: 13px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.1s ease, opacity 0.15s;
}
.btn-primary {
  width: 100%;
  color: #fff;
  background: var(--coffee);
}
.btn-primary:hover { background: var(--coffee-dark); }
.btn-primary:active { transform: scale(0.98); }

.preview-actions { display: flex; gap: 12px; margin-top: 18px; }
.btn-secondary {
  flex: 1;
  background: var(--bg);
  color: var(--espresso);
  border: 1px solid var(--border);
}
.btn-secondary:not(:disabled):hover { border-color: var(--coffee); }
.btn-ghost {
  flex: 1;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-ghost:not(:disabled):hover { color: var(--coffee); border-color: var(--coffee); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button:active:not(:disabled) { transform: scale(0.98); }

/* ---------- preview ---------- */
.panel-preview { display: flex; flex-direction: column; align-items: center; justify-content: center; }

.preview-card {
  position: relative;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1 / 1;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-render {
  width: 86%;
  height: 86%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-render canvas, .qr-render img, .qr-render svg {
  max-width: 100%;
  max-height: 100%;
}
.qr-render.qr-pop {
  animation: qr-pop 0.3s ease;
}
@keyframes qr-pop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.logo-live-preview {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s ease;
}
.logo-live-preview.is-active { opacity: 1; }
.logo-live-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-hint {
  position: absolute;
  bottom: -30px;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
  width: 100%;
}

/* ---------- features ---------- */
.features {
  margin: 56px 0 20px;
  padding: 0 20px;
}
.features-title {
  text-align: center;
  font-size: 1.15rem;
  margin: 0 0 18px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
@media (max-width: 780px) {
  .features-grid { grid-template-columns: 1fr; }
}
.feature-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
}
.feature-icon { font-size: 1.6rem; margin-bottom: 10px; }
.feature-card h3 { margin: 0 0 8px; font-size: 1rem; }
.feature-card p { margin: 0; color: var(--text-dim); font-size: 0.86rem; line-height: 1.5; }

/* ---------- footer ---------- */
.site-footer {
  text-align: center;
  padding: 40px 20px 50px;
  color: var(--text-dim);
  font-size: 0.82rem;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 12px);
  background: var(--espresso);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- nav ---------- */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 4px;
  margin-top: 10px;
}
.site-nav a {
  color: var(--coffee);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.site-nav a:hover,
.site-nav a[aria-current] { background: var(--coffee); color: #fff; }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin-bottom: 12px;
}
.footer-nav a { color: var(--coffee); text-decoration: none; font-weight: 500; }
.footer-nav a:hover { text-decoration: underline; }

/* ---------- content sections (home) ---------- */
.content-section {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 8px;
}
.content-section h2 {
  font-size: 1.35rem;
  margin: 0 0 14px;
  color: var(--espresso);
}
.content-section p { color: var(--text-dim); line-height: 1.65; margin: 0 0 14px; }
.content-section p strong { color: var(--coffee-dark); }

.steps {
  margin: 0;
  padding-left: 22px;
  color: var(--text-dim);
  line-height: 1.65;
}
.steps li { margin-bottom: 12px; }
.steps strong { color: var(--coffee-dark); }

.content-section details {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 10px;
  background: var(--paper);
}
.content-section details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--espresso);
  list-style: none;
}
.content-section details summary::-webkit-details-marker { display: none; }
.content-section details summary::after { content: " +"; color: var(--caramel); }
.content-section details[open] summary::after { content: " –"; }
.content-section details p { margin: 10px 0 2px; }

/* ---------- doc pages (privacidade / sobre) ---------- */
.page--doc { min-height: 100vh; }
.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 22px 60px;
}
.doc h1 { font-size: 1.9rem; margin: 0 0 6px; }
.doc h2 { font-size: 1.2rem; margin: 28px 0 10px; color: var(--espresso); }
.doc p, .doc li { color: var(--text-dim); line-height: 1.7; }
.doc ul { padding-left: 20px; }
.doc li { margin-bottom: 8px; }
.doc a { color: var(--coffee); }
.doc code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 0.85em; }
.doc-updated { font-size: 0.82rem; color: var(--caramel); margin-top: 0; }
