/* ============================================================
   Linktree Dr. Eduardo Santana
   Dois modos de cor: pacientes (claro, lilás + azul) e médicos
   (azul-marinho + turquesa). Paleta oficial do Brand Book.
   ============================================================ */

:root {
  --navy: #0e1f89;
  --navy-deep: #0a1670;
  --lilac: #ab3ae8;
  --teal: #29d3a4;
  --serif: "Forum", Georgia, "Times New Roman", serif;
  --sans: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gut: 20px;
}

/* ---------- modo pacientes (padrão) ---------- */
html, html[data-mode="pacientes"] {
  --bg: #f5f0fa;
  --ink: #1b1b1d;
  --muted: #5d5866;
  --line: rgba(91, 42, 126, 0.2);
  --name: #0e1f89;
  --accent: #7a22b3;
  --accent-soft: rgba(171, 58, 232, 0.12);
  --link: #0e1f89;
  --surf: rgba(255, 255, 255, 0.78);
  --surf-line: rgba(91, 42, 126, 0.14);
  --shadow: 0 10px 24px -14px rgba(60, 20, 110, 0.35);
  --ico-bg: linear-gradient(140deg, #8a3df0 0%, #0e1f89 100%);
  --ico-ink: #fff;
  --tog-bg: rgba(91, 42, 126, 0.1);
  --tab-ink: #4b3a63;
  --thumb: linear-gradient(135deg, #b44af0 0%, #6a2bc0 100%);
  --thumb-ink: #fff;
  --thumb-glow: 0 8px 20px -6px rgba(171, 58, 232, 0.6);
}

/* ---------- modo médicos ---------- */
html[data-mode="medicos"] {
  --bg: #0a1670;
  --ink: #f4f2ee;
  --muted: rgba(244, 242, 238, 0.74);
  --line: rgba(244, 242, 238, 0.2);
  --name: #ffffff;
  --accent: #29d3a4;
  --accent-soft: rgba(41, 211, 164, 0.16);
  --link: #29d3a4;
  --surf: rgba(255, 255, 255, 0.07);
  --surf-line: rgba(255, 255, 255, 0.16);
  --shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.6);
  --ico-bg: linear-gradient(140deg, #29d3a4 0%, #1aa7c4 100%);
  --ico-ink: #0a1670;
  --tog-bg: rgba(255, 255, 255, 0.1);
  --tab-ink: rgba(244, 242, 238, 0.8);
  --thumb: #29d3a4;
  --thumb-ink: #0a1670;
  --thumb-glow: 0 8px 20px -6px rgba(41, 211, 164, 0.55);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  transition: background-color 0.5s ease;
}
body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: color 0.4s ease;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
picture { display: contents; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- brilhos de fundo (um por modo) ---------- */
.glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.glow-p {
  background:
    radial-gradient(60% 40% at 100% 0%, rgba(41, 211, 164, 0.22), transparent 70%),
    radial-gradient(70% 45% at 0% 100%, rgba(171, 58, 232, 0.2), transparent 70%);
}
.glow-m {
  background:
    radial-gradient(60% 40% at 100% 0%, rgba(41, 211, 164, 0.22), transparent 70%),
    radial-gradient(70% 50% at 0% 100%, rgba(171, 58, 232, 0.32), transparent 70%);
}
html[data-mode="pacientes"] .glow-p, html[data-mode="medicos"] .glow-m { opacity: 1; }
html:not([data-mode]) .glow-p { opacity: 1; }

/* ---------- estrutura ---------- */
.shell { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; }
.content { padding: 4px var(--gut) 48px; }

/* ---------- cabeçalho compacto ---------- */
.top { padding: 34px var(--gut) 22px; animation: rise 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.selo { width: 52px; height: auto; margin-bottom: 18px; }
.selo-m { display: none; }
html[data-mode="medicos"] .selo-p { display: none; }
html[data-mode="medicos"] .selo-m { display: block; }

.top h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 12.5vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.005em;
  color: var(--name);
  transition: color 0.4s ease;
}
.top h1 .pre {
  display: block;
  margin-bottom: 10px;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
}
.role { margin-top: 14px; font-size: 1rem; font-weight: 500; }
.cred, .crm { font-size: 0.875rem; color: var(--muted); }
.cred { margin-top: 2px; }
.crm { margin-top: 2px; letter-spacing: 0.03em; font-variant-numeric: lining-nums; }

/* ---------- alternador pacientes / médicos ---------- */
.toggle {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 5px;
  background: var(--tog-bg);
  border-radius: 18px;
  transition: background-color 0.4s ease;
}
html:not(.js) .toggle { display: none; }
.thumb {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc(50% - 5px);
  border-radius: 13px;
  background: var(--thumb);
  box-shadow: var(--thumb-glow);
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1), background 0.4s ease, box-shadow 0.4s ease;
}
html[data-mode="medicos"] .thumb { transform: translateX(100%); }
.tab {
  position: relative;
  z-index: 1;
  min-height: 54px;
  padding: 0 8px;
  border: 0;
  background: none;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--tab-ink);
  cursor: pointer;
  transition: color 0.3s ease;
}
.tab[aria-selected="true"] { color: var(--thumb-ink); }

/* ---------- painéis ---------- */
.panel { display: none; }
html[data-mode="pacientes"] #panel-pacientes,
html[data-mode="medicos"] #panel-medicos { display: block; animation: rise 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
html:not(.js) .panel { display: block; }
html:not(.js) #panel-medicos { margin-top: 40px; }

.block { margin-top: 28px; }
.sec {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.sec::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- destaque ---------- */
.feature {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 112px;
  grid-template-areas:
    "tag   cover"
    "title cover"
    "desc  desc"
    "foot  foot";
  column-gap: 16px;
  margin-top: 14px;
  padding: 26px 20px 22px;
  border-radius: 22px;
}
.tag { grid-area: tag; align-self: start; font-size: 0.875rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; }
.feature h3 {
  grid-area: title;
  align-self: start;
  margin-top: 8px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 8vw, 2.125rem);
  line-height: 1.08;
  text-wrap: balance;
}
.feature-cover img { grid-area: cover; align-self: start; justify-self: end; }
.feature-cover img {
  width: 112px;
  border-radius: 4px;
  transform: rotate(3deg);
  box-shadow: 0 20px 30px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.feature-desc { grid-area: desc; margin-top: 18px; font-size: 0.9375rem; line-height: 1.55; text-wrap: pretty; }
.feature-foot { grid-area: foot; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 22px; }
.price { display: flex; flex-direction: column; line-height: 1.15; }
.price strong { font-family: var(--serif); font-weight: 400; font-size: 2rem; font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }
.price span { font-size: 0.875rem; white-space: nowrap; }

.btn {
  flex: 1 1 auto;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 14px;
  white-space: nowrap;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 14px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}
.btn::after { content: ""; position: absolute; inset: 0; } /* o card inteiro é clicável */
.btn .arr { width: 18px; height: 18px; padding: 0; background: none; border-radius: 0; }
.btn:hover .arr { transform: translateX(3px); }
.btn .arr { transition: transform 0.25s ease; }

/* pacientes: gradiente azul para lilás, botão turquesa */
.feature--p {
  color: #fff;
  background:
    radial-gradient(70% 80% at 100% 0%, rgba(41, 211, 164, 0.34), transparent 62%),
    linear-gradient(140deg, #0e1f89 0%, #2c1f9e 52%, #7a2fc8 100%);
  box-shadow: 0 24px 40px -22px rgba(60, 20, 140, 0.7);
}
.feature--p .tag { color: #7ff0d0; }
.feature--p .feature-desc { color: rgba(255, 255, 255, 0.88); }
.feature--p .price span { color: rgba(255, 255, 255, 0.74); }
.feature--p .btn { color: #0a1670; background: #29d3a4; box-shadow: 0 10px 20px -8px rgba(41, 211, 164, 0.7); }
.feature--p .btn:hover { background: #4be0b8; transform: translateY(-1px); }

/* ---------- linhas de links ---------- */
.rows { list-style: none; padding: 0; margin-top: 14px; display: grid; gap: 10px; }
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 14px 16px 14px 14px;
  background: var(--surf);
  border: 1px solid var(--surf-line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.4s ease;
}
.row:hover { transform: translateY(-2px); border-color: var(--accent); }
.row:active { transform: translateY(0); }
.ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--ico-bg);
  color: var(--ico-ink);
  transition: background 0.4s ease;
}
.ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.row-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-title { font-family: var(--serif); font-size: 1.4375rem; line-height: 1.15; color: var(--ink); text-wrap: balance; }
.row-desc { font-size: 0.875rem; line-height: 1.4; color: var(--muted); text-wrap: pretty; }
.row .arr {
  flex: none;
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}
.row:hover .arr { transform: translateX(3px); background: var(--accent); color: var(--bg); }
.arr { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- foto por baixo ---------- */
.closing {
  margin: 40px calc(var(--gut) * -1) -6px;
  position: relative;
  pointer-events: none;
}
.closing img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 38% 20%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 30%, #000 62%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 30%, #000 62%, transparent 100%);
  transition: filter 0.5s ease;
}
html[data-mode="medicos"] .closing img { filter: brightness(0.86) saturate(0.95); }

/* ---------- rodapé ---------- */
.foot {
  position: relative;
  padding-top: 8px;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--muted);
  text-align: center;
}
.foot strong { color: var(--ink); font-weight: 600; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--link); font-weight: 500; font-variant-numeric: lining-nums; }
.foot-legal { margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line); font-variant-numeric: lining-nums; }
.nw { white-space: nowrap; }

/* ---------- animação de entrada ---------- */
.rise { animation: rise 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) var(--d, 0s) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .rise, .top, .panel { animation: none !important; }
  .thumb, .row, .row .arr, .btn, .btn .arr, .glow, html { transition: none; }
}

/* ---------- telas pequenas ---------- */
@media (max-width: 360px) {
  :root { --gut: 16px; }
  .feature { grid-template-columns: 1fr 92px; padding-inline: 18px; }
  .feature-cover img { width: 92px; }
  .row-title { font-size: 1.3125rem; }
}

/* ---------- telas maiores: coluna central com mais ar ---------- */
@media (min-width: 700px) {
  :root { --gut: 28px; }
  .shell { max-width: 600px; }
  .top { padding-top: 64px; }
  .selo { width: 60px; }
  .feature { grid-template-columns: 1fr 132px; padding: 32px 30px 28px; }
  .feature-cover img { width: 132px; }
  .row-title { font-size: 1.5625rem; }
  .closing { margin-bottom: -10px; }
}
