 /* Modo Claro */
:root {
  --bg: #f9fafb;     
  --text: #1f2937;   
  --primary: #4338ca;  
  --secondary: #ffffff;  
  --accent: #06b6d4;  
}

 /* Modo Escuro */
[data-tema="dark"] {
  --bg: #0f172a;      
  --text: #f3f4f6;    
  --primary: #818cf8;  
  --secondary: #1e293b;  
  --accent: #06b6d4;  
}

/* Reset e base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.3s ease, color 0.3s ease;
  animation: fadeIn 0.4s ease-in-out;
}

/*  Container */
.container {
  max-width: 960px;
  margin: auto;
  padding: 2rem;
}

/* Estrutura */
header,
.intro,
section,
footer,
input,
textarea,
select {
  transition: background-color 0.3s ease, color 0.3s ease, border 0.3s ease;
}

/*  Header */
header {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  text-align: center;
  padding: 2rem 1rem;
  border-bottom: 4px solid var(--accent);
}

/* Intro */
.intro {
  background-color: var(--secondary);
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
  border-left: 6px solid var(--accent);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.intro h1 {
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.intro p {
  margin-bottom: 0.5rem;
  line-height: 1.6;
  font-weight: 600;
}

/* Sections */
section {
  background-color: var(--secondary);
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  margin: 2rem 0;
  border-left: 6px solid transparent;
  transition: border-left 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
  border-left: 6px solid var(--primary);
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.2); /* opcional: um glow leve */
}


/* Títulos */
h2 {
  margin-bottom: 1rem;
  color: var(--primary);
}

/* Formulários */
input,
textarea,
select,
button {
  width: 100%;
  padding: 1rem;
  margin-top: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s ease-in-out;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.2);
}

/* Botões */
button {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-weight: 600;
  padding: 0.9rem 1.2rem;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  margin-top: 1rem;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
  transition: background-color 0.3s ease, color 0.3s ease, border 0.3s ease;
}

button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transition: left 0.4s ease;
}

button:hover::before {
  left: 100%;
}

button:hover {
  background: linear-gradient(135deg, var(--accent), var(--primary));
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

button:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

button:focus-visible {
  outline: 2px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.3);
}

/* Tema escuro - botão especial */
[data-tema="dark"] button::before {
  background: rgba(255, 255, 255, 0.08);
}

/* Ações */
.resposta-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* Rodapé */
footer {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-top: 4px solid var(--accent);
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
}

/*  Utilitários */
.oculto {
  display: none;
}

.erro {
  color: red;
  font-weight: bold;
}

#loader {
  font-size: 1.2rem;
  animation: girar 1s linear infinite;
  display: inline-block;
}

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

  100% {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Botão de alternância de tema */
#toggleTema {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 52px;
  height: 52px;
  font-size: 1.7rem;
  border: none;
  border-radius: 50%;
  background-color: var(--secondary);
  color: var(--text);
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

#toggleTema:hover {
  transform: scale(1.15);
  background-color: rgba(6, 182, 212, 0.1);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

[data-tema="dark"] #toggleTema {
  background-color: var(--primary);
  color: var(--text);
  box-shadow: 0 0 12px rgba(129, 140, 248, 0.4);
}

/* Tema Escuro Detalhado */

[data-tema="dark"] header,
[data-tema="dark"] footer {
  background-color: var(--primary);
  color: white;
  border-bottom: 4px solid var(--accent);
}

[data-tema="dark"] section,
[data-tema="dark"] .intro {
  background: rgba(0, 12, 31, 0.8);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 36, 104, 0.6);
}

[data-tema="dark"] section h2 {
  color: var(--accent);
}

[data-tema="dark"] .intro p {
  color: rgba(241, 245, 249, 0.85);
}

[data-tema="dark"] .intro h1 {
  color: var(--accent);
}

[data-tema="dark"] input,
[data-tema="dark"] textarea,
[data-tema="dark"] select {
  background-color: var(--secondary);
  color: var(--text);
  border: 1px solid #475569;
}

[data-tema="dark"] button {
  background: linear-gradient(135deg, var(--accent), var(--primary));
  border: none;
  color: white;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
}

[data-tema="dark"] button:hover {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 0 18px rgba(129, 140, 248, 0.4);
  transform: translateY(-2px);
}

[data-tema="dark"] hr {
  border-color: rgba(255, 255, 255, 0.08);
}

[data-tema="dark"] a {
  color: var(--accent);
  text-decoration: underline;
}

[data-tema="dark"] input::placeholder,
[data-tema="dark"] textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}