/* ==============================
   BASE Y RESET
============================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background-color: #0a0a0a;
  color: #eaeaea;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ==============================
   CABECERA
============================== */
header {
  background: #111;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
  border-bottom: 2px solid #0f9d58;
  position: sticky;
  top: 0;
  z-index: 1000;
  animation: fadeInDown 1s ease-in-out;
}

.logo {
  font-size: 1.8em;
  font-weight: bold;
  color: #0f9d58;
  animation: glowPulse 3s infinite alternate;
}

.logo span {
  color: #fff;
}

nav a {
  color: #ddd;
  margin-left: 20px;
  text-decoration: none;
  transition: color 0.3s, transform 0.3s;
  font-weight: 500;
}

nav a:hover, nav a.active {
  color: #0f9d58;
  transform: scale(1.1);
}

/* ==============================
   HERO / PORTADA
============================== */
.hero {
  text-align: center;
  padding: 120px 20px;
  background: linear-gradient(270deg, #0f9d58, #0a0a0a, #0f9d58);
  background-size: 400% 400%;
  color: white;
  animation: gradientShift 10s ease infinite;
  position: relative;
  overflow: hidden;
}

.hero h1 {
  font-size: 2.8em;
  margin-bottom: 15px;
  position: relative;
  z-index: 1;
  animation: fadeInUp 1s ease forwards;
}

.hero p {
  color: #ccc;
  font-size: 1.2em;
  margin-bottom: 30px;
  position: relative;
  z-index: 1;
  animation: fadeInUp 1.4s ease forwards;
}

.btn {
  background: #0f9d58;
  color: #fff;
  padding: 12px 25px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
  font-weight: 600;
  display: inline-block;
}

.btn:hover {
  background: #0c7b44;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 0 15px rgba(15, 157, 88, 0.5);
}

/* ==============================
   SECCIONES / MAIN
============================== */
main {
  padding: 60px 40px;
  text-align: center;
}

section {
  margin-bottom: 60px;
  opacity: 0;
  transform: translateY(40px);
  transition: all 1s ease;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

.cards {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.card {
  background: #1a1a1a;
  padding: 25px;
  border: 1px solid #0f9d58;
  border-radius: 10px;
  width: 280px;
  box-shadow: 0 0 15px rgba(15, 157, 88, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 0 25px rgba(15, 157, 88, 0.4);
}

/* ==============================
   FORMULARIOS GENERALES
============================== */
form {
  background: #1a1a1a;
  padding: 25px;
  border-radius: 10px;
  max-width: 420px;
  margin: auto;
  border: 1px solid #0f9d58;
  box-shadow: 0 0 20px rgba(0, 255, 128, 0.1);
  animation: fadeIn 1.5s ease;
}

input, textarea {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  background: #111;
  border: 1px solid #0f9d58;
  color: #fff;
  border-radius: 5px;
  outline: none;
  transition: border 0.3s, box-shadow 0.3s;
}

input:focus, textarea:focus {
  border-color: #1aff95;
  box-shadow: 0 0 10px rgba(26, 255, 149, 0.3);
}

/* ==============================
   OPOSICIONES / QUIZ
============================== */
#quiz-container {
  background: #111;
  padding: 30px;
  border-radius: 12px;
  border: 1px solid #0f9d58;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: 0 0 25px rgba(15, 157, 88, 0.2);
  animation: fadeInUp 1.2s ease;
}

#question {
  font-size: 1.5em;
  font-weight: 600;
  color: #1aff95;
  margin-bottom: 25px;
}

#answers {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#answers .btn {
  background: #222;
  border: 1px solid #0f9d58;
  color: #eaeaea;
  padding: 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
}

#answers .btn:hover {
  background: #0f9d58;
  color: #fff;
}

#answers .btn.correct {
  background: #0f9d58;
  border-color: #00ff99;
}

#answers .btn.incorrect {
  background: #b30000;
  border-color: #ff4d4d;
}

#next-btn {
  background: #0f9d58;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 12px 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 25px;
  transition: all 0.3s;
}

#next-btn:hover {
  background: #0c7b44;
  transform: translateY(-2px);
  box-shadow: 0 0 10px rgba(15, 157, 88, 0.4);
}

#result {
  font-size: 1.2em;
  color: #00ff99;
  margin-top: 20px;
  animation: fadeIn 1s ease;
}

/* ==============================
   FOOTER
============================== */
footer {
  background: #111;
  text-align: center;
  padding: 15px;
  border-top: 1px solid #0f9d58;
  margin-top: 60px;
  color: #888;
}

/* ==============================
   ANIMACIONES KEYFRAMES
============================== */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(40px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  0% { opacity: 0; transform: translateY(-20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes glowPulse {
  0% { text-shadow: 0 0 5px #0f9d58, 0 0 10px #0f9d58; }
  100% { text-shadow: 0 0 15px #00ff99, 0 0 30px #0f9d58; }
}

/* ==============================
   RESPONSIVE
============================== */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    padding: 20px;
  }

  nav {
    margin-top: 10px;
  }

  .hero {
    padding: 60px 20px;
  }

  .hero h1 {
    font-size: 2em;
  }

  .cards {
    flex-direction: column;
    align-items: center;
  }

  form, #quiz-container {
    width: 100%;
  }

  #question {
    font-size: 1.2em;
  }

  #answers .btn {
    font-size: 0.95em;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.5em;
  }

  .hero h1 {
    font-size: 1.7em;
  }

  main {
    padding: 30px 20px;
  }

  .card {
    width: 100%;
  }
}
