/*Criado por WTG Tecnologia em NOV/2025 - dev@wtgtecnologia.com.br*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* layout base */
html, body {
    height: 100%;
    overflow-x: hidden; /* evita scrollbar horizontal causada por overflow */
}

body {
    font-family: 'IBM Plex Sans', Arial, sans-serif;
    background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(171,216,230,1) 100%);
    margin: 0;
    min-height: 100vh;

    /* estrutura em coluna: conteúdo central + rodapé */
    display: flex;
    flex-direction: column;
    color: #333;

    /* garante espaço para o rodapé fixo */
    padding-bottom: 72px; /* ajuste se seu rodapé aumentar */
}

/* tipografias utilitárias */
.h1-as-h4 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 30px;
    color: #0a3b5a;
}
.h2-as-h5 {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 10px;
}
.h3-as-h6 {
    font-size: 10px;
    font-weight: bold;
}

/* wrapper implícito: centrar o card em qualquer viewport
   usando margin:auto no próprio card para evitar tocar no rodapé */
.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 40px 30px;
    border-radius: 16px;
    max-width: 420px;      /* largura máxima para controlar visual em ultrawide */
    width: 100%;
    text-align: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.8s ease-in-out;

    /* centragem vertical e horizontal consistente em qualquer tela */
    margin: auto;          /* top/right/bottom/left = auto => centraliza */
}

/* animação */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* logo */
.logo img {
    width: 200px;
    margin-bottom: 20px;
}

/* ações / botões - base */
.acoes{
    margin-top:6px
}
.botao{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  width:320px;
  max-width:90%;
  min-height:56px;
  padding:12px 18px;
  border-radius:10px;
  background: linear-gradient(180deg, rgba(10,126,195,0.98) 0%, rgba(9,107,165,0.95) 100%);
  color:#fff;
  text-decoration:none;
  font-weight:600;
  font-size:16px;
  box-shadow:0 6px 18px rgba(0,0,0,0.12);
  transition:transform .18s ease,box-shadow .2s ease,background .15s ease;
  margin:14px auto;
  line-height:1;
}

/* variantes de botão */
.botao-paciente{
    background: linear-gradient(180deg, rgba(10,126,195,0.98) 0%, rgba(9,107,165,0.95) 100%);
    margin-bottom: 6px;
}
.botao-secundario{
    background:rgba(86,145,59,0.95);
    margin-bottom: 20px;
}
.botao-cancela{
    background:#C0392B;
    margin-top: 20px;
}
.divider {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: 1px;
}

.botao:hover, .botao-paciente:hover, .botao-secundario:hover{
    transform: translateY(-3px);
    filter: brightness(1.03);
    box-shadow: 0 12px 30px rgba(9,107,165,0.16);
}

/* links auxiliares */
.esqueci{
    display:block;
    /* margin-top:12px; */
    color: #666;
    text-decoration:none;
    font-size:14px
}
.esqueci:hover{
    color: #444;
    text-decoration:underline
}
.forgot {
    margin-top: 8px; /* aproxima do botão verde */
    display: block;
    text-align: center;
}

.voltar{
    display:inline-flex;
    align-items:center;
    margin-top:18px;
    border:1px solid #1e88e5;
    color:#1e88e5;
    padding:8px 12px;
    border-radius:6px;
    text-decoration:none
}
.voltar i {
    margin-right: 6px;
}
.voltar:hover{
    background:rgba(10,126,195,0.95);
    color:#fff
}

/* Acesso Unidade de Saúde */
/* Classe utilitária para labels visuais ocultos (acessibilidade) */
.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap; /* evita quebra */
  border: 0; padding: 0; margin: -1px;
}

/* Grupo do campo (ajuste de espaçamento) */
.formulario .formulario-group {
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Input text / password com mesmo visual dos botões (soft, arredondado) */
.formulario .formulario-input {
  width: min(360px, 88%);         /* se adapta a container e mobile */
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 10px;
  border: 1px solid rgba(9,107,165,0.15);
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 6px 16px rgba(0,0,0,0.04);
  transition: box-shadow 0.18s ease, border-color 0.15s ease, transform 0.12s ease;
  color: #0a3b5a;
  outline: none;
  text-align: center;
}

/* Placeholder */
.formulario .formulario-input::placeholder {
  color: rgba(10, 47, 66, 0.35);
}

/* foco acessível e visual */
.formulario .formulario-input:focus {
  box-shadow: 0 8px 22px rgba(9,107,165,0.09);
  border-color: rgba(10,126,195,0.95);
  transform: translateY(-1px);
}

/* Área de ações - centraliza o botão */
.formulario .formulario-actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Deixa o reCAPTCHA parcialmente visível no mobile */
.recaptcha-wrapper {
    margin-bottom: 60px; /* força ele a descer e ficar aparecendo na borda */
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (max-width: 480px) {
    .recaptcha-wrapper {
        margin-bottom: 80px; /* aumenta no mobile para garantir visualização */
    }
}


/* Botão submit reaproveitando identidade .botao, porém menor */
.botao-submit {
  width: min(260px, 80%);    /* antes 320px — agora mais compacto */
  max-width: 300px;         /* reduzido */
  min-height: 48px;         /* antes 56px */
  padding: 10px 14px;       /* antes 12px 18px */
  border-radius: 10px;
  font-size: 15px;          /* menor, mas ainda legível */
  font-weight: 700;

  background: linear-gradient(180deg, rgba(10,126,195,0.98) 0%, rgba(9,107,165,0.95) 100%);
  color: #fff;
  border: none;
  box-shadow: 0 6px 18px rgba(9,107,165,0.12);

  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.2s ease, filter 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.botao-submit:hover {
  transform: translateY(-3px);
  filter: brightness(1.03);
  box-shadow: 0 10px 26px rgba(9,107,165,0.16);
}

.botao-submit:active {
  transform: translateY(-1px);
}

/* estado disabled */
.botao-submit[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* mobile */
@media (max-width: 480px) {
  .botao-submit {
    width: 80%;           /* mais compacto também no mobile */
    max-width: 200px;
    min-height: 40px;
    padding: 6px 10px;
    font-size: 13px;
  }
}

/* rodapé fixo, mas com folga e sem sobrepor conteúdo (graças ao padding-bottom no body) */
.rodape {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    text-align: center;
    font-size: 12px;
    padding: 6px 0;
    /* background: rgba(255,255,255,0.6); */
    backdrop-filter: blur(6px);
    border-top: 1px solid rgba(0,0,0,0.08);
}


/* mobile adjustments */
@media (max-width: 480px) {
    .login-container {
        padding: 28px 18px;
        max-width: 380px;
    }

    .logo img {
        width: 140px;
        margin-bottom: 14px;
    }

    .botao {
        width: 100%;
        height: 56px;
        padding: 12px;
        font-size: 15px;
    }

    .botao img {
        width: 28px;
        height: 28px;
    }

    body {
        padding-bottom: 96px; /* mais folga se o rodapé for maior no mobile */
    }
}

/* ultrawide tweak (estética) */
@media (min-width: 2000px) {
    .login-container {
        max-width: 480px;
        padding: 48px 36px;
    }
}

/* Splash Screen com spinner e texto */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(171,216,230,1) 100%);
    display: flex;
    flex-direction: column; /* spinner + texto verticalmente */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.6s ease;
}

/* Spinner circular */
.spinner {
    border: 6px solid #d9edf2;
    border-top: 6px solid #096ba5;
    border-radius: 50%;
    width: 64px;
    height: 64px;
    animation: spin 1s linear infinite;
    margin-bottom: 14px; /* espaçamento entre o spinner e o texto */
}

/* Texto "Carregando..." */
.loading-text {
    font-family: 'IBM Plex Sans', Arial, sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #0a3b5a;
    letter-spacing: 0.5px;
    animation: fadeText 1.5s ease-in-out infinite alternate;
}

/* Animações */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeText {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

/* Mensagens de Validação */
.msg-erro {
    background: #ffe5e5;
    color: #a10000;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 14px;
}

.msg-sucesso {
    background: #e6ffe6;
    color: #006600;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 14px;
}


.input-erro {
    border: 2px solid #d93025 !important;
    background-color: #ffecec;
}

.recaptcha-erro {
    border: 2px solid #d93025 !important;
    padding: 5px;
    border-radius: 4px;
    background: #ffecec;
}

/* Container do campo de data */
.campo-date {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center; /* Centraliza o INPUT */
    align-items: center;
}

/* Input da data */
.campo-date .date-input {
    width: min(360px, 88%);
    text-align: center;               /* CENTRALIZA o valor */
    -webkit-appearance: none;         /* Necessário no Android */
    appearance: none;                 /* Remove estilo nativo */
    padding-left: 12px;
    padding-right: 30px;              /* espaço pro ícone, se quiser usar depois */
}

/* Placeholder flutuante — permanece alinhado como antes! */
.placeholder-date {
    position: absolute;
    left: 45px; /* Mantém alinhado como os outros placeholders */
    top: 50%;
    transform: translateY(-50%);
    color: #A9B5BD;
    pointer-events: none;
    transition: 0.2s ease-in-out;
    background: white;
    padding: 0 4px;
    white-space: nowrap;
    z-index: 5;
}

/* Placeholder flutua */
.date-input.focused + .placeholder-date,
.date-input.filled + .placeholder-date {
    top: -8px;
    left: 38px;
    font-size: 11px;
    color: #555;
    transform: none;
    background: white;

}

/* ===========================================
   RESULTADOS - PACIENTES
=========================================== */

.container-full {
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Cabeçalho */
.result-header {
    text-align: center;
    margin-bottom: 25px;
    position: relative;
}

.result-header img {
    width: 240px;
    margin-bottom: 20px;
}

.result-user {
    margin-bottom: 15px;
}

.user-name {
    font-size: 22px;
    font-weight: 600;
    color: #0a3b5a;
}

.paciente-inline {
    display: flex;
    flex-direction: column;
    align-items: center;     /* alinha pelo texto */
    gap: 6px;
    background: rgba(255,255,255,0.85);
    padding: 14px 18px;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    max-width: 600px;
    margin: 0 auto;
}

.result-info {
    margin-top: 12px;
    font-size: 13.5px;
    color: #555;
    line-height: 1.4;
}

.result-info a {
    color: #0A7EC3;
    font-weight: 600;
    text-decoration: none;
}

.result-info a:hover {
    text-decoration: underline;
}

/* Ajuste do botão sair */
.result-header {
    position: relative;
}

/* Botão sair */
.btn-sair {
    position: absolute;     /* move para o canto da área */
    top: 20px;              /* sobe */
    right: 20px;            /* alinha à direita */

    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;

    background: #0A7EC3;
    border-radius: 14px;
    color: #fff !important;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid transparent;
    transition: 0.25s ease;
}

.btn-sair:hover {
    background: #fff;
    color: #0A7EC3 !important;
    border-color: #0A7EC3;
    transform: translateY(-2px);
}


/* Títulos de seção */
.secao-titulo {
    margin-top: 40px;
    margin-bottom: 12px;
    text-align: center;
    color: #0a3b5a;
    font-weight: 600;
}

/* TABELAS */
.tabela-wrapper {
    width: 100%;
    overflow-x: auto;
}

.tabela {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    table-layout: fixed; /* ajuda a quebrar texto */
    word-break: break-word;
}

.tabela thead {
    background: #0F7DBF;
    color: #fff;
}

.tabela th,
.tabela td {
    padding: 14px;
    text-align: center;
    font-size: 15px;
}

.tabela tbody tr:nth-child(even) {
    background: #f1f7ff;
}

.tabela tbody tr:nth-child(odd) {
    background: #ffffff;
}

.tabela td img {
    width: 22px;
    opacity: 0.9;
    transition: 0.2s ease;
}

.tabela td img:hover {
    opacity: 1;
    transform: scale(1.1);
}

@media (min-width: 768px) {
    .tabela {
        min-width: 700px;
    }
}
/* MOBILE */
@media (max-width: 600px) {

    .result-header img {
        width: 180px;
    }

    .result-info {
        font-size: 16px; /* ou 17px */
        line-height: 1.4;
    }

    /* Header vira relativo para podermos posicionar o botão Sair */
    .result-header {
        position: relative;      /* ADICIONADO */
        text-align: center;
        display: block;          /* REMOVE o flex que criamos antes */
    }

    /* Botão SAIR no canto superior direito — versão mobile */
    .btn-sair {
        position: absolute;      /* AGORA ABSOLUTO NO MOBILE */
        top: 110px;
        right: 3px;
        padding: 6px 14px;
        font-size: 14px;
        border-radius: 6px;
        margin: 0;
        width: auto;
        max-width: none;
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    /* Botão CANCELAR mantém sua posição no fluxo normal */
    .botao-cancela {
        margin-top: 6px;        /* ajuste fino para não encostar no texto */
        width: 100%;
        max-width: 320px;
    }

    .tabela thead {
        display: none;
    }

    .tabela tbody tr {
        display: block;
        word-wrap: break-word;
        overflow-wrap: break-word;
        background: none;
        border: none;
        box-shadow: none;
        padding: 12px 4px;
        margin-bottom: 4px;
    }

    .tabela tbody tr td {
        display: block;
        text-align: left;
        padding: 8px 0;
        font-size: 18px;
    }

    .tabela tbody tr td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #0a3b5a;
        display: block;
        margin-bottom: 2px;
        font-size: 18px;
    }

    .tabela tbody tr td span {
        display: block;
        margin-left: 14px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        font-size: 18px;
    }

    .tabela tbody tr td form {
        margin-left: 14px;
        margin-top: 6px;
    }

    .btn-visualizar i {
        font-size: 2em;
        padding: 6px;
    }

    .btn-visualizar {
        padding: 8px;
        font-size: 18px;
    }
    .secao-titulo {
        margin-top: 8px;
    }
    .placeholder-date {
        left: 32px;
    }
    
    .user-name {
        font-size: 18px;
        line-height: 1.25;
        max-width: 100%;
    }
}


.btn-visualizar {
    background: none;   /* remove fundo */
    border: none;       /* remove borda */
    padding: 0;         /* remove padding padrão */
    margin: 0;
    cursor: pointer;
}

.btn-visualizar i {
    color: #0F7DBF;
    font-size: 1.3em;
    transition: transform 0.2s, color 0.2s;
}

.btn-visualizar:hover i {
    transform: scale(1.2);
    color: #094d80;
}


.visualizar-icone {
    color: #0F7DBF;      /* cor azul */
    font-size: 1.5em;     /* tamanho maior */
    transition: transform 0.2s; /* animação suave */
}

.visualizar-icone:hover {
    transform: scale(1.2); /* aumenta ao passar o mouse */
    color: #094d80;        /* muda cor ao passar o mouse */
    cursor: pointer;       /* muda cursor */
}

/* Alinhamento central do bloco */
.alinhado-centro {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;       /* CENTRALIZA tudo */
    gap: 18px;
    margin-top: 20px;
}

/* Grupo do campo */
.campo-form {
    display: flex;
    flex-direction: column;
    text-align: left;
    width: 100%;
    max-width: 360px;          /* mesmo padrão da tela de login */
}

/* Input com o mesmo estilo da segunda tela */
.input-estiloso {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 10px;
    border: 1px solid rgba(9,107,165,0.20);
    background: #fff;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6),
                0 6px 16px rgba(0,0,0,0.05);
    transition: box-shadow 0.18s ease, border-color 0.15s ease, transform 0.12s ease;
    color: #0a3b5a;
    outline: none;
}

.input-estiloso::placeholder {
    color: rgba(10,47,66,0.35);
}

/* Foco igual ao login */
.input-estiloso:focus {
    border-color: rgba(10,126,195,0.95);
    box-shadow: 0 10px 22px rgba(9,107,165,0.15);
    transform: translateY(-2px);
}

/* Botão Pesquisar centralizado e estilizado */
.pesquisar-btn {
    margin-top: 10px;
    width: min(260px, 80%);
}

/* Alinha CPF e Data de Nascimento lado a lado */
.form-horizontal .linha-campos {
    width: 100%;
    max-width: 760px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
}

/* Cada campo mantém sua largura */
.linha-campos .campo-form {
    width: 100%;
    max-width: 340px;
}

/* No mobile, os campos ficam empilhados verticalmente */
@media (max-width: 600px) {
    .form-horizontal .linha-campos {
        flex-direction: column;
        gap: 16px;
    }
}

/* Centraliza o bloco do formulário dentro da tabela-wrapper */
.tabela-wrapper form.form-horizontal {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Garante que a linha dos campos fique no centro da tela */
.form-horizontal .linha-campos {
    margin-left: auto;
    margin-right: auto;
}
