/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body y tipografía */
body {
  font-family: 'Poppins', sans-serif;
  background-color: #fff;
  color: #3A4036;
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
header {
  background-color: transparent;
  padding: 1.5rem 1rem;
  text-align: center;
}

.logo img {
  max-width: 200px;
  height: auto;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.logo img:hover {
  transform: scale(1.05);
}

/* Fondo dinámico de la materia */
.fondo-materia {
  min-height: 80vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 40px 20px;
  transition: background-image 0.6s ease-in-out;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Contenedor */
.container {
  max-width: 600px;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 25px 30px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
  color: #3A4036;
}

/* Título */
h1 {
  font-weight: 600;
  margin-bottom: 25px;
  text-align: center;
}

/* Formulario */
.input-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 1rem;
}

input, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1.5px solid #ccc;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

input:focus, select:focus {
  border-color: #ED8803;
  outline: none;
}

/* Descripción de la materia */
#descripcion-materia {
  margin-top: 25px;
  padding: 20px;
  border-radius: 12px;
  font-size: 1rem;
  line-height: 1.6;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  background-color: rgba(237,136,3,0.1); /* ligero fondo para resaltar */
}

/* Materia-box */
.materia-box h2 {
  font-size: 1.8rem;
  color: #ED8803;
  margin-bottom: 10px;
  text-align: center;
}

.materia-box h3 {
  font-size: 1.2rem;
  color: #3A4036;
  font-weight: 500;
  margin-bottom: 15px;
  text-align: center;
}

.materia-box h4 {
  font-size: 1.1rem;
  margin-top: 15px;
  margin-bottom: 8px;
  color: #333;
}

.materia-box ul {
  list-style: none;
  padding: 0;
  margin-bottom: 15px;
}

.materia-box ul li {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.materia-box ul li i {
  color: #ED8803;
  font-size: 1rem;
}

.materia-box p i {
  color: #3A4036;
  margin-right: 6px;
}

/* Botón */
button {
  width: 100%;
  padding: 12px;
  background-color: #ED8803;
  color: #fff;
  border: none;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 30px;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #d77e02;
}

/* Alertas */
.alert {
  padding: 12px;
  border-radius: 8px;
  margin-top: 15px;
  text-align: center;
  font-weight: 500;
}

.alert.success {
  background-color: #D4EDDA;
  color: #155724;
}

.alert.error {
  background-color: #F8D7DA;
  color: #721C24;
}

/* Flecha de regreso */
.back-arrow {
  display: inline-block;
  margin: 25px auto 0;
  font-size: 18px;
  color: #ED8803;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.3s ease, color 0.3s ease;
  cursor: pointer;
  text-align: center;
}

.back-arrow:hover {
  transform: translateX(-6px);
  color: #d77e02;
  text-decoration: underline;
  transition-duration: 0.25s;
}

/* Footer */
footer {
  background-color: #3A4036;
  color: #FFF6EA;
  padding: 25px 15px;
  font-size: 14px;
  font-weight: 400;
  display: flex;
  justify-content: center;
}

.footer-grid {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  max-width: 900px;
  width: 100%;
  justify-content: center;
}

.footer-grid div {
  min-width: 150px;
}

.footer-grid h3 {
  font-weight: 700;
  margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 20px;
  }

  .footer-grid {
    flex-direction: column;
    text-align: center;
  }
}
#alerta .success {
  padding: 15px;
  margin-top: 10px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 16px;
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  animation: fadeInOut 4s forwards;
}

#alerta .error {
  padding: 15px;
  margin-top: 10px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 16px;
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  animation: fadeInOut 4s forwards;
}

@keyframes fadeInOut {
  0% {opacity: 0;}
  10% {opacity: 1;}
  90% {opacity: 1;}
  100% {opacity: 0;}
}
