/*==================================================
    LOGIN A&E AGROINDUSTRIAS 3J
    (adaptado desde el diseño de Claude Design)
===================================================*/

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

html, body {
  height: 100%;
  font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
  background: #faf9f4;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

a { color: #2f6b34; text-decoration: none; }
a:hover { color: #244f27; }

/* ---- Estructura general: contenido arriba, franja abajo ---- */
.ld-principal {
  display: flex;
  flex: 1 1 0%;
  min-height: 0;
  overflow: hidden;
}

/* ---- Panel izquierdo: slider + mensaje ---- */
.ld-hero {
  position: relative;
  flex: 1.15;
  overflow: hidden;
  min-width: 0;
}

.ld-hero .slide {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.ld-hero .slide.activa { opacity: 1; }

.ld-hero .capa-oscura {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(20,26,18,0.55) 0%, rgba(20,26,18,0.35) 45%, rgba(20,26,18,0.6) 100%);
}

.ld-hero .blob-decorativo {
  position: absolute;
  left: -15%; bottom: -58%;
  width: 75%; height: 42%;
  background: #a9c93d;
  border-radius: 50% 50% 0 0 / 60% 60% 0 0;
  transform: rotate(-8deg);
  z-index: 1;
  opacity: 0.92;
}

/* ---- Panel derecho: tarjeta de login ---- */
.ld-form {
  flex: 0 0 44%;
  min-height: 0;
  overflow: auto;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 72px;
  gap: 14px;
}

.ld-form .logo-form { width: 200px; margin-bottom: 4px; }
.ld-form h1 { font-size: 1.8rem; font-weight: 700; color: #2f6b34; text-align: center; }
.ld-form .subtitulo { font-size: 15px; color: #6b7280; text-align: center; margin-bottom: 4px; }

.ld-form form { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; }

.ld-campo {
  display: flex; align-items: center; gap: 14px;
  border: 1.5px solid #dcdfe3;
  border-radius: 10px;
  padding: 12px 18px;
  transition: border-color 0.2s ease;
}
.ld-campo:focus-within { border-color: #2f6b34; box-shadow: 0 0 0 3px rgba(47,107,52,0.12); }
.ld-campo svg { width: 20px; height: 20px; flex-shrink: 0; }
.ld-campo input {
  border: none; outline: none; font-size: 16px; color: #374151;
  width: 100%; background: transparent;
}
.ld-campo button { border: none; background: none; padding: 0; cursor: pointer; flex-shrink: 0; display: flex; }

.ld-btn-ingresar {
  margin-top: 4px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #2f6b34; color: #fff; border: none; border-radius: 10px;
  padding: 14px; font-size: 16px; font-weight: 700; letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
.ld-btn-ingresar svg { width: 18px; height: 18px; flex-shrink: 0; }
.ld-btn-ingresar:hover { background: #244f27; }
.ld-btn-ingresar:active { transform: scale(0.99); }

.ld-error {
  width: 100%; max-width: 420px;
  background: #fef2f2; color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
}

/* ---- Franja inferior ---- */
.ld-footer {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 56px;
  background: #faf9f4;
  border-top: 1px solid #ece9e0;
  flex-wrap: wrap;
  gap: 16px;
}
.ld-footer .seguro { display: flex; align-items: center; gap: 14px; }
.ld-footer .seguro svg { width: 30px; height: 30px; flex-shrink: 0; }
.ld-footer .seguro div div:first-child { font-size: 15px; font-weight: 600; color: #374151; }
.ld-footer .seguro div div:last-child { font-size: 14px; color: #6b7280; }
.ld-footer .derechos { text-align: right; }
.ld-footer .derechos div:first-child { font-size: 15px; color: #374151; }
.ld-footer .derechos div:last-child { font-size: 14px; color: #6b7280; }

/* ---- Responsive: en pantallas angostas, todo en una columna ---- */
@media (max-width: 900px) {
  .ld-principal { flex-direction: column; }
  .ld-hero { flex: none; min-height: 220px; }
  .ld-form { flex: 1; padding: 28px 24px; }
  html, body { overflow: auto; }
}

@media (max-height: 700px) {
  .ld-form { padding: 20px 40px; }
}

/* ---- Pantalla de carga con el logo ---- */
.pantalla-carga {
  position: fixed; inset: 0; z-index: 9999;
  background: #ffffff;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.4s ease;
}
.pantalla-carga img {
  width: 140px;
  animation: latidoCarga 1.4s ease-in-out infinite;
}
@keyframes latidoCarga {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.06); opacity: 1; }
}


/* ---- Ajuste móvil: composición completa de login en pantallas pequeñas ---- */
@media (max-width: 600px) {
  html, body {
    min-height: 100%;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .ld-principal {
    flex: none;
    min-height: auto;
  }

  /* El banner gana un poco de altura y se mantiene como protagonista. */
  .ld-hero {
    flex: none;
    height: 205px;
    min-height: 205px;
  }

  .ld-form {
    flex: none;
    min-height: 0;
    overflow: visible;
    padding: 12px 20px 14px;
    gap: 6px;
  }

  .ld-form .logo-form {
    width: 112px;
    margin-bottom: 0;
  }

  .ld-form h1 {
    font-size: 1.42rem;
    line-height: 1.2;
  }

  .ld-form .subtitulo {
    font-size: 12px;
    line-height: 1.3;
    margin-bottom: 1px;
  }

  .ld-form form {
    max-width: 420px;
    gap: 8px;
  }

  .ld-campo {
    padding: 9px 14px;
    border-radius: 10px;
  }

  .ld-btn-ingresar {
    padding: 11px;
    margin-top: 1px;
  }

  /* Pie compacto: conserva seguridad y copyright sin consumir la pantalla. */
  .ld-footer {
    padding: 8px 16px 9px;
    gap: 6px;
    justify-content: center;
  }

  .ld-footer .seguro {
    width: 100%;
    justify-content: center;
    gap: 7px;
  }

  .ld-footer .seguro svg {
    width: 22px;
    height: 22px;
  }

  .ld-footer .seguro div div:first-child {
    font-size: 12px;
    line-height: 1.2;
  }

  .ld-footer .seguro div div:last-child {
    font-size: 11px;
    line-height: 1.2;
  }

  .ld-footer .derechos {
    width: 100%;
    text-align: center;
  }

  .ld-footer .derechos div:first-child,
  .ld-footer .derechos div:last-child {
    font-size: 10px;
    line-height: 1.25;
  }
}

/* Teléfonos altos: mantener el banner visible sin volver a agrandar el pie. */
@media (max-width: 600px) and (min-height: 761px) {
  .ld-hero {
    height: 220px;
    min-height: 220px;
  }
}

/* Teléfonos muy bajos: compactar el contenido, pero conservar el banner. */
@media (max-width: 600px) and (max-height: 760px) {
  .ld-hero {
    height: 185px;
    min-height: 185px;
  }

  .ld-form {
    padding-top: 10px;
    padding-bottom: 11px;
  }

  .ld-form .logo-form {
    width: 104px;
  }

  .ld-form h1 {
    font-size: 1.34rem;
  }

  .ld-form .subtitulo {
    font-size: 11.5px;
  }

  .ld-footer {
    padding-top: 7px;
    padding-bottom: 8px;
  }
}
