/* ============================================
   Fabar.org - Padrão visual unificado
   Aprenda programação brincando
   ============================================ */

/* Reset e base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #e2e8f0;
  padding: 2rem 1rem;
  min-height: 100vh;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

/* Links de voltar */
.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: #7dd3fc;
}

.back-link::before {
  content: "← ";
}

/* Cards principais */
.card {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(4px);
  border-radius: 1.5rem;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 1.5rem;
}

/* Títulos */
h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #a5f3fc, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  font-size: 1.3rem;
  margin: 1.5rem 0 1rem 0;
  color: #cbd5e1;
}

.sub {
  color: #94a3b8;
  margin-bottom: 2rem;
  border-left: 3px solid #38bdf8;
  padding-left: 1rem;
}

/* Rodapé */
footer {
  text-align: center;
  font-size: 0.7rem;
  color: #475569;
  margin-top: 2rem;
  padding: 1rem;
}

/* ============================================
   Componentes da página inicial (index)
   ============================================ */

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #a5f3fc, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}

.tagline {
  color: #94a3b8;
  margin-top: 0.5rem;
  font-size: 1rem;
}

/* Blocos de conteúdo na home */
.home-card {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(4px);
  border-radius: 1.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: 0.2s;
}

.home-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-left: 3px solid #38bdf8;
  padding-left: 0.75rem;
}

/* Grid de ferramentas (home) */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.tool-btn {
  background: #0f172a;
  border: 1px solid #334155;
  color: #f1f5f9;
  padding: 0.75rem;
  border-radius: 1rem;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
  cursor: pointer;
}

.tool-btn:hover {
  background: #1e293b;
  border-color: #38bdf8;
  transform: translateY(-2px);
}

/* Lista de artigos (home) */
.article-list {
  list-style: none;
}

.article-list li {
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #334155;
  padding-bottom: 0.5rem;
}

.article-list a {
  color: #b9e0f2;
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.article-list a:hover {
  color: #7dd3fc;
}

.badge-time {
  font-size: 0.7rem;
  background: #334155;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  color: #cbd5e1;
}

/* Dica de segurança (home) */
.security-tip {
  background: #0f172a;
  border-radius: 1rem;
  padding: 1rem;
  font-style: italic;
  border-left: 4px solid #f97316;
}

/* Cursos afiliados (home) */
.courses {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.course-link {
  background: #0f172a;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  text-decoration: none;
  color: #facc15;
  border: 1px solid #facc1540;
  font-size: 0.85rem;
  transition: 0.2s;
}

.course-link:hover {
  background: #facc1520;
}

/* Redes sociais (home) */
.social {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.social a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
}

.social a:hover {
  color: white;
}

/* ============================================
   Componentes para ferramentas (tools)
   ============================================ */

/* Box de desafio/ferramenta */
.tool-box {
  background: #0f172a;
  border-radius: 1rem;
  padding: 1.5rem;
  margin: 1.5rem 0;
  border: 1px solid #334155;
}

.tool-text {
  font-size: 1.2rem;
  color: #facc15;
  margin-bottom: 1rem;
  font-weight: 500;
}

/* Formulários e inputs */
label {
  font-size: 0.8rem;
  color: #94a3b8;
  display: block;
  margin-bottom: 0.5rem;
}

textarea, input[type="text"], input[type="number"] {
  width: 100%;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 0.75rem;
  padding: 0.75rem;
  color: #e2e8f0;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  resize: vertical;
}

textarea:focus, input:focus {
  outline: none;
  border-color: #38bdf8;
}

/* Grupos de botões */
.button-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

button {
  background: #334155;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 2rem;
  color: white;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

button:hover {
  background: #475569;
  transform: translateY(-1px);
}

.btn-primary {
  background: #38bdf8;
  color: #0f172a;
  font-weight: 600;
}

.btn-primary:hover {
  background: #7dd3fc;
}

/* Feedback de correção */
.feedback {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 0.75rem;
  display: none;
}

.feedback.correto {
  background: #16653440;
  border-left: 4px solid #22c55e;
  display: block;
  color: #bbf7d0;
}

.feedback.errado {
  background: #7f1d1d40;
  border-left: 4px solid #ef4444;
  display: block;
  color: #fecaca;
}

/* Solução exemplo */
.solucao-exemplo {
  margin-top: 1rem;
  padding: 1rem;
  background: #1e293b;
  border-radius: 0.75rem;
  font-size: 0.85rem;
  font-family: monospace;
  display: none;
}

/* Divisor */
hr {
  border-color: #334155;
  margin: 1.5rem 0;
}

/* Utilitários */
.text-center {
  text-align: center;
}

.text-small {
  font-size: 0.75rem;
  color: #64748b;
}

.mt-2 {
  margin-top: 1rem;
}