/* ===== Reset & Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
  width: 100%;
  height: 100%;
}

body {
  min-height: 100dvh; /* mejor en móviles que 100vh */
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0.3)), url('../img/pradera_con_vacas.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow-x: hidden;
  padding: 16px; /* pequeño padding general; se ajusta abajo por media query */
}

/* ===== Card de login (mobile-first) ===== */
.glass-container {
  position: relative;
  /* Ocupa ancho sensible: mínimo 280px, hasta 520px, prioriza 94vw en móviles */
  width: clamp(280px, 94vw, 520px);
  margin-inline: auto;
  padding: clamp(24px, 5vw, 50px) clamp(20px, 4.5vw, 45px);
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  z-index: 10;
  overflow: hidden;
}

/* Brillo deslizante: solo si el dispositivo tiene hover real */
@media (hover: hover) and (pointer: fine) {
  .glass-container::before {
    content: '';
    position: absolute;
    inset: 0;
    left: -100%;
    background: rgba(255, 255, 255, 0.1);
    transform: skewX(-15deg);
    transition: 0.8s ease;
    pointer-events: none;
  }
  .glass-container:hover::before { left: 120%; }
}

.glass-container h2 {
  text-align: center;
  margin-bottom: clamp(22px, 5vw, 40px);
  font-size: clamp(1.6rem, 5.5vw, 2.5rem);
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
  letter-spacing: 1px;
}

/* ===== Inputs ===== */
.input-group {
  margin-bottom: clamp(18px, 4.5vw, 35px);
  position: relative;
}

.input-group input {
  width: 100%;
  padding: clamp(12px, 3.5vw, 16px) clamp(15px, 3.5vw, 20px);
  border: none;
  border-radius: 35px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: clamp(0.95rem, 3.2vw, 1.05rem);
  outline: none;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  border: 2px solid transparent;
}

.input-group input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.input-group input:focus {
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.5);
}

.input-group label {
  position: absolute;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(0.88rem, 3vw, 1rem);
  font-weight: 500;
  pointer-events: none;
  transition: all 0.3s ease;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.input-group input:focus + label,
.input-group input:valid + label {
  top: -8px;
  left: 15px;
  font-size: clamp(0.7rem, 2.4vw, 0.8rem);
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 10px;
  border-radius: 12px;
  color: #fff;
  font-weight: 600;
}

/* ===== Recordar / Olvido ===== */
.remember-forgot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: clamp(16px, 3.5vw, 25px);
  font-size: clamp(0.85rem, 3vw, 0.95rem);
  color: rgba(255, 255, 255, 0.9);
  gap: 10px;
  flex-wrap: wrap;
}

.remember-forgot label {
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 8px;
  white-space: nowrap;
}

.remember-forgot input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #1d5002;
}

.remember-forgot a {
  color: #fff;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
  white-space: nowrap;
}

.remember-forgot a:hover {
  text-decoration: underline;
  color: #C8B568;
}

/* ===== Botón ===== */
.login-btn {
  width: 100%;
  padding: clamp(12px, 3.5vw, 16px);
  border: none;
  border-radius: 35px;
  background: linear-gradient(135deg, #013a10, #1d5002);
  color: #fff;
  font-size: clamp(1rem, 3.2vw, 1.1rem);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s ease;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  border: 2px solid transparent;
}

@media (hover: hover) and (pointer: fine) {
  .login-btn:hover {
    background: linear-gradient(135deg, #1d5002, #2a7003);
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
  }
  .login-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  }
}

/* ===== Breakpoints (solo ajustes para pantallas grandes) ===== */

/* Tablets */
@media (min-width: 768px) {
  body { padding: 20px; }
  .glass-container {
    /* en tablet puede crecer un poco más */
    width: clamp(320px, 80vw, 560px);
  }
}

/* Pantallas grandes (mantiene tu look original) */
@media (min-width: 1024px) {
  .glass-container {
    width: 100%;
    max-width: 480px;   /* igual que tu versión desktop */
    padding: 50px;      /* idem */
  }
}

/* Móviles muy pequeños (≤360px) */
@media (max-width: 360px) {
  body { padding: 14px; }
  .glass-container {
    width: 96vw;
    padding: 28px 22px;
  }
  .remember-forgot {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* Accesibilidad: reducir movimiento */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
