/* Esfera de partners (módulo Alliance). Clases genéricas renombradas a esf-* para no colisionar. */
/* ===========================
   MÓDULO ENCAPSULADO ALLIANCE
   =========================== */

.esf-modal-close{
  display: none;
}
.alliance-module * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.alliance-module {
      background: linear-gradient(to bottom, #00040c 0%, #0a2347 50%, #00040c 100%);
  color: #fff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-x: hidden;
}

/* Estructura principal */
.alliance-content {
  max-width: 1200px;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: center;
  justify-content: center;
}

.alliance-text {
  flex: 1;
  min-width: 300px;
  max-width: 100%;
  padding: 0 15px;
}

.alliance-text h1 {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 20px;
  color: #ffffff;
}

.alliance-text p {
  line-height: 1.6;
  margin-bottom: 20px;
  font-size: 1.1rem;
}

/* Botones */
.alliance-cta {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.alliance-btn {
  padding: 12px 25px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
  text-align: center;
  min-width: 180px;
}

.alliance-btn-donate {
  background-color: rgba(0, 0, 0, 0.59);
  color: #ffffffff;
  border: 1px solid #00fbff8f;
  box-shadow: 0 0 15px rgba(4, 177, 245, 0.5);
}

.alliance-btn-donate:hover {
  background-color: #fc00a8 ;
  border: none;
  color: #ffffffff;
}

.alliance-btn-sponsor {
  background-color: #0059ff17;
  color: #ffffffff;
  border: 2px solid #0077ffff;
}
.alliance-btn-sponsor:hover {
  background-color: #0077ffff;
  color: #ffffffff;
  border: 2px solid #0077ffff;
}

.alliance-btn:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Esfera */
.alliance-sphere-container {
  flex: 1;
  min-width: 300px;
  max-width: 500px;
  height: 600px;
  position: relative;
  perspective: 1200px;
  margin-top: 220px;
  margin-left: 260px;
  cursor: grab;
  user-select: none;
}

.alliance-sphere-container:active {
  cursor: grabbing;
}

.alliance-sphere {
  position: absolute;
  width: 300px;
  height: 300px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transform-style: preserve-3d;
}

.alliance-logo {
  position: absolute;
  width: 80px;
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transform-style: preserve-3d;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  padding: 0; /* Cambiado para los enlaces */
}

.alliance-logo:hover {
  transform: scale(1.2);
  background: rgba(79, 195, 247, 0.2);
  box-shadow: 0 0 15px rgba(79, 195, 247, 0.5);
}

/* Estilos para los enlaces dentro de los logos */
.alliance-logo a {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}

.alliance-logo img {
  width: 80%; /* Un poco más pequeño para mejor visualización */
  height: 80%;
  object-fit: contain;
  filter: brightness(1) invert(0);
  transition: all 0.3s ease;
}

.alliance-logo:hover img {
  transform: scale(1.1);
}

.instructions {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  text-align: center;
  width: 100%;
  z-index: 10;
}

/* ===========================
   MODAL DE AFILIACIÓN - MODIFICADO PARA PERMITIR SCROLL
   =========================== */
.alliance-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: flex-start; /* Cambiado de center a flex-start */
  z-index: 9999;
  padding: 40px 20px;
  overflow-y: auto; /* Permitir scroll en el overlay */
  box-sizing: border-box;
}

/* Ajuste para cuando el modal está abierto pero permitimos scroll */
body.esf-modal-open {
  overflow: auto !important; /* Permitir scroll en el body */
}

.alliance-modal {
  background: white;
  border-radius: 25px 25px 15px 15px;
  width: 100%;
  max-width: 900px;
  margin: 0 auto; /* Centrado horizontal */
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalFadeIn 0.3s ease;
  position: relative; /* Para contexto de posicionamiento */
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.esf-modal-header {
  background: linear-gradient(to bottom, #00040c 0%, #0a2347 50%, #00040c 100%);
  color: white;
  padding: 25px 40px;
  border-radius: 20px 20px 0 0;
  border: 1px solid #ffffff1c ;
  position: relative;
}

.esf-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 0, 106, 0.16);
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.esf-modal-close:hover {
  background: rgba(250, 30, 133, 0.84);
  border: 1px solid #ff0095;
}

.esf-modal-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 5px;
  line-height: 1.2;
}

.esf-modal-subtitle {
  font-size: 14px;
  opacity: 0.9;
  margin-top: 5px;
}

.esf-modal-content {
  padding: 35px 40px;
}

/* Formulario */
.affiliation-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.esf-form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.esf-form-group {
  display: flex;
  flex-direction: column;
}

.esf-form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #696969;
  font-size: 12px;
}

.esf-form-control {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #e2e8f0;
  border-radius: 10px 10px 0 0;
  color: #696969;
  font-size: 14px;
  transition: all 0.3s ease;
  background: #f8fafc;
}

.esf-form-control:focus {
  outline: none;
  border-color: #0061ff;
  box-shadow: 0 0 0 3px rgba(0, 97, 255, 0.1);
  background: white;
}

textarea.esf-form-control {
  min-height: 60px;
  resize: vertical;
  grid-column: span 4;
}

.esf-legend-section {
  background: linear-gradient(135deg, #d7d7d8ff, #dddcdcff);
  color: #5f5f5f;
  font-style: italic;
  padding: 15px 60px;
  border-radius: 0 0 20px 20px;
  margin: -15px 0 0;
  text-align: right;
  grid-column: span 4;
}

.esf-legend-section h3 {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
}

.esf-legend-section p {
  font-size: 16px;
  opacity: 0.95;
  line-height: 1.5;
}

.esf-submit-btn {
  background: linear-gradient(135deg, #0061ff, #00d4ff);
  color: white;
  border: none;
  padding: 16px 40px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  align-self: center;
  min-width: 200px;
  grid-column: span 4;
  justify-self: center;
}

.esf-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 97, 255, 0.3);
}

/* Responsive para 4 columnas */
@media (max-width: 992px) {
  .esf-form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  textarea.esf-form-control {
    grid-column: span 2;
  }
  
  .esf-legend-section {
    grid-column: span 2;
  }
  
  .esf-submit-btn {
    grid-column: span 2;
  }
}

/* Responsive para modal en móviles */
@media (max-width: 768px) {
  .alliance-modal-overlay {
    padding: 20px 15px;
    align-items: flex-start;
  }
  
  .alliance-modal {
    max-height: none;
    overflow-y: visible;
    border-radius: 15px 15px 10px 10px;
    animation: modalSlideUp 0.3s ease;
  }
  
  @keyframes modalSlideUp {
    from {
      opacity: 0;
      transform: translateY(50px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .esf-modal-header {
    padding: 20px 25px;
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: 15px 15px 0 0;
  }
  
  .esf-modal-header h2 {
    font-size: 18px !important;
  }
  
  .esf-modal-content {
    padding: 25px 20px;
  }
  
  .esf-form-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
  }
  
  .esf-form-group {
    width: 100% !important;
  }
  
  .esf-form-group[style*="grid-column"],
  textarea.esf-form-control,
  .esf-legend-section,
  .esf-submit-btn {
    grid-column: 1 !important;
    width: 100% !important;
  }
  
  textarea.esf-form-control {
    min-height: 100px !important;
    max-height: 150px !important;
  }
  
  .esf-legend-section {
    padding: 15px 20px !important;
    margin: 10px 0 !important;
    text-align: center !important;
    border-radius: 10px !important;
  }
  
  .esf-legend-section h3 {
    font-size: 14px !important;
    line-height: 1.4 !important;
  }
  
  .esf-submit-btn {
    width: 100% !important;
    padding: 18px 20px !important;
    font-size: 16px !important;
    margin-top: 10px !important;
  }
  
  .esf-form-control {
    padding: 14px 15px !important;
    font-size: 16px !important;
  }
  
  select.esf-form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23333' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
    padding-right: 40px !important;
  }
}

/* Responsive general */
@media (max-width: 1200px) {
  .alliance-sphere-container {
    margin-left: 100px;
    margin-top: 150px;
  }
}

@media (max-width: 992px) {
  .alliance-sphere-container {
    margin-left: 0;
    margin-top: 100px;
  }
  
  .alliance-content {
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .alliance-content {
    flex-direction: column;
    gap: 40px;
  }

  .alliance-text {
    min-width: 100%;
    padding: 0 10px;
  }
  
  .alliance-text h1 {
    font-size: 2rem;
    text-align: center;
  }
  
  .alliance-text p {
    text-align: center;
    font-size: 1rem;
  }
  
  .alliance-cta {
    justify-content: center;
  }
  
  .alliance-btn {
    min-width: 160px;
    padding: 10px 20px;
  }

  .alliance-sphere-container {
    order: -1;
    height: 300px;
    margin-top: 0;
    margin-bottom: 20px;
  }

  .alliance-sphere {
    width: 250px;
    height: 250px;
  }

  .alliance-logo {
    width: 50px;
    height: 50px;
  }
  
  .alliance-logo img {
    width: 70%;
    height: 70%;
  }
}

@media (max-width: 480px) {
  .alliance-module {
    padding: 15px;
  }
  
  .alliance-text h1 {
    font-size: 1.75rem;
  }
  
  .alliance-cta {
    flex-direction: column;
    align-items: center;
  }
  
  .alliance-btn {
    width: 100%;
    max-width: 250px;
  }
  
  .alliance-sphere-container {
    height: 250px;
  }
  
  .alliance-sphere {
    width: 200px;
    height: 200px;
  }
  
  .alliance-logo {
    width: 40px;
    height: 40px;
  }
}

/* Optimización para móviles - labels como placeholders */
@media (max-width: 768px) {
  .esf-form-group label {
    display: none !important;
  }

  .alliance-sphere {
    top: 30%;
    left: 75%;
  }
  
  .alliance-logo {
    width: 60px;
    height: 60px;
  }
  
  .esf-legend-section{
    display: none !important;
  }

  .esf-form-control::placeholder {
    color: #666;
    opacity: 0.8;
  }
  
  .esf-form-control:not(:focus):not(:valid):placeholder-shown {
    background-color: #f8f9fa;
    border-color: #e2e8f0;
  }
  
  .esf-form-control:focus,
  .esf-form-control:valid {
    background-color: white;
  }
  
  .esf-form-control {
    padding: 12px 15px !important;
    font-size: 14px !important;
    height: 45px !important;
  }
  
  select.esf-form-control:required:invalid {
    color: #666;
  }
  
  select.esf-form-control option[value=""][disabled] {
    display: none;
  }
  
  select.esf-form-control option {
    color: #333;
  }
  
  textarea.esf-form-control {
    height: auto !important;
    min-height: 50px !important;
    padding: 12px !important;
    line-height: 1.5 !important;
  }
  
  .esf-form-grid {
    gap: 12px !important;
  }
  
  #correo {
    order: 8;
  }
  
  .esf-form-group:nth-child(1) { order: 1; }
  .esf-form-group:nth-child(2) { order: 2; }
  .esf-form-group:nth-child(3) { order: 3; }
  .esf-form-group:nth-child(4) { order: 4; }
  .esf-form-group:nth-child(5) { order: 5; }
  .esf-form-group:nth-child(6) { order: 6; }
  .esf-form-group:nth-child(7) { order: 7; }
  .esf-form-group:nth-child(8) { order: 9; }
  .esf-form-group[style*="grid-column: span 4"] { order: 8; }
  .esf-legend-section { order: 10; }
  .esf-submit-btn { order: 11; }
}

@media (max-width: 375px) {
  .esf-form-control {
    padding: 14px 12px !important;
    font-size: 14px !important;
    height: 48px !important;
  }
  
  .esf-form-grid {
    gap: 10px !important;
  }
}
