/* PredSaúde — páginas internas (contato, políticas e materiais). Depende de site.css. */

/* ---------- Page hero ---------- */

.page-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: calc(var(--header-h) + 36px) 0 64px;
  background: var(--ink);
  color: var(--white);
}

.page-hero__grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgb(255 255 255 / 4%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 4%) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 15%, transparent 70%);
  mask-image: radial-gradient(ellipse at 70% 40%, #000 15%, transparent 70%);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  color: rgb(255 255 255 / 65%);
  font-size: 0.875rem;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 6px;
  color: rgb(255 255 255 / 35%);
}

.breadcrumb a {
  color: rgb(255 255 255 / 85%);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--white);
  text-decoration: underline;
}

.page-hero__title {
  color: var(--white);
  font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.page-hero__lead {
  max-width: 40rem;
  margin-top: 14px;
  color: rgb(255 255 255 / 78%);
  font-size: clamp(1rem, 0.96rem + 0.25vw, 1.15rem);
}

/* Heartbeat echo from the home hero */
.page-hero__pulse {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  z-index: -1;
  width: 100%;
  height: 44px;
  pointer-events: none;
}

.page-hero__pulse path {
  fill: none;
  stroke: var(--sky);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.8;
  filter: drop-shadow(0 0 5px rgb(0 144 255 / 60%));
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1.8s 0.2s cubic-bezier(0.45, 0, 0.2, 1) forwards;
}

@media (min-width: 900px) {
  .page-hero {
    padding: calc(var(--header-h) + 64px) 0 96px;
  }

  .page-hero__pulse {
    bottom: 22px;
    height: 64px;
  }
}

.page-body {
  padding-block: 40px 72px;
}

@media (min-width: 900px) {
  .page-body {
    padding-block: 64px 112px;
  }
}

/* ---------- Contact ---------- */

.contact-layout {
  display: grid;
  gap: 32px;
}

.contact-channels {
  display: grid;
  gap: 12px;
}

.channel {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--white);
  color: var(--text);
  text-decoration: none;
}

a.channel {
  transition: border-color 0.2s, box-shadow 0.2s;
}

a.channel:hover {
  border-color: var(--royal);
  box-shadow: var(--shadow);
}

.channel__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 44px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: var(--mist);
  color: var(--royal);
}

.channel__icon svg {
  width: 20px;
  height: 20px;
}

.channel--whatsapp .channel__icon {
  background: rgb(37 211 102 / 16%);
  color: #128c4a;
}

.channel strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}

.channel__text span {
  display: block;
  color: var(--muted);
  font-size: 0.925rem;
  overflow-wrap: anywhere;
}

.form-card {
  padding: 24px 20px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--white);
  box-shadow: var(--shadow);
}

.form-card__title {
  font-size: 1.4rem;
  font-weight: 600;
}

.form-card__text {
  margin: 8px 0 24px;
  color: var(--muted);
  font-size: 0.95rem;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--ink);
  font-size: 0.925rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--white);
  color: var(--text);
  font: inherit;
  font-size: 1rem; /* 16px avoids iOS zoom on focus */
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field select {
  appearance: none;
  padding-right: 40px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a6b85' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center / 18px no-repeat;
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.field input:hover,
.field select:hover:not(:disabled),
.field textarea:hover {
  border-color: #b9c9e2;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--royal);
  outline: none;
  box-shadow: 0 0 0 4px rgb(0 63 193 / 14%);
}

.field select:disabled {
  background-color: var(--mist);
  color: var(--muted);
  cursor: not-allowed;
}

.form-note {
  color: var(--muted);
  font-size: 0.875rem;
}

.form-actions {
  display: grid;
  gap: 14px;
  margin-top: 6px;
}

.form-actions .btn[aria-busy="true"] {
  opacity: 0.75;
  cursor: progress;
}

.form-status {
  display: none;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius-s);
  font-weight: 500;
}

.form-status.is-success,
.form-status.is-error {
  display: flex;
}

.form-status.is-success {
  background: rgb(22 184 146 / 12%);
  color: #0b6b54;
}

.form-status.is-error {
  background: #fdecec;
  color: #9b1c1c;
}

@media (min-width: 640px) {
  .form-card {
    padding: 36px 36px 40px;
  }

  .form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .field--full,
  .form-actions,
  .form-status {
    grid-column: 1 / -1;
  }

  .form-actions {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 20px;
  }

  .contact-channels {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .contact-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 48px;
    align-items: start;
  }

  .contact-aside {
    position: sticky;
    top: calc(var(--header-h) + 24px);
  }

  .contact-channels {
    grid-template-columns: 1fr;
  }
}

.contact-aside__title {
  margin-bottom: 14px;
  font-size: 1.1rem;
  font-weight: 600;
}

/* ---------- Legal documents ---------- */

.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.doc-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
}

/* Policy switcher: horizontal chips on mobile */
.doc-nav ul {
  display: flex;
  gap: 8px;
  margin-inline: calc(var(--gutter) * -1);
  padding: 2px var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
}

.doc-nav ul::-webkit-scrollbar {
  display: none;
}

.doc-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.925rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.doc-nav a:hover {
  border-color: var(--royal);
}

.doc-nav a[aria-current="page"] {
  border-color: var(--royal);
  background: var(--royal);
  color: var(--white);
}

/* Table of contents: collapsible on mobile */
.doc-toc {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--mist);
}

.doc-toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 12px 16px;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.doc-toc summary::-webkit-details-marker {
  display: none;
}

.doc-toc summary::after {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.25s var(--ease);
}

.doc-toc[open] summary::after {
  transform: rotate(180deg);
}

.doc-toc ol {
  display: grid;
  padding: 0 8px 12px;
}

.doc-toc a {
  display: block;
  padding: 8px;
  border-radius: var(--radius-s);
  color: var(--text);
  font-size: 0.925rem;
  line-height: 1.4;
  text-decoration: none;
}

.doc-toc a:hover {
  background: var(--white);
  color: var(--royal);
}

.doc-toc a[aria-current="true"] {
  background: var(--white);
  color: var(--royal);
  font-weight: 700;
}

/* Prose */
.prose {
  max-width: 72ch;
  min-width: 0;
  color: var(--text);
  font-size: 1.025rem;
  line-height: 1.75;
  overflow-wrap: break-word;
}

.prose > * + * {
  margin-top: 1em;
}

.prose h2 {
  display: flex;
  gap: 10px;
  margin-top: 2.4em;
  padding-top: 1.4em;
  border-top: 1px solid var(--line);
  font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  font-weight: 600;
  line-height: 1.3;
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.prose h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.prose h2 .doc-num {
  flex: none;
  color: var(--royal);
}

.prose h3 {
  margin-top: 1.8em;
  font-size: 1.1rem;
  font-weight: 600;
}

.prose h2 + *,
.prose h3 + * {
  margin-top: 0.6em;
}

.prose b,
.prose strong {
  color: var(--ink);
}

.prose a {
  overflow-wrap: anywhere;
  font-weight: 500;
}

.prose ul {
  padding-left: 1.3em;
  list-style: disc;
}

.prose ul.plain {
  padding-left: 0;
  list-style: none;
}

.prose li + li {
  margin-top: 0.45em;
}

.prose li::marker {
  color: var(--sky);
}

/* LGPD: DPO contact card */
.dpo-card {
  display: grid;
  gap: 16px;
  margin-top: 2em !important;
  padding: 24px 20px;
  border-radius: var(--radius-l);
  background: var(--ink);
  color: rgb(255 255 255 / 80%);
  line-height: 1.5;
}

.dpo-card h2 {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--white);
  font-size: 1.25rem;
}

.dpo-card dl {
  display: grid;
  gap: 14px;
  margin: 0;
}

.dpo-card dt {
  color: rgb(255 255 255 / 60%);
  font-size: 0.85rem;
  font-weight: 700;
}

.dpo-card dd {
  margin: 2px 0 0;
}

.dpo-card a {
  color: var(--white);
  font-weight: 600;
}

@media (min-width: 640px) {
  .dpo-card {
    padding: 32px;
  }
}

/* FAQ accordion */
.faq {
  display: grid;
  gap: 12px;
  max-width: 72ch;
}

.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.faq details[open] {
  border-color: #b9c9e2;
  box-shadow: var(--shadow);
}

.faq summary {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 18px 18px 20px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  margin-left: auto;
  background: var(--royal);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.3s var(--ease);
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq__answer {
  padding: 0 20px 20px;
  color: var(--text);
  line-height: 1.7;
}

@media (min-width: 1024px) {
  .doc-layout {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 56px;
    align-items: start;
  }

  .doc-side {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
    gap: 28px;
  }

  .doc-nav ul {
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .doc-nav a {
    display: flex;
    min-height: 40px;
    border-color: transparent;
    border-radius: var(--radius-s);
  }

  .doc-nav a:hover {
    border-color: transparent;
    background: var(--mist);
  }

  .doc-toc {
    border: 0;
    background: none;
  }

  .doc-toc summary {
    min-height: 0;
    padding: 0 8px 8px;
    color: var(--muted);
    font-size: 0.85rem;
    cursor: default;
    pointer-events: none;
  }

  .doc-toc summary::after {
    display: none;
  }

  .doc-toc ol {
    padding: 0;
    border-left: 2px solid var(--line);
  }

  .doc-toc a {
    margin-left: -2px;
    padding: 6px 12px;
    border-left: 2px solid transparent;
    border-radius: 0;
    font-size: 0.875rem;
  }

  .doc-toc a:hover {
    background: none;
  }

  .doc-toc a[aria-current="true"] {
    border-left-color: var(--royal);
    background: none;
  }
}

/* ---------- Materials ---------- */

.topic + .topic {
  margin-top: 72px;
  padding-top: 72px;
  border-top: 1px solid var(--line);
}

.topic__head {
  max-width: 48rem;
}

.topic__kicker {
  color: var(--royal);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topic__title {
  margin-top: 6px;
  font-size: clamp(1.6rem, 1.25rem + 1.6vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.topic__lead {
  margin-top: 12px;
  color: var(--muted);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
}

.topic__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.topic__steps li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--mist);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
}

.topic__steps span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--royal);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
}

.topic__group {
  margin-top: 48px;
}

.topic__group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  margin-bottom: 20px;
}

.topic__group-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.topic__group-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.topic__group-note kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--white);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.media-grid {
  display: grid;
  gap: 20px;
}

/* The whole card is clickable through its link's stretched ::after */
.media-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}

.media-card:hover {
  border-color: #b9c9e2;
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.media-card__thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--mist);
}

.media-grid--decks .media-card__thumb {
  aspect-ratio: 16 / 9;
}

.media-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  transition: transform 0.6s var(--ease);
}

.media-card:hover .media-card__thumb img {
  transform: scale(1.03);
}

.media-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 20px 20px 22px;
}

.media-card__meta {
  color: var(--royal);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.media-card__title {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
}

.media-card__title a {
  color: inherit;
  text-decoration: none;
}

.media-card__text {
  color: var(--muted);
  font-size: 0.95rem;
}

.media-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  color: var(--royal);
  font-weight: 700;
  text-decoration: none;
}

.media-card__cta::before {
  content: "";
  order: 1;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.3s var(--ease);
}

.media-card:hover .media-card__cta::before {
  transform: translateX(4px);
}

.media-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.media-card__link:focus-visible {
  outline: none;
}

.media-card:has(.media-card__link:focus-visible) {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
}

@media (min-width: 640px) {
  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }
}

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

  .media-grid--decks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .media-grid--decks .media-card__body {
    padding: 24px 28px 28px;
  }

  .media-grid--decks .media-card__title {
    font-size: 1.4rem;
  }
}
