/* ===== VARIABLES POR DEFECTO (modo claro) ===== */
body {
  --bg-body: #f2f2f2;
  --bg-navbar: #031529;
  --bg-card: #ffffff;
  --text-main: #000000;
  --text-secondary: #555555;
  --text-navbar: #ffffff;
  --box-shadow: 0 10px 15px rgba(0, 0, 0, 0.5);

  margin: 0;
  font-family: 'Roboto', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  transition: background-color 0.5s ease, color 0.5s ease;
}

/* ===== MODO OSCURO ===== */
body.dark-mode {
  --bg-body: #121212;
  --bg-navbar: #1e1e1e;
  --bg-card: #1c1c1c;
  --text-main: #ffffff;
  --text-secondary: #bbbbbb;
  --text-navbar: #ffffff;
  --box-shadow: 0 10px 15px rgba(0, 0, 0, 0.8);

  background-color: var(--bg-body);
  color: var(--text-main);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.header {
  background-color: var(--bg-navbar);
  color: var(--text-navbar);
  padding: 0.5rem 2.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.header h1 {
  font-size: 2.5rem;
  font-weight: bold;
  flex: 1 1 100%;
}

.header h2 {
  font-size: 20px;
  padding: 0.2rem;
  color: #99ec2d;
}

.user-session {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 0.5rem;
  gap: 1rem;
}

.usuario-label {
  font-size: 12px;
  padding: 0.4rem 0.2rem;
}

.materiasl {
  width: 100%;
  height: 5px;
  background-color: #d3d3d3;
  margin: 10px 0 2px;
  border-radius: 3px;
}

.btn.cerrar {
  background-color: #ef5350;
  font-size: 1rem;
  width: 250px;
  height: 32px;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: white;
}
.btn.cerrar:hover {
  background-color: #c62828;
}

.btn.azul {
  background-color: #007adf;
  color: white;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}
.btn.azul:hover {
  background-color: #045ba8;
}

.contenedor-general {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.consulta-container .form-group {
  background-color: var(--bg-card);
  color: var(--text-main);
  padding: 1rem 1.5rem;
  margin: 0.25rem auto;
  max-width: 500px;
  width: 100%;
  border-radius: 10px;
  box-shadow: var(--box-shadow);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: background-color 0.3s ease;
}

.consulta-container .form-group label {
  font-weight: bold;
  font-size: 1rem;
}

.consulta-container .form-group input {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.consulta-container .form-group input:focus {
  outline: none;
  border-color: #3b9eff;
}

.resultado, .error {
  max-width: 500px;
  margin: 1rem auto;
  padding: 1rem;
  border-radius: 8px;
  font-size: 1rem;
}

.resultado {
  background-color: #e0f7fa;
  color: #00695c;
}

.error {
  background-color: #ffebee;
  color: #c62828;
}



.mensaje {
  margin-top: 8px;
  font-size: 15px;
  padding: 6px 12px;
  border-radius: 4px;
}


.mensaje.exito,
.mensaje.error {
  background-color: transparent; /* o déjalo si quieres fondo */
  color: var(--text-main);       /* negro en claro, blanco en oscuro */
  border: none;                  /* opcional: elimina borde rojo/verde */
}

body.dark-mode .mensaje.exito,
body.dark-mode .mensaje.error {
  color: var(--text-main);       /* asegura blanco en modo oscuro */
}


/* ======= Responsive ======= */
@media (max-width: 768px) {
  .header {
    padding: 0.5rem 1rem;
    flex-direction: column;
    align-items: stretch;
  }

  .header h1 {
    text-align: center;
    font-size: 2rem;
  }

  .header h2 {
    font-size: 18px;
    text-align: center;
  }


  .usuario-label {
    font-size: 11px;
    padding: 0.4rem 0.2rem;
  }

  .btn.cerrar {
    width: 85px !important;
    max-width: 85px !important;
    padding: 0.3rem 0.4rem !important;
    font-size: 0.8rem !important;
    flex-shrink: 0 !important;
  }

  .btn.azul {
    width: 100%;
  }

  .user-session {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .consulta-container .form-group {
    padding: 1rem;
    width: 95%;
  }

  .consulta-container .form-group label {
    font-size: 0.9rem;
  }
}
