* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; min-height: 100dvh; }
body { 
  background: #0a2a1f; 
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
  padding: 15px; 
  color: #2d3748;
}

/* Container Principal Responsivo */
.container { 
  max-width: 1300px; 
  width: 100%; 
  margin: 0 auto; 
  background: #fffaf0; 
  border-radius: 28px; 
  overflow: hidden; 
  box-shadow: 0 15px 35px rgba(0,0,0,0.3); 
}

/* Cabeçalho e Abas */
.header { 
  background: #2a5e48; 
  padding: 15px 20px; 
  color: white; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  flex-wrap: wrap; 
  gap: 10px;
}
.tab-bar { 
  background: #2a5e48; 
  display: flex; 
  gap: 6px; 
  padding: 0 15px; 
  overflow-x: auto; 
  white-space: nowrap; 
  -webkit-overflow-scrolling: touch;
}
.tab-btn { 
  background: #cddfb0; 
  border: none; 
  padding: 10px 18px; 
  border-radius: 20px 20px 0 0; 
  font-weight: bold; 
  cursor: pointer; 
  font-size: 14px;
  touch-action: manipulation;
}
.tab-btn.active { background: #fffaf0; color: #1d6b4a; }

/* Conteúdos das Abas */
.tab-content { display: none; padding: 20px; }
.tab-content.active { display: block; }
.sub-tab-bar { 
  display: flex; 
  gap: 8px; 
  margin-bottom: 20px; 
  border-bottom: 2px solid #eedbba; 
  padding-bottom: 10px; 
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.sub-tab-btn { 
  background: #e0cfaa; 
  border: none; 
  padding: 8px 16px; 
  border-radius: 25px; 
  font-weight: bold; 
  cursor: pointer; 
  font-size: 13px;
  white-space: nowrap;
}
.sub-tab-btn.active { background: #f5a623; color: white; }
.sub-tab-content { display: none; }
.sub-tab-content.active { display: block; }

/* Cards e Linhas de Formulário */
.card { 
  background: white; 
  border-radius: 22px; 
  padding: 20px; 
  margin-bottom: 20px; 
  border: 1px solid #eedbba; 
  width: 100%;
}
.form-row { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 10px; 
  margin-bottom: 15px; 
  align-items: center; 
  width: 100%;
}
.form-row label { 
  min-width: 120px; 
  flex: 1 1 120px; 
  font-weight: 600; 
  color: #205e45; 
  font-size: 14px;
}
.form-row input, .form-row select, .form-row textarea { 
  flex: 2 1 220px; 
  width: 100%;
  padding: 12px 16px; 
  border-radius: 25px; 
  border: 1px solid #dac98b; 
  background: #fffcf5; 
  font-size: 14px;
  outline: none;
}

/* Botões */
button { 
  background: #f5a623; 
  border: none; 
  padding: 12px 22px; 
  border-radius: 30px; 
  font-weight: bold; 
  cursor: pointer; 
  margin: 4px; 
  font-size: 14px;
  touch-action: manipulation;
  transition: opacity 0.2s, transform 0.1s;
}
button:active { transform: scale(0.98); }

.atividade-item { 
  background: #e9f5e9; 
  border-radius: 20px; 
  padding: 16px; 
  margin-bottom: 15px; 
  border: 1px solid #c7d4b0; 
  word-break: break-word;
}

/* Show de TV e Cortina */
.cortina-container { 
  width: 100%; 
  max-height: 280px; 
  overflow: hidden; 
  border-radius: 18px; 
  background: #000; 
  margin: 15px 0; 
  position: relative; 
  display: flex;
  align-items: center;
  justify-content: center;
}
.cortina-container video { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
}
.vinheta { 
  background: linear-gradient(135deg, #f5a623, #e74c3c); 
  display: inline-block; 
  padding: 8px 20px; 
  border-radius: 30px; 
  color: white; 
  font-weight: bold; 
  font-size: 18px; 
  margin: 10px 0; 
  animation: pulse 0.8s infinite alternate; 
}
@keyframes pulse { from { transform: scale(1); opacity: 0.85; } to { transform: scale(1.03); opacity: 1; } }

/* Cards de Questões */
.question-card { 
  background: #fffaf0; 
  border-radius: 20px; 
  padding: 18px; 
  margin-top: 15px; 
  border: 1px solid #eedbba; 
  width: 100%;
}
.alternativa { 
  display: block; 
  width: 100%; 
  margin: 10px 0; 
  background: #ecdcaa; 
  border: 2px solid #c7a86a; 
  padding: 12px 16px; 
  border-radius: 30px; 
  font-weight: bold; 
  cursor: pointer; 
  text-align: left; 
  font-size: 14px;
  touch-action: manipulation;
}
.pontuacao { 
  background: #f5a623; 
  display: inline-block; 
  padding: 6px 18px; 
  border-radius: 30px; 
  font-weight: bold; 
  font-size: 16px; 
  margin-bottom: 15px; 
}

/* Autenticação */
.auth-container { 
  max-width: 480px; 
  width: 100%; 
  margin: 20px auto; 
  background: #fffaf0; 
  border-radius: 30px; 
  padding: 25px; 
  text-align: center; 
}
.logo-area { display: flex; justify-content: center; gap: 15px; margin-bottom: 18px; flex-wrap: wrap; }
.logo-area img { height: 45px; object-fit: contain; }
.auth-container input, .auth-container select { 
  width: 100%; 
  padding: 12px 15px; 
  margin: 8px 0; 
  border-radius: 30px; 
  border: 1px solid #dac98b; 
}
.institutional-text { font-size: 12px; color: #444; margin-top: 20px; padding-top: 15px; border-top: 1px solid #e0cfaa; text-align: left; }

/* Adaptação Mobile PWA */
@media (max-width: 600px) {
  body { padding: 8px; }
  .container { border-radius: 16px; }
  .header { padding: 12px 15px; flex-direction: column; align-items: flex-start; }
  .tab-content { padding: 15px 10px; }
  .card { padding: 15px; border-radius: 16px; }
  .form-row label { width: 100%; flex: 1 1 100%; margin-bottom: -4px; }
  .form-row input, .form-row select, .form-row textarea { flex: 1 1 100%; width: 100%; }
  button { width: 100%; margin: 6px 0; }
  .cortina-container { max-height: 200px; }
}