:root {
  --paper: #faf3e7;
  --paper-2: #fffaf0;
  --card: #fffdf8;
  --ink: #4a2f23;
  --muted: #8a6f5c;
  --terra: #bc5837;
  --terra-dark: #9a4527;
  --coral: #ff5c38;
  --wood: #7c4a2d;
  --line: #e8d9c3;
  --cream: #fdf6ea;
  --danger: #b3261e;
  --ok: #4c7a3f;
  --radius: 16px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Nunito Sans", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: var(--paper);
  background-image:
    radial-gradient(600px 300px at 85% -50px, rgba(255, 92, 56, 0.08), transparent 70%),
    radial-gradient(500px 260px at -10% 0, rgba(188, 88, 55, 0.07), transparent 70%);
  color: var(--ink);
}

h1, h2, h3 { font-family: "Fraunces", Georgia, "Times New Roman", serif; }
h1 { font-size: 1.9rem; font-weight: 800; margin: 10px 0 6px; color: var(--terra-dark); }
h2 { font-size: 1.45rem; font-weight: 800; margin: 20px 0 10px; color: var(--terra-dark); }
h3 { font-size: 1.1rem; font-weight: 700; margin: 0 0 8px; color: var(--wood); }

.muted { color: var(--muted); }
.small-text { font-size: 0.85rem; }
.center { text-align: center; }
a { color: var(--terra); font-weight: 700; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 14px 110px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px;
  background: rgba(250, 243, 231, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; font-family: "Fraunces", Georgia, serif; font-size: 1.12rem; color: var(--terra-dark); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.mascote-mini { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: top; border: 2px solid var(--terra); }

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px 14px; }
.auth-card {
  background: var(--paper-2); border: 2px solid var(--line); border-radius: 22px;
  padding: 26px 24px; max-width: 440px; width: 100%;
  box-shadow: 0 14px 40px rgba(124, 74, 45, 0.18);
  text-align: center;
}
.auth-card .form { text-align: left; }
.mascote-grande { width: 190px; height: 190px; border-radius: 50%; object-fit: cover; object-position: top; border: 4px solid var(--terra); box-shadow: 0 8px 24px rgba(124, 74, 45, 0.25); }
.auth-tabs { display: flex; gap: 8px; justify-content: center; margin: 14px 0; flex-wrap: wrap; }
.auth-tabs.left { justify-content: flex-start; }

.hero { display: flex; gap: 16px; align-items: center; margin: 18px 0 6px; }
.hero h2 { margin-top: 0; }
.hero.dedicatoria { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--terra); border-radius: 20px; padding: 22px 24px; box-shadow: 0 10px 28px rgba(124, 74, 45, 0.12); align-items: flex-start; }
.hero.dedicatoria p { margin: 0 0 10px; line-height: 1.45; font-family: "Dancing Script", "Segoe Script", cursive; font-size: 1.45rem; font-weight: 600; }
.dedic-titulo { font-family: "Dancing Script", "Segoe Script", cursive; font-weight: 700; font-size: 1.9rem; color: var(--terra-dark); }
.dedic-assinatura { font-family: "Dancing Script", "Segoe Script", cursive; font-style: normal; font-weight: 700; font-size: 1.6rem; color: var(--wood); margin-bottom: 0 !important; }
@media (max-width: 560px) { .hero.dedicatoria { align-items: center; } .hero.dedicatoria p { text-align: center; } }
.mascote-hero { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; object-position: top; border: 3px solid var(--terra); flex-shrink: 0; box-shadow: 0 6px 18px rgba(124, 74, 45, 0.22); }
@media (max-width: 560px) { .hero { flex-direction: column; text-align: center; } }

.chip {
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 7px 16px; font-weight: 700; cursor: pointer; font-size: 0.95rem; font-family: inherit;
}
.chip.active { background: var(--terra); border-color: var(--terra); color: #fff; }

.card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-left: 5px solid var(--terra);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
  box-shadow: 0 6px 20px rgba(124, 74, 45, 0.10);
}

.btn {
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 10px; padding: 9px 16px; font-weight: 700; cursor: pointer; font-size: 0.95rem; font-family: inherit;
}
.btn.primary { background: var(--terra); border-color: var(--terra); color: #fff; }
.btn.primary:hover { background: var(--terra-dark); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn.small { padding: 5px 10px; font-size: 0.85rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn:active { transform: translateY(1px); }

.form label { display: block; margin: 12px 0; font-weight: 600; font-size: 0.95rem; }
.form input, .form textarea, .form select,
input[type="search"], select {
  width: 100%; margin-top: 5px;
  border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; background: #fff; color: var(--ink);
}
.form textarea { resize: vertical; line-height: 1.5; }
.form input:focus, .form textarea:focus, .form select:focus, input[type="search"]:focus {
  outline: 2px solid rgba(188, 88, 55, 0.4); border-color: var(--terra);
}
.form-error { color: var(--danger); font-weight: 700; }
.form-ok { color: var(--ok); font-weight: 700; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 14px 0; }
.recipe-card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; box-shadow: 0 6px 18px rgba(124, 74, 45, 0.10);
  display: flex; flex-direction: column; transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.recipe-card:hover { border-color: var(--terra); box-shadow: 0 14px 30px rgba(124, 74, 45, 0.18); transform: translateY(-2px); }
.recipe-card img.thumb { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.recipe-card .no-thumb { aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; font-size: 2.6rem; background: var(--cream); }
.recipe-card .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.recipe-card h3 { margin: 0; font-size: 1.05rem; }
.recipe-card .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }

.tag {
  display: inline-block; background: rgba(188, 88, 55, 0.10); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 10px; font-size: 0.8rem; font-weight: 700; color: var(--wood);
}
.tempo { font-size: 0.85rem; color: var(--muted); font-weight: 600; }

.star {
  background: none; border: none; font-size: 1.45rem; cursor: pointer; line-height: 1;
  color: #d8c3a5; padding: 2px 4px;
}
.star.on { color: #f2a007; }
.star.big { font-size: 1.9rem; }

.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.detail-head h2 { margin-top: 10px; }
.photos { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }
.photos img { width: 100%; border-radius: 12px; border: 1.5px solid var(--line); box-shadow: 0 6px 18px rgba(124, 74, 45, 0.12); }
.photos figcaption { font-size: 0.85rem; color: var(--muted); text-align: center; margin-top: 4px; }
figure { margin: 0; }

.ing-list { list-style: none; padding: 0; margin: 8px 0; }
.ing-list li { padding: 7px 2px; border-bottom: 1px dashed var(--line); }
.ing-list li:last-child { border-bottom: none; }
.subhead { font-family: "Fraunces", Georgia, serif; font-weight: 700; color: var(--terra-dark); margin: 16px 0 4px; font-size: 1.02rem; }

.step-list { padding-left: 22px; margin: 8px 0; }
.step-list li { padding: 7px 2px; line-height: 1.55; border-bottom: 1px dashed var(--line); }
.step-list li:last-child { border-bottom: none; }

.tempo-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.tempo-form label { flex: 1; min-width: 180px; font-weight: 600; font-size: 0.95rem; }
.tempo-form input { width: 100%; margin-top: 5px; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; background: #fff; color: var(--ink); }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; background: rgba(255, 250, 240, 0.97); border-top: 2px solid var(--line);
  backdrop-filter: blur(8px);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  flex: 1; background: none; border: none; padding: 8px 2px 10px;
  font-size: 0.72rem; font-weight: 700; color: var(--muted); cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tabbar button span { font-size: 1.15rem; }
.tabbar button.active { color: var(--terra); box-shadow: inset 0 3px 0 var(--terra); }

.empty { color: var(--muted); padding: 10px 0; }
::placeholder { color: #b89b7d; }

@media (min-width: 720px) {
  .tabbar { left: 50%; transform: translateX(-50%); max-width: 860px; border-left: 2px solid var(--line); border-right: 2px solid var(--line); border-radius: 16px 16px 0 0; }
}

/* Poses da Mamuska e do Colt nas receitas (versão 2) */
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.card-head h3 { margin: 0; }
.pose-avatar { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; object-position: center 15%; border: 2px solid var(--line); flex: none; background: #faf3e7; }
.bom-apetite { text-align: center; }
.bom-apetite p { margin: 4px 0 0; }
.pose-final { width: 100%; max-width: 320px; border-radius: 12px; margin: 0 auto 8px; display: block; }
.photos-final img { width: 100%; max-width: 360px; margin: 0 auto; display: block; }

/* Avatar próprio de cada receita e ingredientes marcáveis (versão 3) */
.recipe-avatar { width: 100%; max-width: 460px; height: auto; border-radius: 14px; border: 1.5px solid var(--line); margin: 10px auto 4px; display: block; background: #faf3e7; }
.check-list { list-style: none; padding-left: 0; }
.ing-item { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 7px 4px; border-radius: 8px; }
.ing-item input { width: 22px; height: 22px; flex: none; margin: 1px 0 0; accent-color: #b4552d; }
.ing-item.done span { text-decoration: line-through; opacity: 0.55; }
