/*
  Cicatrix Pro V26 — páginas legais, aviso de cookies e aceites.
  Usado por index.html, privacidade.html e termos.html.
*/

/* ================= Páginas legais ================= */

.legal-body { background: var(--brand-ivory); }

.legal-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(95, 70, 58, .1);
  background: rgba(251, 248, 243, .96);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.legal-header .container {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
}

.legal-brand img { display: block; width: 200px; height: 56px; object-fit: contain; object-position: left center; }

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--brand-copper-dark);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
}

.legal-back:hover { text-decoration: underline; }

.legal-page { padding: clamp(48px, 6vw, 88px) 0 clamp(72px, 8vw, 120px); }

.legal-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}

/* Índice lateral */
.legal-toc {
  position: sticky;
  top: 110px;
  padding-top: 8px;
}

.legal-toc p {
  margin: 0 0 12px;
  color: var(--brand-muted);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.legal-toc ol { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; counter-reset: toc; }

.legal-toc a {
  display: block;
  padding: 6px 0 6px 14px;
  border-left: 1px solid var(--brand-line);
  color: var(--brand-taupe);
  font-size: .9rem;
  line-height: 1.4;
  text-decoration: none;
  transition: color .3s ease, border-color .3s ease;
}

.legal-toc a:hover,
.legal-toc a[aria-current="true"] { border-color: var(--brand-copper); color: var(--brand-copper-dark); }

/* Texto */
.legal-article { max-width: 72ch; }

.legal-kicker {
  color: var(--brand-copper-dark);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.legal-article h1 {
  margin: 14px 0 12px;
  color: var(--brand-ink);
  font-family: var(--font-text);
  font-size: clamp(2.1rem, 3.9vw, 3.1rem);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.08;
}

.legal-updated { margin: 0 0 28px; color: var(--brand-muted); font-size: .92rem; }

.legal-lead { color: var(--brand-ink); font-size: 1.12rem; line-height: 1.75; }

.legal-article section { padding-top: 12px; scroll-margin-top: 100px; }

.legal-article h2 {
  margin: 48px 0 14px;
  color: var(--brand-ink);
  font-family: var(--font-text);
  font-size: clamp(1.3rem, 1.95vw, 1.62rem);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.25;
}

/* Número da seção no mesmo estilo do título: "01. Aceite". */
.legal-num {
  margin-right: .3em;
  font-variant-numeric: lining-nums tabular-nums;
}

.legal-article h3 {
  margin: 26px 0 8px;
  color: var(--brand-ink);
  font-size: 1.05rem;
  font-weight: 650;
}

.legal-article p,
.legal-article li {
  color: #4b423e;
  font-size: 1.02rem;
  line-height: 1.75;
}

.legal-article p { margin: 0 0 14px; }
.legal-article ul { display: grid; gap: 6px; margin: 0 0 16px; padding-left: 1.2rem; }
.legal-article li::marker { color: var(--brand-copper); }
.legal-article a { color: var(--brand-copper-dark); text-underline-offset: .2em; }

.legal-table-wrap { margin: 8px 0 20px; overflow-x: auto; border: 1px solid var(--brand-line); border-radius: 12px; background: #fff; }

.legal-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: .95rem; }
.legal-table th,
.legal-table td { padding: 12px 16px; border-bottom: 1px solid #efe5de; color: #4b423e; line-height: 1.55; text-align: left; vertical-align: top; }
.legal-table th { color: var(--brand-ink); background: #fbf6f2; font-weight: 650; }
.legal-table tr:last-child td { border-bottom: 0; }

/* Campo que a clínica precisa preencher antes de publicar. */
.legal-fill {
  padding: 1px 6px;
  border-radius: 4px;
  color: #6b4a12;
  background: #fbe7b8;
  font-weight: 600;
}

.legal-inline-button {
  padding: 0;
  border: 0;
  color: var(--brand-copper-dark);
  background: none;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
}

@media (max-width: 900px) {
  .legal-layout { grid-template-columns: 1fr; }
  .legal-toc { position: static; padding: 18px 20px; border: 1px solid var(--brand-line); border-radius: 12px; background: #fff; }
}

@media (max-width: 560px) {
  .legal-brand img { width: 168px; height: 48px; }
  .legal-header .container { min-height: 68px; }
}

/* ================= Rodapé: links legais ================= */

.footer-legal-links { display: grid; gap: 10px; margin-bottom: 14px; }

.footer-link-button {
  justify-self: start;
  padding: 0;
  border: 0;
  color: #d7cbc5;
  background: none;
  font: inherit;
  font-size: .875rem;
  line-height: 1.7;
  text-align: left;
  cursor: pointer;
  transition: color .3s ease;
}

.footer-link-button:hover { color: #efb296; }
.footer-link-button:focus-visible { outline: 3px solid rgba(239, 178, 150, .5); outline-offset: 3px; }

/* ================= Aceites do formulário ================= */

.consent-item p { font-size: .9rem; line-height: 1.55; color: #4b423e; }
.consent-item p a { color: var(--brand-copper-dark); font-weight: 600; text-underline-offset: .2em; }
.consent-item.consent-health { border-color: #d8b9a8; background: #fbf4f0; }
.consent-item.consent-health strong { color: var(--brand-ink); }

/* ================= Aviso de cookies ================= */

.cookie-banner {
  position: fixed;
  z-index: 1200;
  right: 24px;
  bottom: 24px;
  width: min(calc(100% - 48px), 520px);
  padding: 24px 24px 20px;
  border: 1px solid var(--brand-line);
  border-radius: 18px;
  color: var(--brand-ink);
  background: #fffdfa;
  box-shadow: 0 30px 70px -24px rgba(47, 41, 38, .38), 0 10px 24px -14px rgba(47, 41, 38, .2);
  font-family: var(--font-text);
  animation: cookie-in .6s cubic-bezier(.16, 1, .3, 1) both;
}

.cookie-banner[hidden] { display: none; }

@keyframes cookie-in {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
  to { opacity: 1; transform: none; }
}

.cookie-banner h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.cookie-banner h2:focus { outline: none; }
.cookie-banner p { margin: 0; color: #4b423e; font-size: .95rem; line-height: 1.6; }
.cookie-banner a { color: var(--brand-copper-dark); font-weight: 600; text-underline-offset: .2em; }

.cookie-prefs { display: grid; gap: 10px; margin-top: 18px; }
.cookie-prefs[hidden] { display: none; }

.cookie-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--brand-line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.cookie-option strong { display: block; font-size: .95rem; font-weight: 650; }
.cookie-option small { display: block; margin-top: 2px; color: var(--brand-muted); font-size: .84rem; line-height: 1.45; }
.cookie-option.is-locked { cursor: default; background: #fbf6f2; }

/* Interruptor acessível: o checkbox real fica por cima, invisível. */
.cookie-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.cookie-switch input { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.cookie-switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d9cbc3;
  transition: background-color .3s ease;
}
.cookie-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .3s cubic-bezier(.16, 1, .3, 1);
}
.cookie-switch input:checked + span { background: var(--brand-copper-dark); }
.cookie-switch input:checked + span::after { transform: translateX(20px); }
.cookie-switch input:disabled + span { background: #b8998b; }
.cookie-switch input:focus-visible + span { outline: 3px solid rgba(169, 80, 52, .4); outline-offset: 2px; }

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 18px;
}

.cookie-btn {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  font: 600 .92rem/1.2 var(--font-text);
  cursor: pointer;
  transition: background-color .3s ease, border-color .3s ease, color .3s ease;
}

.cookie-btn:focus-visible { outline: 3px solid rgba(169, 80, 52, .4); outline-offset: 2px; }
.cookie-btn-text { margin-right: auto; padding: 0 4px; color: var(--brand-copper-dark); background: none; text-decoration: underline; text-underline-offset: .2em; }
.cookie-btn-ghost { border-color: var(--brand-copper-dark); color: var(--brand-copper-dark); background: #fff; }
.cookie-btn-ghost:hover { background: #fbeee7; }
.cookie-btn-primary { border-color: var(--brand-copper-dark); color: #fff; background: var(--brand-copper-dark); }
.cookie-btn-primary:hover { border-color: #633025; background: #633025; }

/* O botão flutuante do WhatsApp não disputa espaço com o aviso. */
.has-cookie-banner .floating-whatsapp { opacity: 0 !important; visibility: hidden !important; }

@media (max-width: 760px) {
  .cookie-banner { left: 12px; right: 12px; bottom: 12px; width: auto; padding: 20px 18px 16px; }
  .cookie-actions { justify-content: stretch; }
  .cookie-actions .cookie-btn:not(.cookie-btn-text) { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner { animation: none; }
  .cookie-switch span, .cookie-switch span::after { transition: none; }
}
