/* Estilo do corpo da página */
body {
    font-family: Arial, sans-serif; /* Define a fonte padrão */
    max-width: 100%; /* Remove limitação para acomodar quadros grandes */
    margin: 20px auto; /* Margem de 20px em cima/baixo e centraliza horizontalmente */
    padding: 20px; /* Espaçamento interno de 20px */
    background-color: #ccffcc; /* Cor de fundo verde claro */
    text-align: center; /* Centraliza todos os elementos */
}

/* Estilo do logo SΨM */
.logo {
    font-size: 48px; /* Tamanho da fonte grande para o logo */
    margin-bottom: 10px; /* Espaço abaixo do logo */
}

/* Estilo para as letras do logo */
.logo span {
    font-weight: bold; /* Deixa as letras em negrito */
}

/* Cor vermelha para a letra S */
.s {
    color: red; /* Define cor vermelha */
}

/* Cor azul para a letra Ψ (psi) */
.psi {
    color: blue; /* Define cor azul */
}

/* Cor cinza para a letra M */
.m {
    color: grey; /* Define cor cinza */
}



/* Centralização do logo */
.logo {
    text-align: center; /* Centraliza o texto do logo */
    margin-bottom: 20px; /* Espaço abaixo do logo */
}

/* Estilo para imagens dentro do logo */
.logo img {
    max-width: 200px; /* Largura máxima da imagem */
    height: auto; /* Altura automática para manter proporção */
}

/* Estilo do título principal */
h1 {
    text-align: center; /* Centraliza o título */
    color: #333; /* Cor cinza escuro */
    margin-bottom: 30px; /* Espaço abaixo do título */
}
.container:first-child {
    background-color: rgb(186, 196, 192);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 20px;
    margin: 20px auto;
    max-width: 50%
}

#telaFormulario {
    background-color: rgb(186, 196, 192);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 20px auto;
    max-width: 50%;
}
/* Grupo de campos do formulário */
.form-group {
    margin-bottom: 10px;
}

/* Estilo dos rótulos (labels) */
label {
    display: block; /* Exibe como bloco (uma linha inteira) */
    margin-bottom: 5px; /* Pequeno espaço abaixo do rótulo */
    font-weight: bold; /* Texto em negrito */
    color: #555; /* Cor cinza médio */
}

/* Estilo dos campos de entrada */
input, select, textarea {
    width: 80%;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
    margin: 0 auto;
    display: block;
}

input#nome, textarea#hipoteseDiagnostica {
    width: 90%;
}

input#cpf {
    width: 40%;
}

input#dataNascimento {
    width: 40%;
}

input#idTeste {
    width: 40%;
}

input#telefone {
    width: 40%;
}

input#crp {
    width: 40%;
}

select#escolaridade, select#lateralidade {
    width: 50%;
}

input#profissao {
    width: 60%;
}

input#nomePsicologo {
    width: 60%;
}

input#email {
    width: 60%;
}

/* Estilo quando o campo está em foco (selecionado) */
input:focus, select:focus, textarea:focus {
    border-color: #4CAF50; /* Borda verde quando focado */
    outline: none; /* Remove o contorno padrão do navegador */
}

/* Estilo da exibição da idade calculada */
.idade-display {
    background-color: #e8f5e8; /* Fundo verde muito claro */
    padding: 10px; /* Espaçamento interno */
    border-radius: 5px; /* Bordas arredondadas */
    margin-top: 5px; /* Espaço acima */
    font-weight: bold; /* Texto em negrito */
    color: #2e7d32; /* Cor verde escuro */
}

/* Container dos botões de sexo */
.sexo-container { 
    display: flex; /* Layout flexível */
    flex-direction: column; /* Organiza em coluna */
    gap: 2px; /* Espaço entre os itens */
    margin: 5px auto;
    width: 100%; /* Largura total disponível */
}

/* Grupo de botões radio */
.radio-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 3px auto;
    width: auto;
}

/* Estilo específico para botões radio */
.radio-group input[type="radio"] {
    width: auto;
    margin-right: 5px;
}

.radio-group label {
    display: inline;
    font-weight: normal;
    margin-bottom: 0;
}

/* Campo de gênero específico (inicialmente oculto) */
.genero-input {
    margin-top: 5px;
    display: none;
    width: 50%;
    padding: 5px;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
    margin: 5px auto;
    gap: 5px;
}

/* Estilo dos botões prncipais */
.botao-iniciar {
  display: block;
  width: 200px;
  margin: 20px auto;
  padding: 10px;
  background-color: #00527c;
  color: white;
  border: 2px solid #f3d863;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
}

/* Estilo do botão quando o mouse passa sobre ele */
.botao-iniciar:hover {
    background-color: #85c1ed; /* Verde mais escuro no hover */
}

/* Centralização do canvas do teste de atenção concentrada */
#quadroConcentrada {
    display: flex; /* Usa layout flexível para centralização precisa */
    justify-content: center; /* Centraliza o canvas horizontalmente */
    align-items: center; /* Centraliza o canvas verticalmente */
    margin: 0; /* Sem margem quando fullscreen */
    width: 100%; /* Ocupa toda a largura disponível do container */
    height: 100%; /* Ocupa toda a altura disponível */
    min-height: 50px; /* Altura mínima para garantir espaço */
    background-color: #1a1a2e; /* Fundo escuro igual ao canvas */
    overflow: hidden;
}
#telaParabens { 
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: absolute; 
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 300px;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  color: white;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  z-index: 1000;
  text-align: center;
  opacity: 0; /* Inicia invisível para transição */
}

#telaParabens .parabens-emoji {
  font-size: 48px;
  margin-bottom: 20px;
}

#telaParabens h2 {
  margin: 0 0 15px 0;
  font-size: 28px;
}

#telaParabens p {
  font-size: 18px;
  margin: 15px 0;
}

#telaParabens .stats-container {
  background-color: rgba(255,255,255,0.2);
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
}

#telaParabens .emoji {
  font-size: 24px;
  margin-bottom: 15px;
}

#telaParabens .desempenho {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 10px;
}

#telaParabens .stats {
  display: flex;
  justify-content: space-around;
  margin-top: 15px;
}

#telaParabens .stat-value {
  font-size: 18px;
  font-weight: bold;
}

#telaParabens .stat-label {
  font-size: 14px;
  opacity: 0.8;
}

#telaParabens .proximo-desafio {
  font-size: 16px;
  margin: 15px 0;
  opacity: 0.9;
}

#telaParabens .desafio-emoji {
  font-size: 32px;
  margin-top: 20px;
}

#quadroSeletiva {
  width: 100%;
  height: 100%;
  background-color: black;
  border: none;
  border-radius: 0;
  margin: 0;
  position: relative;
  z-index: 1;
  display: block;
}
#quadroSeletiva #animal {
  position: absolute;
  width: 76px;
  height: 76px;
  z-index: 10; /* Acima da moldura */
  display: block;
}


#figura1,
#figura2 {
width: 1.5cm;
height: 1.5cm;
display: inline-block;
vertical-align: middle;
margin: 0 10px;
}

 
/* ===== ESTILOS DO TESTE DE ATENÇÃO DIVIDIDA ===== */

#testeDividida {
    display: none; /* Inicialmente oculto */
    width: 100%;
    height: 100%;
    position: relative;
    text-align: center;
}



/* Instruções dinâmicas do teste dividida */
.instrucoes-dividida {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    text-align: center;
    font-family: Arial, sans-serif;
}

.instrucoes-titulo {
    font-size: 28px;
    margin-bottom: 30px;
    color: #FFD700;
}

.instrucoes-conteudo {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 25px;
}

.alvos-container {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

.tecla-espaco {
    background: #28a745;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
}

.tecla-enter {
    background: #007BFF;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
}

.iniciar-prompt {
    font-size: 20px;
    font-weight: bold;
    color: #e9dfda;
    animation: pulse 2s infinite;
    margin-top: -1.2cm;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* === FAMILIARIZAÇÃO SONORA (COPIADA E ADAPTADA) === */
.familiarizacao-container {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    border: 2px dashed rgba(255,255,255,0.3);
}

.botoes-som {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.botao-som {
    padding: 10px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.botao-som:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.botao-som-alvo {
    background-color: #e74c3c;
    animation: pulse-alvo 2s infinite;
}

.botao-som-alvo:hover {
    background-color: #c0392b;
}

@keyframes pulse-alvo {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

/* Triângulo de exemplo nas instruções (mesmo tamanho do teste) */
.triangulo-exemplo {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-bottom: 43px solid white;
    vertical-align: middle;
    margin-right: 10px;
}

/* === CONTAGEM REGRESSIVA (MOVIDO DO JS) === */
.contagem-regressiva {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 400px;
    font-size: 96px;
    font-weight: bold;
    color: #2c3e50;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.4);
}

.contagem-numero {
    transition: transform 0.3s ease-in-out, color 0.3s ease;
    font-family: "Comic Sans MS", cursive, sans-serif;
}

.contagem-texto {
    font-size: 28px;
    margin-top: 20px;
    color: #34495e;
    font-weight: normal;
}

/* === TELA DE PARABÉNS (MOVIDO DO JS) === */
.parabens-dividida {
    display: block;
    text-align: center;
    margin: 30px auto;
    max-width: 600px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
/* Quadro principal do teste dividida - fullscreen quando ativo */
#quadroDividida {
    width: 100%;
    height: 100%;
    background-color: black;
    border: none;
    border-radius: 0;
    margin: 0;
    position: relative;
    z-index: 1;
    display: block;
}

/* Container das figuras que aparecem no teste */
#figuraDiv {
    position: absolute;           /* Posicionamento livre dentro do quadro */
    width: 60px;                  /* Largura fixa das figuras */
    height: 60px;                 /* Altura fixa das figuras */
    z-index: 10;                  /* Acima do quadro preto */
}

/* Painel de familiarização com os sons */
#painelSons {
    display: flex;                /* Layout flexível horizontal */
    justify-content: center;      /* Centraliza botões */
    gap: 20px;                    /* Espaço entre botões */
    margin: 20px 0;               /* Margem vertical */
    padding: 20px;                /* Espaçamento interno */
    background-color: rgba(255,255,255,0.1); /* Fundo semi-transparente */
    border-radius: 10px;          /* Bordas arredondadas */
}

/* Botões para testar sons antes do teste */
.botao-som {
    padding: 10px 20px;           /* Espaçamento interno */
    background-color: #3498db;    /* Cor azul */
    color: white;                 /* Texto branco */
    border: none;                 /* Sem borda */
    border-radius: 5px;           /* Bordas arredondadas */
    cursor: pointer;              /* Cursor de mão */
    font-size: 14px;              /* Tamanho da fonte */
}

/* Efeito hover nos botões de som */
.botao-som:hover {
    background-color: #2980b9;    /* Azul mais escuro no hover */
}

/*botões especiais*/

/* Esconde botões de navegação do psicólogo (só para desktop presencial) */
.botao-parar, .botao-bypassar, .botao-voltar {
    display: none !important;
}

/* ===== ESTILOS DO TESTE DE ATENÇÃO ALTERNADA (LAYOUT ANTIGO) ===== */

#paginaTesteAlternado {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ccffcc;
    margin: 0;
    padding: 0;
    z-index: 100;
    display: none;
    text-align: center;
    overflow-y: auto;
}

/* Quadro alternada - centralizado na tela */
#quadroAlternado {
    width: 50vw;
    height: 60vh;
    margin: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5vw;
}

#figuraEsquerda, #figuraDireita {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ===== ESTILOS DO TESTE DE ATENÇÃO SUSTENTADA ===== */

#testeSustentada {
    display: none;
    text-align: center;
}

/* Quadro sustentada - fullscreen quando ativo */
#quadroSustentada {
    width: 100%;
    height: 100%;
    background-color: black;
    border: none;
    border-radius: 0;
    margin: 0;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.estimulo {
    position: absolute;
    z-index: 10;
}


/* ===== RESPONSIVO MOBILE/TABLET ===== */
@media (max-width: 1024px) {
    body { padding: 10px; margin: 10px auto; }
    #telaFormulario, .container:first-child { max-width: 95%; }
    #quadroSeletiva, #quadroDividida, #quadroSustentada {
        width: 95vw; height: 70vw; max-width: 20cm; max-height: 15cm;
        overflow: hidden;
    }
    #quadroAlternado { width: 90vw; max-width: 7cm; height: auto; min-height: 3cm; }
    canvas { max-width: 95vw !important; }
    .botao-parar, .botao-bypassar, .botao-voltar {
        left: -9999px !important;
    }
}

@media (max-width: 768px) {
    body { padding: 0; margin: 0 auto; font-size: 14px; box-sizing: border-box; overflow-x: hidden; }
    h1 { font-size: 20px; margin-bottom: 15px; }
    #telaFormulario, .container:first-child { max-width: 100%; padding: 10px; margin: 10px auto; }
    .container { margin-left: auto; margin-right: auto; }
    .botao-iniciar { width: 80%; max-width: 300px; font-size: 18px; padding: 15px; margin: 15px auto; }
    #quadroSeletiva, #quadroDividida, #quadroSustentada {
        width: 96vw; height: 72vw; max-width: 100%; margin: 10px auto;
    }
    /* Dividida: permitir overflow para instruções */
    #quadroDividida.instrucoes-ativas { height: auto; max-height: none; overflow: visible; }
    #quadroSeletiva #animal { width: 60px; height: 60px; }
    #quadroAlternado { width: 90vw; height: auto; min-height: 120px; margin: 10px auto; }
    .instrucoes-dividida { height: auto; min-height: 300px; padding: 20px; }
    .botoes-som { flex-direction: column; align-items: center; }
    /* Espaço para botões touch fixos no bottom */
    #testeConcentrada, #testeSeletiva, #testeDividida,
    #paginaTesteAlternado, #testeSustentada { padding-bottom: 120px; }
}

/* ===== CURSOR AUTO-HIDE DURANTE TESTES ===== */
/* Cursor some após 2s parado, reaparece ao mexer */
body.cursor-hidden, body.cursor-hidden * {
    cursor: none !important;
}

/* ===== MODO TELA INTEIRA PARA TESTES (seletiva, dividida, sustentada) ===== */
/* Ativado via JS quando o teste inicia — mede lateralidade do campo visual */
.fullscreen-teste {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    z-index: 500;
}

/* Esconde título e botão iniciar quando o quadro está fullscreen */
.fullscreen-teste ~ h1,
.fullscreen-teste ~ .botao-iniciar,
.teste-fullscreen-ativo h1,
.teste-fullscreen-ativo .botao-iniciar,
.teste-fullscreen-ativo .subtitulo,
.teste-fullscreen-ativo .logo {
    display: none !important;
}

/* Container pai também precisa ocupar tela toda */
.container-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background-color: black !important;
    z-index: 499;
    display: block !important;
}

/* Containers dos testes com quadro preto — ocupam tela toda */
#testeSeletiva, #testeDividida, #testeSustentada {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ccffcc;
    margin: 0;
    padding: 0;
    z-index: 100;
}

/* Concentrada — centraliza conteúdo na tela */
#testeConcentrada {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ccffcc;
    margin: 0;
    padding: 0;
    z-index: 100;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#testeConcentrada h1 {
    color: #333;
    margin-bottom: 20px;
}

#testeSeletiva h1, #testeDividida h1, #testeSustentada .subtitulo,
#testeSeletiva .logo, #testeDividida .logo {
    display: none;
}

/* Touch controls container */
#touch-controls button { touch-action: manipulation; }
