/* ============================================================
   ExpLing — Folha de estilos principal
   Princípios: sem animações, alto contraste, fundo neutro,
   foco total na atenção do participante
   ============================================================ */

/* --- Reset & base ----------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  animation: none !important;
  transition: none !important;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  color: #1a1a1a;
  background: #f0f0f0;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Tipografia -------------------------------------------- */
h1, h2, h3 {
  line-height: 1.25;
  color: #1a1a1a;
  font-weight: 700;
}
h1 { font-size: clamp(1.5rem, 4vw, 2rem); }
h2 { font-size: clamp(1.2rem, 3vw, 1.5rem); }

a {
  color: #1c4f9c;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* --- Layout ----------------------------------------------- */
.container {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  flex: 1;
  padding: 2.5rem 0;
}

/* --- Cabeçalho -------------------------------------------- */
.site-header {
  background: #ffffff;
  border-bottom: 3px solid #1c4f9c;
  padding: 0.75rem 1.5rem;
}
.site-header a {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1c4f9c;
}

/* --- Card / formulário ------------------------------------ */
.card {
  background: #ffffff;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  padding: 2rem 2.5rem;
  max-width: 480px;
  margin: 0 auto;
}
.card h2 {
  margin-bottom: 1.75rem;
  text-align: center;
  color: #1c4f9c;
  font-size: 1.4rem;
}

.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #333;
  letter-spacing: 0.01em;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
  display: block;
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-size: 1rem;
  font-family: inherit;
  color: #1a1a1a;
  background: #ffffff;
  border: 1.5px solid #b0b0b0;
  border-radius: 4px;
  outline: none;
}
.form-group input:focus {
  border-color: #1c4f9c;
  box-shadow: 0 0 0 3px rgba(28, 79, 156, 0.12);
}

.form-actions {
  margin-top: 1.75rem;
}

/* --- Botões ----------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  text-align: center;
  text-decoration: none;
  line-height: 1.4;
}
.btn-primary {
  background: #1c4f9c;
  border-color: #1c4f9c;
  color: #ffffff;
  width: 100%;
}
.btn-primary:hover {
  background: #163e7a;
  border-color: #163e7a;
  text-decoration: none;
}
.btn-secondary {
  background: transparent;
  border-color: #1c4f9c;
  color: #1c4f9c;
}
.btn-secondary:hover {
  background: #eef3fc;
  text-decoration: none;
}

/* --- Mensagens de feedback -------------------------------- */
.msg {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-top: 1rem;
  font-weight: 600;
  font-size: 0.9rem;
}
.msg-error {
  background: #fdf0f0;
  border: 1px solid #dda0a0;
  color: #a00020;
}
.msg-success {
  background: #f0fdf4;
  border: 1px solid #90c890;
  color: #1a5530;
}

/* --- Rodapé ----------------------------------------------- */
.site-footer {
  background: #1a1a1a;
  color: #b0b0b0;
  text-align: center;
  padding: 1rem 1.5rem;
  font-size: 0.82rem;
  margin-top: auto;
}
.site-footer a {
  color: #909090;
}
.site-footer a:hover {
  color: #cccccc;
  text-decoration: none;
}
.site-footer img {
  vertical-align: middle;
  width: 18px;
  height: 18px;
  margin-left: 0.4rem;
}

/* --- Página de landing (index.html) ----------------------- */
.hero {
  background: #ffffff;
  border-bottom: 1px solid #d8d8d8;
  padding: 2.5rem 1.5rem;
  text-align: center;
}
.hero h1 {
  color: #1c4f9c;
  margin-bottom: 0.75rem;
}
.hero p {
  color: #444;
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
.hero-actions .btn {
  width: auto;
  min-width: 180px;
}

.section {
  padding: 2.5rem 0;
  border-bottom: 1px solid #d8d8d8;
}
.section:last-of-type {
  border-bottom: none;
}
.section h2 {
  text-align: center;
  color: #1c4f9c;
  margin-bottom: 1.5rem;
}

.media-embed {
  text-align: center;
}
.media-embed iframe {
  max-width: 100%;
  border: none;
}
.media-caption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #555;
  line-height: 1.6;
}

/* --- Página do experimento -------------------------------- */
/* Fundo escuro é intencional: reduz distrações visuais */
body.experiment-page {
  background: #1e1e1e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.5rem 1rem;
  min-height: 100vh;
}
.experiment-chrome {
  width: 100%;
  max-width: 820px;
}

/* Barra de progresso */
#progressBarDiv {
  background: #3a3a3a;
  height: 6px;
  border-radius: 3px;
  margin-bottom: 1rem;
  overflow: hidden;
}
#progress {
  background: #4a7fd4;
  height: 100%;
  border-radius: 3px;
  float: none;
}

/* Área do experimento: tamanho fixo por design
   (os experimentos são criados com coordenadas absolutas) */
.experiment-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
#experimentScreen {
  background: #ffffff;
  position: relative;
  width: 800px;
  height: 400px;
  border: 1px solid #000000;
  margin: 0;
  overflow: hidden;
}

/* Elementos do experimento (gerados pelo JS) */
.element {
  position: absolute;
  margin: 0;
  word-wrap: break-word;
}
.mustFill {
  border-left: 2px solid #cc0000;
  border-right: 2px solid #cc0000;
  border-radius: 4px;
  padding: 2px 4px;
}

#alerts {
  color: #ff8080;
  font-weight: 600;
  font-size: 0.9rem;
  min-height: 1.5rem;
  padding: 0.5rem 0;
  text-align: center;
}
.experiment-end-link {
  display: block;
  text-align: right;
  color: #666;
  font-size: 0.8rem;
  margin-top: 0.4rem;
}
.experiment-end-link:hover {
  color: #999;
  text-decoration: none;
}

/* --- Responsivo ------------------------------------------- */
@media (max-width: 600px) {
  .card {
    padding: 1.5rem 1.25rem;
    border-left: none;
    border-right: none;
    border-radius: 0;
    max-width: 100%;
  }
  .hero {
    padding: 1.75rem 1rem;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .section {
    padding: 1.75rem 0;
  }
}

@media (max-width: 860px) {
  .experiment-scroll-wrapper {
    margin: 0 -1rem;
    padding: 0 1rem;
  }
}
