/* ===================================================================
   Terapia em Casa — Demo de Atendimento Online (ClinicaSaude)
   Estilo compartilhado pelas 3 telas: index (montar sala), medico e paciente.
   Cores pensadas pra transmitir confiança + acolhimento (azul + verde),
   mesma linha da landing page antiga (previa.sanweb.com.br/previa/clinica-saude/).
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

/* Paleta copiada de verdade do código-fonte da landing page já publicada
   (previa.sanweb.com.br/previa/clinica-saude/) — teal + âmbar, não inventada. */
:root {
  --color-primary: #1a9e91;      /* teal — mesma cor de destaque do site real */
  --color-primary-dark: #147b71;
  --color-secondary: #f59f0a;    /* âmbar — mesma cor do botão principal do site real */
  --color-bg: #fbfaf9;
  --color-card: #ffffff;
  --color-text: #0f1729;
  --color-muted: #64748b;
  --color-border: #e2e8f0;
  --color-danger: #e0554f;
  --radius: 16px;
  --sombra: 0 10px 30px rgba(15, 23, 41, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

a { color: inherit; }

/* Cabeçalho simples usado nas 3 telas, com a marca da demo */
.topo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.1rem 1.5rem;
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

/* Celular estreito: nome + cronômetro + botão de sair não cabem numa
   linha só. Encolhe o texto e deixa quebrar de forma controlada em vez
   de estourar a tela (paciente entra muito por celular). */
@media (max-width: 480px) {
  .topo { padding: 0.85rem 1rem; }
  .topo .marca { font-size: 0.88rem; }
  .topo .cronometro,
  .topo .botao-sair,
  .topo .papel { font-size: 0.72rem; padding: 0.3rem 0.6rem; }
}

.topo .marca {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-primary-dark);
}

.topo .selo {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-secondary);
}

.topo .papel {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--color-muted);
  background: var(--color-bg);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
}

/* Cronômetro de duração da consulta, no cabeçalho das telas de chamada.
   margin-left:auto empurra ele (e o botão de sair, junto) pra direita. */
.topo .cronometro {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  background: #eef4f2;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

/* Botão de sair da chamada e voltar pro site — sempre visível, não depende
   só do controle interno do Jitsi. */
.topo .botao-sair {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: var(--color-danger);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.topo .botao-sair:hover { filter: brightness(1.08); }

/* ---------- Tela inicial (index.html) — monta a sala da consulta ---------- */
.envolucro-inicial {
  max-width: 560px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.envolucro-inicial h1 {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  margin: 0 0 0.4rem;
}

.envolucro-inicial .subtitulo {
  color: var(--color-secondary);
  font-weight: 600;
  margin: 0 0 1.6rem;
}

.cartao {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  padding: 1.75rem;
  border: 1px solid var(--color-border);
}

.campo { margin-bottom: 1.1rem; }

.campo label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
  margin-bottom: 0.35rem;
}

.campo input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1.5px solid var(--color-border);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--color-text);
}

.campo input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.campo .ajuda {
  font-size: 0.78rem;
  color: var(--color-muted);
  margin-top: 0.3rem;
}

.linha-botoes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.botao {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.botao:hover { filter: brightness(1.05); transform: translateY(-1px); }

.botao small {
  font-weight: 500;
  font-size: 0.72rem;
  opacity: 0.85;
}

.botao-medico { background: var(--color-primary); color: #fff; }
/* Botão âmbar segue o mesmo site real: texto escuro em vez de branco,
   porque essa cor clara não tem contraste bom com texto branco. */
.botao-paciente { background: var(--color-secondary); color: var(--color-text); }

/* ---------- Portão de acesso (senha) — fica na frente até liberar a demo ---------- */
.portao {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  /* Fundo suave com foto real da clínica (mesma imagem da landing page),
     escurecida com camada por cima pra não brigar com o texto do cartão. */
  background-image: linear-gradient(rgba(251, 250, 249, 0.88), rgba(251, 250, 249, 0.88)),
    url('../images/therapy-online.jpg');
  background-size: cover;
  background-position: center;
}

.portao .cartao {
  max-width: 380px;
  width: 100%;
  text-align: center;
}

.portao .selo-topo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.3rem;
}

.portao h1 {
  font-size: 1.25rem;
  margin: 0 0 0.3rem;
  color: var(--color-text);
}

.portao p.legenda {
  color: var(--color-muted);
  font-size: 0.88rem;
  margin: 0 0 1.4rem;
}

.portao .botao-entrar {
  width: 100%;
  margin-top: 0.5rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 0.8rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}

.portao .erro-senha {
  color: var(--color-danger);
  font-size: 0.82rem;
  margin-top: 0.6rem;
  display: none;
}

.portao .nota-protovisao {
  margin-top: 1.2rem;
  font-size: 0.75rem;
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
  padding-top: 0.9rem;
  line-height: 1.5;
}

.escondido { display: none !important; }

.aviso-demo {
  margin-top: 1.5rem;
  font-size: 0.82rem;
  color: var(--color-muted);
  background: #eef4f2;
  border-left: 3px solid var(--color-secondary);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  line-height: 1.5;
}

/* ---------- Telas de chamada (medico.html / paciente.html) ---------- */
.tela-chamada {
  display: flex;
  flex-direction: column;
  height: 100vh; /* alternativa pra navegador antigo */
  height: 100dvh; /* altura real da tela no celular, sem contar a barra do navegador que aparece/some */
}

.corpo-chamada {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  min-height: 0;
}

.corpo-chamada.com-painel {
  grid-template-columns: 1fr 300px;
}

/* Onde o Jitsi (a chamada de vídeo em si) é montado */
#video-chamada {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #0f1720;
}

/* Painel lateral do médico, com a ficha resumida do paciente */
.painel-lateral {
  background: var(--color-card);
  border-left: 1px solid var(--color-border);
  padding: 1.25rem;
  overflow-y: auto;
}

.painel-lateral h2 {
  font-size: 1rem;
  color: var(--color-primary-dark);
  margin: 0 0 1rem;
}

.ficha-item {
  margin-bottom: 0.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--color-border);
}

.ficha-item:last-child { border-bottom: none; }

.ficha-item .rotulo {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-muted);
  margin-bottom: 0.2rem;
}

.ficha-item .valor {
  font-size: 0.92rem;
  font-weight: 600;
}

.selo-seguranca {
  margin-top: 1.5rem;
  font-size: 0.78rem;
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Tela de espera do paciente, antes do médico entrar (efeito calmo) */
.tela-espera {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(160deg, var(--color-primary-dark), var(--color-secondary));
  color: #fff;
  text-align: center;
  padding: 1.5rem;
}

.tela-espera .pulso {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  animation: pulsar 1.8s ease-in-out infinite;
}

@keyframes pulsar {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.12); opacity: 1; }
}

.tela-espera h1 { font-size: 1.35rem; margin: 0; }
.tela-espera p { margin: 0; opacity: 0.9; font-size: 0.95rem; }

@media (prefers-reduced-motion: reduce) {
  .tela-espera .pulso { animation: none; }
}

/* Responsivo: no celular, painel do médico vira faixa embaixo do vídeo */
@media (max-width: 820px) {
  .corpo-chamada.com-painel {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  .painel-lateral {
    border-left: none;
    border-top: 1px solid var(--color-border);
    max-height: 40vh;
  }
  .linha-botoes { grid-template-columns: 1fr; }
}
