/* Livre Brasil — shared styles */

:root {
  --bg: #0B0F1A;
  --bg-alt: #151D30;
  --bg-card: #131B2D;
  --primary: #4361EE;
  --primary-light: #6B8AFF;
  --primary-glow: rgba(67, 97, 238, 0.32);
  --text: #FAFBFF;
  --text-muted: rgba(255, 255, 255, 0.62);
  --text-dim: rgba(255, 255, 255, 0.45);
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --radius-sm: 14px;
  --radius: 24px;
  --radius-lg: 32px;
  --max: 1240px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--text);
}

h1 { font-size: clamp(2.4rem, 5.4vw, 4.4rem); }
h2 { font-size: clamp(2rem, 3.6vw, 3rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }
h4 { font-size: 1.05rem; font-weight: 700; }

p {
  color: var(--text-muted);
  text-wrap: pretty;
}

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

img, svg {
  display: block;
  max-width: 100%;
}

/* Defensive: any inline SVG that lacks width/height attributes
   stays small instead of falling back to the 300x150 UA default. */
svg:not([width]):not([height]) {
  width: 1em;
  height: 1em;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* === NAVBAR === */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(20, 28, 50, 0.88);
  border-bottom: 1px solid rgba(67, 97, 238, 0.18);
  box-shadow: 0 8px 32px -12px rgba(67, 97, 238, 0.28), 0 1px 0 rgba(255,255,255,.04) inset;
}
.nav::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -24px;
  height: 24px;
  background: linear-gradient(180deg, rgba(67,97,238,.10), transparent);
  pointer-events: none;
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 24px 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-right: 12px;
}
.nav-logo img {
  width: 160px;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 14px rgba(67, 97, 238, 0.55)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}
@media (max-width: 600px) {
  .nav-inner { padding: 14px 18px 14px 22px; }
  .nav-logo img { width: 150px; }
}
.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
  list-style: none;
}
.nav-links a {
  display: block;
  padding: 8px 16px;
  font-size: 0.94rem;
  color: var(--text-muted);
  border-radius: 999px;
  transition: color .2s, background .2s;
  font-weight: 500;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav-links a.active { color: var(--text); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  border-radius: 999px;
  font-size: 0.94rem;
  transition: transform .2s, box-shadow .2s, background .2s;
  box-shadow: 0 8px 24px -8px var(--primary-glow);
}
.nav-cta:hover {
  background: #5471FF;
  transform: translateY(-1px);
  box-shadow: 0 12px 32px -8px var(--primary-glow);
}
.nav-burger {
  display: none;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
}
/* Hard-hide on desktop so the mobile panel can never coexist with the
   desktop nav-links, even if .open is left over from a resize. */
.nav-mobile-panel { display: none !important; }

@media (max-width: 980px) {
  .nav-links, .nav > nav, .nav-inner > .nav-cta { display: none !important; }
  .nav-burger { display: flex; }
  .nav-mobile.open .nav-burger { background: rgba(67,97,238,.12); border-color: rgba(67,97,238,.4); }
  .nav-mobile-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(11,15,26,.96);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 24px;
  }
  .nav-mobile.open .nav-mobile-panel { display: block !important; }
  .nav-mobile-panel a {
    display: block;
    padding: 14px 0;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    font-weight: 500;
  }
  .nav-mobile-panel .nav-cta {
    display: inline-flex !important;
    margin-top: 16px;
  }
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 32px -10px var(--primary-glow);
}
.btn-primary:hover {
  background: #5471FF;
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -10px var(--primary-glow);
}
.btn-ghost {
  background: rgba(255,255,255,.04);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.2);
}

/* Store badges */
.store-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px 11px 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  transition: background .2s, border-color .2s, transform .2s;
}
.store-badge:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.22); transform: translateY(-2px); }
.store-badge svg { width: 24px; height: 24px; flex-shrink: 0; }
.store-badge .meta { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.store-badge .meta small { color: var(--text-dim); font-size: 0.7rem; letter-spacing: 0.04em; text-transform: uppercase; }
.store-badge .meta strong { color: var(--text); font-weight: 600; font-size: 0.95rem; }

/* === BADGES === */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: rgba(67, 97, 238, 0.1);
  border: 1px solid rgba(67, 97, 238, 0.28);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-light);
}
.eyebrow .dot {
  width: 7px; height: 7px;
  background: var(--primary-light);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(67,97,238,.18);
}

/* === SECTION === */
section {
  padding: 96px 0;
  position: relative;
}
section.alt {
  background: var(--bg-alt);
}
section + section::before,
section.alt::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: min(80%, 900px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(67,97,238,.4), transparent);
  pointer-events: none;
}
.sec-head {
  max-width: 720px;
  margin-bottom: 56px;
}
.sec-head .eyebrow {
  margin-bottom: 16px;
}
.sec-head p {
  margin-top: 16px;
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* === CARDS === */
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: border-color .2s, transform .2s, background .2s;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #4361EE, transparent);
  opacity: 0;
  transition: opacity .25s;
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
}
.card:hover::before { opacity: 1; }
.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(140deg, rgba(67,97,238,.18), rgba(67,97,238,.04));
  border: 1px solid rgba(67,97,238,.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-light);
  margin-bottom: 22px;
}
.card-num {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: var(--primary-light);
  margin-bottom: 14px;
  display: block;
}
.card h3 { margin-bottom: 10px; }
.card p { font-size: 0.96rem; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 980px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  section { padding: 72px 0; }
  .sec-head { margin-bottom: 40px; }
  .container { padding: 0 20px; }
  .btn { width: 100%; justify-content: center; }
  .store-row { flex-direction: column; align-items: stretch; }
  .store-badge { justify-content: flex-start; }
  h1 { font-size: clamp(2rem, 8vw, 2.8rem); }
  h2 { font-size: clamp(1.6rem, 6vw, 2.2rem); }
}

/* === FOOTER === */
footer {
  background: #060912;
  border-top: 1px solid var(--border);
  padding: 72px 0 32px;
  margin-top: 0;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 56px;
}
@media (max-width: 880px) {
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 40px 24px; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
  .foot-grid { grid-template-columns: 1fr; gap: 32px; }
}
.foot-brand img { width: 180px; height: auto; margin-bottom: 22px; display: block; filter: drop-shadow(0 0 14px rgba(67, 97, 238, 0.5)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4)); }
.foot-brand p { font-size: 0.95rem; max-width: 360px; margin-bottom: 22px; }
.foot-social { display: flex; gap: 10px; }
.foot-social a {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text-muted);
  transition: color .2s, background .2s, border-color .2s;
}
.foot-social a:hover { color: var(--text); background: rgba(67,97,238,.16); border-color: rgba(67,97,238,.5); }

.foot-col h5 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 18px;
}
.foot-col ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.foot-col a {
  color: var(--text-muted);
  font-size: 0.94rem;
  transition: color .2s;
}
.foot-col a:hover { color: var(--text); }

/* === LEGAL / PROSE === */
.legal-hero {
  padding: 80px 0 48px;
  position: relative;
  overflow: hidden;
}
.legal-hero::before {
  content: "";
  position: absolute;
  top: -180px; right: -180px;
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(67,97,238,.22), transparent 60%);
  pointer-events: none;
}
.legal-hero h1 { font-size: clamp(2rem, 4vw, 3rem); }
.legal-hero .meta {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.86rem;
  color: var(--text-muted);
}
.legal-body {
  padding-bottom: 96px;
}
.legal-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 880px) {
  .legal-grid { grid-template-columns: 1fr; gap: 32px; }
  .legal-toc { position: static !important; }
}
.legal-toc {
  position: sticky;
  top: 96px;
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.legal-toc h5 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.legal-toc ol {
  list-style: none;
  counter-reset: toc;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.legal-toc li { counter-increment: toc; }
.legal-toc a {
  display: block;
  padding: 6px 8px;
  font-size: 0.86rem;
  color: var(--text-muted);
  border-radius: 6px;
  transition: color .2s, background .2s;
}
.legal-toc a:hover { color: var(--text); background: rgba(67,97,238,.08); }
.legal-toc a::before {
  content: counter(toc, decimal-leading-zero) " ";
  color: var(--primary-light);
  font-weight: 700;
  margin-right: 4px;
  font-family: 'Outfit', sans-serif;
}
.legal-content section.clause {
  padding: 0;
  margin-bottom: 48px;
  background: none;
  border: none;
}
.legal-content section.clause::before { display: none; }
.legal-content h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  scroll-margin-top: 96px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.legal-content h2 .num {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--primary-light);
  letter-spacing: 0.06em;
}
.legal-content h3 { font-size: 1.05rem; margin: 24px 0 10px; color: var(--text); }
.legal-content p, .legal-content li { font-size: 0.98rem; line-height: 1.7; color: var(--text-muted); }
.legal-content p + p { margin-top: 14px; }
.legal-content ul, .legal-content ol { margin: 14px 0 14px 22px; display: flex; flex-direction: column; gap: 8px; }
.legal-content strong { color: var(--text); font-weight: 600; }

/* Termos hub */
.hub-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 32px;
}
@media (max-width: 720px) { .hub-card { grid-template-columns: 1fr; } }
.hub-card a {
  padding: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .2s, transform .2s, background .2s;
}
.hub-card a:hover { border-color: rgba(67,97,238,.5); transform: translateY(-4px); background: rgba(67,97,238,.06); }
.hub-card .ico {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(140deg, rgba(67,97,238,.22), rgba(67,97,238,.06));
  border: 1px solid rgba(67,97,238,.28);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary-light);
  margin-bottom: 8px;
}
.hub-card h3 { font-size: 1.3rem; margin: 0; }
.hub-card p { font-size: 0.94rem; }
.hub-card .arrow {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--primary-light);
  font-weight: 600;
  font-size: 0.92rem;
  margin-top: auto;
}

.foot-bottom {
  border-top: 1px solid var(--border);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-dim);
}
