/* =========================================
   LOGIN.CSS — Guardia Ambiental
   Layout: Split screen (izquierda visual / derecha form)
========================================= */

:root {
  --verde-hero:   #1a5c38;
  --verde-mid:    #2e8b57;
  --verde-bright: #3ab26e;
  --crema:        #f5f2ec;
  --blanco:       #ffffff;
  --texto-dark:   #0f1f14;
  --texto-mid:    #4a5568;
  --texto-suave:  #718096;
  --borde:        #e2e8f0;
  --error-bg:     #fff5f5;
  --error-color:  #c53030;
  --font:         'DM Sans', sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--crema);
  min-height: 100vh;
}


/* =========================================
   CONTENEDOR PRINCIPAL — SPLIT
========================================= */
.login-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}


/* =========================================
   PANEL IZQUIERDO
========================================= */
.login-left {
  position: relative;
  background: var(--verde-hero);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Patrón decorativo de fondo */
.login-left::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(58, 178, 110, 0.08);
  top: -120px;
  right: -120px;
  pointer-events: none;
}

.login-left::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(58, 178, 110, 0.06);
  bottom: -60px;
  left: -60px;
  pointer-events: none;
}

.left-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(10, 35, 20, 0.3) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.left-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 52px;
}

/* Botón volver */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 999px;
  margin-bottom: 52px;
  width: fit-content;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.back-link:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.3);
  color: #ffffff;
  transform: translateY(-2px);
}

.back-link:active {
  transform: translateY(0);
}

.back-link .arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.back-link:hover .arrow {
  transform: translateX(-3px);
}

/* Logo escudo */
.left-logo {
  width: 90px;
  height: 90px;
  margin-bottom: 32px;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.3));
  transition: transform 0.3s;
}

.left-logo:hover {
  transform: scale(1.05);
}

.left-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Título izquierdo */
.left-title {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.1;
  color: white;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.left-title span {
  font-weight: 300;
  color: rgba(255,255,255,0.6);
  font-size: 36px;
}

/* Descripción */
.left-desc {
  font-size: 14px;
  font-weight: 300;
  color: rgba(255,255,255,0.6);
  line-height: 1.75;
  max-width: 320px;
  margin-bottom: 40px;
}

/* Mini stats */
.left-stats {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 18px 24px;
  width: fit-content;
  backdrop-filter: blur(8px);
}

.left-stat {
  padding: 0 20px;
  text-align: center;
}

.left-stat:first-child {
  padding-left: 0;
}

.left-stat strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #a8f0c6;
  margin-bottom: 3px;
}

.left-stat span {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.left-stat-div {
  width: 1px;
  height: 30px;
  background: rgba(255,255,255,0.12);
}

/* Footer izquierdo */
.left-footer {
  position: relative;
  z-index: 1;
  padding: 24px 52px;
  font-size: 12px;
  color: rgba(255,255,255,0.25);
  border-top: 1px solid rgba(255,255,255,0.07);
}


/* =========================================
   PANEL DERECHO — FORMULARIO
========================================= */
.login-right {
  background: var(--blanco);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
}

.form-wrap {
  width: 100%;
  max-width: 400px;
  animation: formSlide 0.6s ease both;
}

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

/* Encabezado del form */
.form-header {
  margin-bottom: 36px;
}

.form-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #eaf7ef;
  border: 1px solid rgba(46,139,87,0.2);
  color: var(--verde-mid);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 30px;
  margin-bottom: 20px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background: var(--verde-bright);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(58,178,110,0.5); }
  50%       { box-shadow: 0 0 0 4px rgba(58,178,110,0); }
}

.form-header h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--texto-dark);
  line-height: 1.15;
  margin-bottom: 10px;
  letter-spacing: -0.4px;
}

.form-header p {
  font-size: 14px;
  color: var(--texto-suave);
  font-weight: 400;
}

/* Alerta error */
.form-alerta {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--error-bg);
  border: 1px solid rgba(197, 48, 48, 0.2);
  color: var(--error-color);
  font-size: 13px;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 24px;
}

/* Campos del formulario */
.field-group {
  margin-bottom: 20px;
}

.field-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--texto-dark);
  margin-bottom: 8px;
}

.field-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 14px;
  color: var(--texto-suave);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.field-input-wrap input {
  width: 100%;
  padding: 13px 14px 13px 42px;
  border: 1.5px solid var(--borde);
  border-radius: 12px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--texto-dark);
  background: #fafafa;
  outline: none;
  transition: all 0.2s;
}

.field-input-wrap input:focus {
  border-color: var(--verde-mid);
  background: white;
  box-shadow: 0 0 0 3px rgba(46,139,87,0.1);
}

.field-input-wrap input::placeholder {
  color: #b0bec5;
}

/* Toggle contraseña */
.toggle-pass {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--texto-suave);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s;
}

.toggle-pass:hover {
  color: var(--verde-mid);
}

/* Botón submit */
.btn-login {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--verde-mid);
  color: white;
  border: none;
  padding: 15px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.25s;
  margin-top: 8px;
  box-shadow: 0 8px 24px rgba(46,139,87,0.25);
  letter-spacing: 0.2px;
}

.btn-login:hover {
  background: var(--verde-hero);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(46,139,87,0.35);
}

.btn-login:active {
  transform: translateY(0);
}

/* Link estudiante */
.switch-link {
  text-align: center;
  font-size: 13px;
  color: var(--texto-suave);
  margin-top: 28px;
}

.switch-link a {
  color: var(--verde-mid);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.switch-link a:hover {
  color: var(--verde-hero);
}


/* =========================================
   RESPONSIVO
========================================= */
@media (max-width: 900px) {
  .login-wrap {
    grid-template-columns: 1fr;
  }

  .login-left {
    min-height: 280px;
  }

  .left-content {
    padding: 40px 32px 30px;
    flex-direction: row;
    align-items: center;
    gap: 24px;
    justify-content: center;
  }

  .back-link {
    display: none;
  }

  .left-logo {
    width: 70px;
    height: 70px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .left-title {
    font-size: 28px;
    margin-bottom: 0;
  }

  .left-title span {
    font-size: 22px;
  }

  .left-desc,
  .left-stats {
    display: none;
  }

  .login-right {
    padding: 40px 24px;
  }
}

@media (max-width: 480px) {
  .form-header h2 {
    font-size: 26px;
  }
}
