:root {
  --bg: #f2f2f4;
  --bg-base: #fcf8fa;
  --bg-pattern: url("/static/img/bg-sweet-lifestyle.png");
  --bg-card: #ffffff;
  --ink: #0a0a0a;
  --ink-soft: #5a5a62;
  --accent: #c4a4b8;
  --accent-deep: #9d7f94;
  --accent-lavender: #e8dce6;
  --line: rgba(10, 10, 10, 0.1);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  --radius: 18px;
  --nav-h: 64px;
  --top-h: 52px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-base);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* Padrão lifestyle (sutil) — não aplica no editor */
body.site-surface {
  position: relative;
  min-height: 100dvh;
}

body.site-surface::before,
body.site-surface::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body.site-surface::before {
  background: var(--bg-pattern) repeat top center;
  background-size: min(300px, 78vw) auto;
  opacity: 0.92;
}

body.site-surface::after {
  /* Véu leve — deixa o padrão aparecer atrás da página */
  background:
    radial-gradient(ellipse 120% 55% at 50% 0%, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 62%),
    linear-gradient(180deg, rgba(255, 252, 254, 0.28) 0%, rgba(252, 246, 250, 0.22) 50%, rgba(255, 255, 255, 0.3) 100%);
}

body.editor-page::before,
body.editor-page::after,
body.viewer-page::before,
body.viewer-page::after {
  display: none;
}

body.editor-page,
body.viewer-page {
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
}

@media (min-width: 900px) {
  .app-shell {
    max-width: 1100px;
    padding: 0 20px;
    border-radius: 0 0 28px 28px;
    background: rgba(255, 255, 255, 0.45);
  }

  .top-bar {
    max-width: 1100px;
  }

  body.site-surface::before {
    background-size: 320px auto;
    opacity: 0.95;
  }

  .main-content {
    padding-left: 24px;
    padding-right: 24px;
  }

  .hero h1 {
    font-size: 2.6rem;
  }

  .planner-scroll {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow: visible;
  }

  .planner-card {
    flex: none;
    min-height: 180px;
  }

  .shop-row {
    grid-template-columns: 120px 1fr;
  }

  .library-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .bottom-nav {
    max-width: 420px;
    border-radius: 20px 20px 0 0;
    margin-bottom: 8px;
  }
}

.top-bar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 50;
  padding-top: var(--safe-top);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--top-h);
  padding: 0 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
}

.brand-mark {
  color: var(--accent);
}

.main-content {
  flex: 1;
  padding: 16px;
}

body.has-top-bar .main-content {
  padding-top: calc(var(--top-h) + var(--safe-top) + 16px);
}

body.has-bottom-nav .main-content {
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
}

.main-content--full {
  padding-bottom: calc(var(--safe-bottom) + 8px);
}

body.has-bottom-nav .main-content--full {
  padding-bottom: calc(var(--safe-bottom) + 8px);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 480px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: var(--nav-h);
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.06);
  z-index: 50;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.68rem;
  color: var(--ink-soft);
  padding: 8px 4px;
}

.bottom-nav-item.is-active {
  color: var(--ink);
  font-weight: 600;
}

.bottom-nav-item.is-active .bottom-nav-icon {
  color: var(--accent-deep);
}

.bottom-nav-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.hero {
  padding: 8px 4px 20px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  color: var(--accent-deep);
  margin: 0 0 8px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  line-height: 1.15;
  margin: 0 0 12px;
  font-weight: 600;
  text-shadow: 0 1px 18px rgba(255, 255, 255, 0.95);
}

.hero-lead {
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0 0 20px;
  text-shadow: 0 1px 14px rgba(255, 255, 255, 0.9);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 0.92rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #141414, #2a2a2a);
  color: #fff;
  box-shadow: var(--shadow);
  border: 1px solid rgba(196, 164, 184, 0.35);
}

.btn-primary:active {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
}

.btn-ghost {
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-small {
  padding: 8px 14px;
  font-size: 0.82rem;
}

.btn-block {
  width: 100%;
}

.section {
  margin-bottom: 28px;
}

.section--tight {
  margin-bottom: 12px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-head h2,
.page-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin: 0;
}

.page-sub {
  color: var(--ink-soft);
  margin: 6px 0 0;
  line-height: 1.45;
}

.link-soft {
  font-size: 0.85rem;
  color: var(--accent-deep);
}

.planner-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
}

.planner-card {
  flex: 0 0 72%;
  scroll-snap-align: start;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.9);
  position: relative;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.planner-card--rose {
  background: linear-gradient(145deg, #ffffff, #ebe3e9);
}

.planner-card--sage {
  background: linear-gradient(145deg, #ffffff, #e4e4e6);
}

.planner-card--lavender {
  background: linear-gradient(145deg, #ffffff, #e8dce6);
}

.planner-card--sand {
  background: linear-gradient(145deg, #ffffff, #f0f0f2);
}

.planner-card h3 {
  font-family: var(--font-serif);
  margin: 0 0 4px;
  font-size: 1.35rem;
}

.planner-card p {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.planner-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.75);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
}

.planner-price {
  font-weight: 600;
  color: var(--accent-deep);
}

.update-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.85);
}

.update-list li a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.update-list li:last-child a {
  border-bottom: none;
}

.update-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.update-list small {
  display: block;
  color: var(--ink-soft);
  margin-top: 2px;
}

.features-grid {
  display: grid;
  gap: 10px;
}

.feature-tile {
  background: rgba(255, 255, 255, 0.94);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

.feature-tile h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.feature-tile p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.45;
}

.shop-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.shop-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.88);
}

.shop-cover-link {
  display: block;
  border-radius: 12px;
  overflow: hidden;
}

.shop-cover {
  border-radius: 12px;
  min-height: 140px;
  max-height: 200px;
  overflow: hidden;
  background: #ececee;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.planner-cover-img {
  width: 100%;
  height: 100%;
  min-height: 140px;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.planner-cover-fallback {
  width: 100%;
  min-height: 140px;
}

.planner-cover-fallback--rose { background: linear-gradient(160deg, #ddd0d8, #f5f5f7); }
.planner-cover-fallback--sage { background: linear-gradient(160deg, #d8d8dc, #ffffff); }
.planner-cover-fallback--lavender { background: linear-gradient(160deg, #d4c4d0, #f8f4f7); }
.planner-cover-fallback--sand { background: linear-gradient(160deg, #ececee, #faf9f6); }

.planner-card-cover {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.planner-card-cover .planner-cover-img {
  min-height: 100%;
  object-fit: cover;
}

.detail-cover-wrap {
  max-width: 220px;
  margin: 0 auto 16px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.detail-cover-wrap .planner-cover-img {
  min-height: auto;
  aspect-ratio: 210 / 297;
}

.library-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.88);
  text-decoration: none;
  color: inherit;
}

.library-cover {
  border-radius: 8px;
  overflow: hidden;
  background: #eee;
  aspect-ratio: 210 / 297;
}

.library-cover .planner-cover-img {
  min-height: 0;
  height: 100%;
}

.library-body h3 {
  font-family: var(--font-serif);
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.shop-body h2 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin: 6px 0 4px;
}

.shop-body p {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.shop-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.shop-meta {
  display: flex;
  gap: 6px;
}

.tag {
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.06);
  color: var(--ink-soft);
}

.tag-new {
  background: var(--accent-lavender);
  color: var(--ink);
}

.library-grid {
  display: grid;
  gap: 12px;
}

.library-cta {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--accent-deep);
  font-weight: 600;
}

.detail-hero {
  border-radius: var(--radius);
  padding: 28px 20px;
  margin-bottom: 16px;
  position: relative;
  box-shadow: var(--shadow);
}

.detail-hero--rose { background: linear-gradient(155deg, #f0e8ed, #ffffff); }
.detail-hero--sage { background: linear-gradient(155deg, #ececee, #ffffff); }
.detail-hero--lavender { background: linear-gradient(155deg, #ebe0e8, #ffffff); }
.detail-hero--sand { background: linear-gradient(155deg, #f2f2f4, #ffffff); }

.detail-hero h1 {
  font-family: var(--font-serif);
  margin: 12px 0 6px;
  font-size: 2rem;
}

.detail-sub {
  margin: 0;
  color: var(--ink-soft);
}

.detail-price {
  font-weight: 700;
  color: var(--accent-deep);
  margin: 12px 0 0;
}

.detail-desc {
  line-height: 1.55;
  color: var(--ink-soft);
}

.detail-specs {
  padding-left: 18px;
  line-height: 1.7;
}

.detail-actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.profile-card {
  text-align: center;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius);
  padding: 28px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.88);
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 1.75rem;
  background: linear-gradient(135deg, #1a1a1a, var(--accent-deep));
  color: #fff;
  border: 2px solid var(--accent-lavender);
}

.profile-stat {
  color: var(--ink-soft);
}

.profile-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.88);
}

.profile-menu a {
  display: block;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.auth-box {
  max-width: 360px;
  margin: 24px auto;
  background: rgba(255, 255, 255, 0.97);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

.auth-box h1 {
  font-family: var(--font-serif);
  margin-top: 0;
}

.form-stack label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.form-stack input {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font: inherit;
  background: #fff;
}

.auth-hint {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.auth-switch {
  text-align: center;
  font-size: 0.88rem;
}

.flash-stack {
  margin-bottom: 12px;
}

.flash {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.flash--success { background: #e5f5ea; }
.flash--danger { background: #fde8ea; }
.flash--warning { background: #fff4df; }
.flash--info { background: #e8f0ff; }

.empty-state {
  text-align: center;
  padding: 40px 16px;
}

.section-mini {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin: 0 0 10px;
}

.purchase-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.purchase-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.purchase-item small {
  display: block;
  color: var(--ink-soft);
  margin-top: 4px;
}

.purchase-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.icon-btn {
  border: none;
  background: var(--bg-card);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

@media (min-width: 520px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.btn-install-top {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--bg-card);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.pwa-install-root {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 8px);
  width: calc(100% - 24px);
  max-width: 440px;
  z-index: 45;
}

.main-content--full + .pwa-install-root,
body.editor-page .pwa-install-root {
  bottom: calc(var(--safe-bottom) + 12px);
}

body.pwa-standalone .pwa-install-root,
body.pwa-standalone .btn-install-top {
  display: none !important;
}

.pwa-install-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.pwa-install-title {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.pwa-install-text {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.pwa-install-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pwa-progress {
  height: 8px;
  background: #e8e8ea;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}

.pwa-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  transition: width 0.25s ease;
}

@media print {
  body.site-surface::before,
  body.site-surface::after {
    display: none !important;
  }

  .app-shell {
    background: #fff;
    box-shadow: none;
  }

  .top-bar,
  .bottom-nav,
  .no-print,
  .pwa-install-root {
    display: none !important;
  }
}
