/* Página da clínica (credenciais.doktra.ai). Base: protótipo v3 aprovado.
   Página de marca, só tema claro (igual ao site e ao e-mail).
   Tudo servido pela própria origem: CSP sem estilos inline. */

@font-face {
  font-family: "Figtree";
  src: url("../fontes/Figtree-Variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fontes/Inter-Variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --lab-coat: #2D83B6;      /* símbolo, destaques */
  --lab-coat-ink: #2876A4;  /* botões com texto branco (contraste AA) */
  --sky: #549FCC;           /* traços, ícones */
  --dark: #203D50;          /* títulos e texto */
  --slate: #4A6B7E;         /* texto de apoio */
  --deep-trust: #D5E4EE;    /* caixas de destaque */
  --calm: #B3D1E3;          /* bordas */
  --surface: #F5FAFD;
  --line: #E6ECF0;
  --night: #0F2838;         /* rodapé */
  --human: #EBE6BF;         /* acento quente, raro */
  --white: #FFFFFF;

  --f-display: "Figtree", "Segoe UI", system-ui, sans-serif;
  --f-body: "Inter", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--night); }
body { margin: 0; background: var(--white); color: var(--dark); font-family: var(--f-body); font-size: 15px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
h2:focus { outline: none; }

/* Valores (ID da unidade, Cliente ID, Senha): Inter com algarismos tabulares e zero cortado,
   em .unit b e .field output. Sem fonte monoespaçada. */

/* ---------- Página ---------- */
.site { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; position: relative; }
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 32px; border-bottom: 1px solid var(--line); background: var(--white); }
.site-head img { height: 36px; width: auto; display: block; } /* 160 px de largura, mínimo do memorial */
.site-head span { font-size: 13px; font-weight: 500; color: var(--slate); }
.home { display: inline-flex; border-radius: 6px; }
.stage {
  flex: 1; position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--white) 0%, var(--surface) 55%, #E9F2F8 100%);
  display: grid; place-items: start center; padding: 56px 20px 72px;
}
.arcs { position: absolute; inset: auto 0 0 0; width: 100%; height: 70%; pointer-events: none; }
#vista { position: relative; width: 100%; max-width: 520px; display: grid; }
.card {
  position: relative; width: 100%; max-width: 520px;
  background: var(--white); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 30px 60px -40px rgba(32,61,80,.45);
  padding: 36px 36px 32px; display: grid; gap: 22px;
}
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--lab-coat-ink); display: flex; align-items: center; gap: 8px; }
.card h2 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: 30px; line-height: 1.18; letter-spacing: -0.015em; text-wrap: balance; }
.lead { margin: 0; color: var(--slate); font-size: 16px; line-height: 1.6; }
.lead strong { color: var(--dark); font-weight: 600; }

.unit { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.unit small { display: block; font-size: 12px; color: var(--slate); margin-bottom: 2px; }
.unit b { font-family: var(--f-body); font-feature-settings: "tnum", "zero"; font-weight: 500; font-size: 16px; letter-spacing: .02em; overflow-wrap: anywhere; }
.unit .tag { font-size: 12px; color: var(--slate); text-align: right; }

.notice { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding: 16px 18px; border-radius: 12px; background: var(--deep-trust); color: var(--dark); font-size: 14px; line-height: 1.55; }
.notice p { margin: 0; }
.notice strong { font-weight: 600; }
.notice.warm { background: #F6F3DE; border: 1px solid var(--human); }
.notice.erro { background: #F6F3DE; border: 1px solid var(--human); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 999px; padding: 15px 28px; font-weight: 600; font-size: 15px; background: var(--lab-coat-ink); color: var(--white); transition: background .2s, transform .2s; }
.btn:hover { background: #1F6A96; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { cursor: progress; opacity: .7; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--dark); border: 1px solid var(--calm); }
.btn.ghost:hover { background: var(--surface); }
.fine { margin: 0; text-align: center; font-size: 13px; color: var(--slate); }

/* Campos revelados */
.fields { display: grid; gap: 12px; }
.field { border: 1px solid var(--calm); border-radius: 14px; padding: 14px 14px 14px 18px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; }
.field label { grid-column: 1 / -1; font-size: 12px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--slate); }
.field output { font-family: var(--f-body); font-feature-settings: "tnum", "zero"; font-size: 19px; color: var(--dark); min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; -webkit-user-select: all; user-select: all; }
.copy { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--calm); background: var(--white); color: var(--lab-coat-ink); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.copy:hover { background: var(--surface); }
.copy.done { background: var(--dark); border-color: var(--dark); color: var(--white); }
.gone { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--slate); border-top: 1px dashed var(--line); padding-top: 16px; }
.gone i { width: 8px; height: 8px; border-radius: 50%; background: var(--lab-coat); flex: none; }

/* Ícone do estado 4 */
.badge { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); }
.contact { display: grid; gap: 8px; padding: 16px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.contact div { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.contact span { color: var(--slate); }
.contact b { font-weight: 600; -webkit-user-select: all; user-select: all; }

/* Diálogo ao sair (estado 3) */
.scrim { position: fixed; inset: 0; background: rgba(15,40,56,.42); display: grid; place-items: center; padding: 20px; z-index: 5; overflow-y: auto; }
.dialog { width: 100%; max-width: 420px; background: var(--white); border-radius: 20px; padding: 28px; display: grid; gap: 16px; box-shadow: 0 30px 80px -20px rgba(15,40,56,.5); }
.dialog h3 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: 22px; line-height: 1.25; text-wrap: balance; }
.dialog p { margin: 0; color: var(--slate); line-height: 1.55; }
.dialog .row { display: flex; flex-wrap: wrap; gap: 10px; }
.dialog .row .btn { flex: 1 1 160px; padding: 13px 18px; }
body.com-dialogo { overflow: hidden; }

/* Rodapé: cópia do rodapé de www.doktra.com.br (classes e valores do site) */
.footer { background: var(--night); padding: 64px 0 24px; font-family: var(--f-body); }
.footer .wrap { max-width: 1216px; margin-inline: auto; padding-inline: 32px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer a { text-decoration: none; }
.footer__main { display: grid; grid-template-columns: 1fr; gap: 40px; padding-bottom: 24px; }
@media (min-width: 640px) { .footer__main { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .footer__main { grid-template-columns: 1.6fr repeat(4, 1fr); } }
.footer__brand > img { height: 26px; width: auto; margin-bottom: 16px; display: block; }
.footer__brand p { color: rgba(255,255,255,.85); font-size: 16px; line-height: 1.5; max-width: 32ch; margin: 0 0 16px; }
.social-row { display: flex; gap: 12px; }
.social-badge { width: 32px; height: 32px; border-radius: 50%; background: var(--lab-coat); display: flex; align-items: center; justify-content: center; transition: background .2s; }
.social-badge:hover { background: var(--lab-coat-ink); }
.social-badge svg { width: 16px; height: 16px; }
.footer__col h4 { font-family: var(--f-display); font-weight: 600; font-size: 12px; letter-spacing: .04em; color: rgba(255,255,255,.6); margin: 0 0 16px; }
.footer__col ul { display: flex; flex-direction: column; gap: 12px; }
.footer__col a { color: rgba(255,255,255,.9); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.footer__col a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.footer__rule { border: none; border-top: 1px solid rgba(255,255,255,.15); margin: 0 0 24px; }
.footer__bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer__bottom p { color: rgba(255,255,255,.7); font-size: 13px; margin: 0; }
.footer__nano { display: inline-flex; align-items: center; opacity: .85; transition: opacity .2s ease; }
.footer__nano:hover { opacity: 1; }
.footer__nano img { height: 16px; width: auto; display: block; }
.footer :focus-visible { outline-color: #fff; }

/* Celular */
@media (max-width: 560px) {
  .site-head { padding: 14px 18px; }
  .site-head span { display: none; }
  .stage { padding: 28px 14px 48px; }
  .card { padding: 26px 20px 22px; gap: 18px; border-radius: 18px; }
  .card h2 { font-size: 25px; }
  .field output { font-size: 17px; }
  .footer { padding-top: 48px; }
  .footer .wrap { padding-inline: 20px; }
}

.fade { animation: fade .35s ease both; }
@keyframes fade { from { opacity: .001; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade { animation: none; } .btn, .social-badge, .footer__nano { transition: none; } }

/* Aviso de navegador sem suporte: dentro do cartão "Carregando…", que o script
   substitui por inteiro (vista.replaceChildren), então some junto com ele.
   Nasce com visibility: hidden (leitor de tela não lê antes da hora) e uma
   animação de duração 0 com atraso de 8 s o torna visível de uma vez, sem
   transição. Vale também com prefers-reduced-motion: reduce, porque não há
   movimento nenhum; "animation: none" faria o aviso nunca aparecer. */
.aviso-sem-suporte { margin: 0; text-align: center; font-size: 14px; line-height: 1.5; color: var(--slate); visibility: hidden; animation: aviso-aparece 0s 8s forwards; }
@keyframes aviso-aparece { to { visibility: visible; } }
