@keyframes waveAnimation {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(270deg, #a9d6ff, #004e92, #a9d6ff);
  background-size: 600% 600%;
  animation: waveAnimation 20s ease infinite;
  color: #003366;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 1rem;
  overflow: hidden;
}

.container {
  background: rgba(255, 255, 255, 0.9);
  padding: 1.8rem 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo {
  max-width: 150px;
  margin-bottom: 1.2rem;
  user-select: none;
  pointer-events: none;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

form h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: #004e92;
  text-align: center;
  user-select: none;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem 1.8rem;
  margin-top: 1rem;
}

.campo {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-align: left;
}

label {
  font-weight: 600;
  color: #004e92;
  font-size: 0.9rem;
  user-select: none;
}

#pantallaSeleccionCongregacion, #registroForm, #formAltaCongregacion {
  display: flex;
  flex-direction: column; /* opcional, si quieres que el contenido esté en columna */
  align-items: center;
  justify-content: center; /* para centrar verticalmente también */
}

p {
  font-size: 0.95rem;
  color: #004e92;
  margin: 0.5rem 0;
  text-align: center;
  user-select: none;
}

input, select {
  max-width: 600px;
  box-sizing: border-box;
  padding: 0.4rem 0.65rem;
  border: 2px solid #004e92;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color 0.3s ease;
  background-color: white;

}

input:focus, select:focus {
  border-color: #0077cc;
  outline: none;
  box-shadow: 0 0 6px #0077ccaa;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23004e92" class="bi bi-chevron-down" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.botones-centrados {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 1.2rem;
}

button {
  margin-top: 1rem;
  background-color: #004e92;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.45rem 1rem; /* menos alto y ancho */
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-bottom: 1rem;
  min-width: 140px; /* más compacto */
  max-width: fit-content;
  white-space: nowrap;
}

button:disabled {
  background-color: #8fbce6;
  cursor: not-allowed;
}

.link-button {
  background: none;
  border: none;
  color: #004e92;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.3rem;
  margin-top: 0.2rem;
  user-select: none;
  max-width: fit-content;
}

.link-button:hover {
  color: #0077cc;
}

#messageRegistro {
  margin-top: 0.5rem;
  font-weight: 600;
  min-height: 1.2rem;
  text-align: center;
  user-select: none;
}

.error {
  color: #b00020;
}

.success {
  color: #0077cc;
}

.compacto {
  font-size: 0.9rem;
  color: #004e92;
  margin: 2px 0;
  text-align: center;
  user-select: none;
}

.hidden {
  display: none !important;
}

.toggle-password {
  background: none;
  border: none;
  color: #1c9ac6;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  margin-top: 4px;
  font-family: inherit;
  text-decoration: underline;
  display: inline-block;
}

.toggle-password:hover {
  color: #004a99;
}


/* RESPONSIVE: tablets o menos */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .container {
    max-height: 95vh;
    padding: 1.2rem 1.5rem;
  }

  button {
    font-size: 0.95rem;
    padding: 0.4rem 0.9rem;
    min-width: 120px;
  }
}

/* RESPONSIVE móvil puro */
@media (max-width: 480px) {
  body {
    background: white;
    animation: none;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    height: 100vh;
  }

  .container {
    width: 100%;
    max-width: 360px;
    border-radius: 0;
    box-shadow: none;
    padding: 1rem;
    background: none;
    max-height: 95vh;
  }

  .logo {
    margin: 0 auto 1rem auto;
    display: block;
    max-width: 100px;
  }

  label {
    font-size: 0.85rem;
  }

  button {
    font-size: 0.9rem;
    padding: 0.35rem 0.7rem;
    min-width: 90px;
  }
}




/* LOADER BARRA ---------------------------------------------------------------- */
.loader-overlay {
  position: fixed;
  inset: 0;
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loader-content img {
  width: 150px;
  margin-bottom: 20px;
}

.loader-bar-container {
  width: 200px;
  height: 10px;
  background-color: #3c5251;
  border-radius: 5px;
  overflow: hidden;
}

.loader-bar {
  height: 100%;
  width: 0%;
  background-color: #1c9ac6;
  transition: width 0.1s linear;
}
