/* -----------------------------------------------------------
   0. Reset y tipografía
----------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

/* -----------------------------------------------------------
   1. Fondo y centrar contenedor
----------------------------------------------------------- */
html, body {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(to bottom, #2a826d, #0C5C4C);
}

/* -----------------------------------------------------------
   2. Contenedor principal
----------------------------------------------------------- */
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
  padding: 1.25rem; /* 20px */
}

/* -----------------------------------------------------------
   3. Card paso a paso
----------------------------------------------------------- */
.card-step {
  display: flex;
  width: 80%;
  min-width: 70rem;          /* 1120px */
  min-height: 32rem;         /* CONSISTENTE en todos los pasos */
  background: #ffffff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 0.25rem 0.625rem rgba(0, 0, 0, 0.2);
  margin: auto;
}

/* -----------------------------------------------------------
   4. Columnas izquierda y derecha
----------------------------------------------------------- */
.card-left,
.card-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2.5rem;
}

/* Columna izquierda */
.card-left {
  justify-content: center;
  align-items: center;
  background:
    linear-gradient(45deg, rgba(0, 77, 64, 0.8), transparent),
    radial-gradient(circle at top left, #4caf50, transparent);
  color: white;
}

/* Columna derecha */
.card-right {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #f8f9fa;
}

/* -----------------------------------------------------------
   5. Títulos
----------------------------------------------------------- */
.titulo_card_left {
  font-size: 2.5rem;
  margin-bottom: .2rem;
}
.subtitulo_card_left {
  font-size: 1.2rem;
  margin-bottom: 2.25rem;
}

/* -----------------------------------------------------------
   6. Form-groups
----------------------------------------------------------- */
.form-group {
  width: 100%;
  padding-left: 3rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 0.25rem;
  position: relative; /* Para posicionar el botón ojo sin encimar */
}

label {
  display: block;
  margin-top: 0.15rem;
  margin-bottom: 0.15rem;
  font-size: 0.875rem;
  color: #333;
}

/* -----------------------------------------------------------
   7. Inputs y selects
----------------------------------------------------------- */
input,
select {
  width: 85%;
  padding: 0.5rem;
  margin-top: 0.1rem;
  margin-bottom: 0.1rem;
  border: none;
  border-radius: 0.5rem;
  box-shadow: inset 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.1);
  background: #fff;
}

input:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 0.125rem #49a942;
}

/* -----------------------------------------------------------
   8. Mensajes de error (existentes)
----------------------------------------------------------- */
.error-message {
  color: #ff3333;
  font-size: 0.9rem;
  visibility: hidden;
  height: 1.25rem;
}
input.error + .error-message,
select.error + .error-message {
  visibility: visible;
}

/* -----------------------------------------------------------
   9. Botones
----------------------------------------------------------- */
button {
  padding: 0.75rem 1.5rem;
  background-color: #0C5C4C;
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-left: 0.625rem;
}
button:hover {
  background-color: #2a826d;
}
.buttons {
  align-self: stretch;
  display: flex;
  justify-content: flex-end;
  margin-top: 0.25rem;
}

/* -----------------------------------------------------------
   10. Modales
----------------------------------------------------------- */
/* Loading */
#loadingModal {
  display: none;
  position: fixed;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(6, 58, 28, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 1050;
}
#loadingModal div {
  padding: 20px 40px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
  width: 300px;
}
#loadingModal h2 {
  font-weight: 500;
  color: #333;
  margin: 0;
}

/* Éxito */
#modalExito {
  position: fixed;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.modal-content {
  width: 30%;
  padding: 1.25rem;
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 0.25rem 0.375rem rgba(0,0,0,0.1);
  text-align: center;
}
.modal-content span {
  display: block;
  margin-bottom: 1.25rem;
  color: #333;
}
.modal-content button {
  padding: 0.625rem 1.25rem;
  background-color: #0C5C4C;
  color: white;
  border: none;
  border-radius: 0.3125rem;
  cursor: pointer;
  font-size: 1rem;
}
.modal-content button:hover {
  background-color: #0C5C4C;
}

/* ======================================================
   10.1. Modal de Error
====================================================== */
#modalError {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: none; /* se muestra por JS */
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
}
#modalError .modal-content.error-modal {
  background-color: #e0f2f1;
  border-radius: 0.5rem;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  overflow: hidden;
}
#modalError .modal-header {
  background-color: #b65e44;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #80cbc4;
}
#modalError .modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #fdfdfd;
  text-align: center;
}
#modalError .modal-body {
  padding: 1rem;
  color: #004d40;
  font-size: 1rem;
  text-align: center;
  line-height: 1.4;
}
#modalError .modal-footer {
  padding: 0.75rem;
  text-align: center;
  border-top: 1px solid #80cbc4;
}
#modalErrorBtn {
  padding: 0.6rem 1.5rem;
  background-color: #388e3c;
  color: white;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s;
}
#modalErrorBtn:hover {
  background-color: #2e7d32;
}

/* ======================================================
   11. Estilo “tipo Bootstrap” para validación
   (sin cargar Bootstrap CSS)
====================================================== */
.is-invalid {
  border: 1px solid #dc3545 !important;
  box-shadow: none !important;
}
.invalid-feedback {
  width: 85%;               /* alinea con el ancho del input */
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: none;            /* se muestra por JS */
  line-height: 1.2;
}

/* ======================================================
   12. Contraseña: wrapper + botón ojo
====================================================== */
.password-wrapper {
  width: 85%;
  position: relative;
  display: flex;
  align-items: center;
}
.password-wrapper input {
  width: 100%;               /* para no quedarse en 85% dentro del wrapper */
  padding-right: 2.25rem;    /* espacio para el botón ojo */
}
.toggle-password-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  line-height: 1;
  color: #000;               /* ícono siempre negro */
}
.toggle-password-btn .bi {
  font-size: 1rem;
  color: inherit;
}

/* -----------------------------------------------------------
   13. Media queries
----------------------------------------------------------- */

/* Extra-grandes */
@media (min-width: 1200px) {
  .card-step { max-height: 45rem; }
  .titulo_card_left { font-size: 3rem; }
  .subtitulo_card_left { font-size: 1.5rem; }
  .form-group label { font-size: 1rem; }
  .buttons button { padding: 1rem 2rem; }
}

/* Grandes */
@media (min-width: 992px) and (max-width: 1199px) {
  .card-step { width: 80%; min-width: 50rem; }
  .titulo_card_left { font-size: 2.75rem; }
  .subtitulo_card_left { font-size: 1.4rem; }
  .form-group label { font-size: 0.95rem; }
  .buttons button { padding: 0.85rem 1.75rem; }
}

/* Medianas */
@media (min-width: 768px) and (max-width: 991px) {
  .card-step { width: 85%; min-width: 40rem; }
  .titulo_card_left { font-size: 2.5rem; }
  .subtitulo_card_left { font-size: 0.95rem; text-align: center; }
  input, select { width: 90%; }
  .password-wrapper { width: 90%; }
  .invalid-feedback { width: 90%; }
  .buttons button { padding: 0.75rem 1.5rem; }
}

/* Pequeñas */
@media (min-width: 576px) and (max-width: 767px) {
  .card-step { flex-direction: column; min-width: 30rem; }
  .card-left, .card-right { width: 100%; padding: 1.5rem; }
  .titulo_card_left { font-size: 2rem; }
  .subtitulo_card_left { font-size: 1.2rem; }
  .buttons button { padding: 0.65rem 1.25rem; }
}

/* Extra-pequeñas */
@media (max-width: 575px) {
  .card-step { flex-direction: column; width: 100%; min-width: 0; }
  .card-left, .card-right { padding: 1rem; }
  .titulo_card_left { font-size: 1.75rem; }
  .subtitulo_card_left { font-size: 1rem; }
  .buttons button { padding: 0.5rem 1rem; }
  input, select, .password-wrapper { width: 100%; }
  .invalid-feedback { width: 100%; }
}
