/* =========================================================
   LOGIN CFE — DISEÑO MODERNO, RESPONSIVO Y SIN BOOTSTRAP
   ========================================================= */

/* Reset general */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* Fondo */
body {
    background: linear-gradient(135deg, #0B6E4F 0%, #0A8A6A 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px; /* Móviles */
}

/* Tarjeta principal con efecto Glassmorphism */
.login-box {
    width: 380px;
    max-width: 100%;
    padding: 35px;
    border-radius: 18px;

    /* Transparencia + fondo estilo cristal */
    background: rgba(255, 255, 255, 0.15);
    
    /* Difuminado detrás del panel */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    /* Contorno suave tipo vidrio */
    border: 1px solid rgba(255, 255, 255, 0.3);

    /* Luz elegante alrededor */
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.35);

    animation: fadeIn 0.7s ease-in-out;
}

.login-box-msg,
.input-group input {
    color: #ffffff;
}

.login-box-msg {
    font-weight: 600;
}

.input-group input::placeholder {
    color: #e8f6ef;
    opacity: 0.8;
}

/* Animación */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Logo */
.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo img {
    width: 160px;
    max-width: 60%;
}

/* Título */
.login-box-msg {
    text-align: center;
    margin-bottom: 20px;
    font-size: 18px;
    color: #2E4053;
    font-weight: bold;
}

/* ============================
   Inputs
   ============================ */

.input-group {
    width: 100%;
    margin-bottom: 18px;
}

.input-group input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 16px;
    transition: 0.3s ease;
    outline: none;
}

.input-group input:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: #ffffffdd;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.45);
}

/* Input con ojito */
.password-wrapper {
    position: relative;
    height: 52px;           /* Altura fija evita cualquier desplazamiento */
    display: flex;
    align-items: center;
}

/* Ajuste del input */
.password-wrapper input {
    padding-right: 45px;
    height: 100%;           /* Asegura que el input llene el contenedor */
    display: block;
}

/* Ícono del ojito */
.password-wrapper i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #ffffffcc;
    font-size: 20px;
    z-index: 10;            /* EVITA que el mensaje lo empuje */
    pointer-events: auto;
}

/* Mensaje de error debajo (sin mover el wrapper) */
#msgPassword {
    margin-top: 6px;
    margin-bottom: 14px;
    display: block;
}

/* ============================
   Botón
   ============================ */

.btn-cfe {
    width: 100%;
    background: rgba(11, 110, 79, 0.85);
    color: white;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-size: 16px;
    transition: 0.3s;
    margin-top: 5px;
    backdrop-filter: blur(4px);
}

.btn-cfe:hover {
    background: rgba(10, 138, 106, 0.95);
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
}

/* ============================
   Alerta de error (opcional)
   ============================ */
.alert {
    background: #ffdddd;
    padding: 10px;
    border-left: 5px solid #e74c3c;
    color: #7b241c;
    margin-bottom: 15px;
    border-radius: 5px;
    font-size: 14px;
}

/* =========================================================
   RESPONSIVIDAD REAL
   ========================================================= */

/* Celulares pequeños (menos de 390px) */
@media (max-width: 390px) {
    .login-box {
        padding: 25px;
        border-radius: 12px;
    }

    .login-logo img {
        width: 130px;
    }

    .input-group input {
        font-size: 15px;
        padding: 10px 12px;
    }

    .btn-cfe {
        font-size: 15px;
        padding: 10px;
    }
}

/* Tablets verticales (≤ 768px) */
@media (max-width: 768px) {
    body {
        padding: 30px;
    }

    .login-box {
        width: 90%;
        max-width: 420px;
    }

    .login-logo img {
        max-width: 50%;
    }
}

/* Pantallas grandes (≥ 1400px) */
@media (min-width: 1400px) {
    .login-box {
        transform: scale(1.1);
    }
}

/* ===== Alerta estilo CFE (glass + danger) ===== */
.alert {
  position: relative;
  padding: 12px 14px 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  align-items: center;
  backdrop-filter: blur(6px);
}

/* Variante danger */
.alert--danger {
  background: rgba(255, 73, 66, 0.08); /* leve rojo sobre glass */
  border-left: 5px solid rgba(231,76,60,0.95);
  color: #7b241c;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

/* Icono dentro de la alerta */
.alert--danger i {
  color: rgba(231,76,60,0.95);
  font-size: 18px;
  margin-right: 6px;
}

/* Título dentro de la alerta */
.alert h5 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
  color: inherit;
  font-weight: 600;
}

/* Botón de cerrar (estilo propio, sin bootstrap) */
.alert-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: rgba(123,36,28,0.95);
  padding: 4px;
  border-radius: 6px;
  transition: transform .12s ease, color .12s ease, background .12s ease;
}

.alert-close:hover {
  transform: scale(1.06);
  color: #e74c3c;
  background: rgba(255,255,255,0.06);
}

/* Animación para ocultar */
.alert-fadeout {
  animation: alertFade .35s forwards;
}

@keyframes alertFade {
  to { opacity: 0; transform: translateY(-8px); height: 0; margin: 0; padding: 0; }
}

/* Responsivo (garantiza que no tape inputs en móviles) */
@media (max-width: 420px) {
  .alert { font-size: 13px; padding-right: 36px; }
  .alert-close { top: 6px; right: 8px; }
}

/* Mensajes dinámicos */
.input-msg {
    margin-top: 6px;
    font-size: 0.85rem;
    color: #ffdddd;
    padding-left: 4px;
    text-shadow: 0 0 4px #000;
    transition: 0.3s ease;
}

/* Input correcto */
.input-valid {
    border: 2px solid #00ff99 !important;
    box-shadow: 0 0 8px rgba(0,255,150,0.6);
}

/* Input incorrecto */
.input-invalid {
    border: 2px solid #ff4444 !important;
    box-shadow: 0 0 8px rgba(255,50,50,0.6);
}

/* ===============================
   MENSAJES DE VALIDACIÓN MEJORADOS
   =============================== */

.input-msg {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    line-height: 1.3;
    backdrop-filter: blur(6px);
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.25s ease;
}

/* Mostrar mensaje */
.input-msg.show {
    opacity: 1;
    transform: translateY(0);
}

/* Icono */
.input-msg i {
    font-size: 14px;
}

/* Éxito */
.msg-success {
    background: rgba(0, 255, 153, 0.15);
    color: #00ff99;
    box-shadow: 0 0 10px rgba(0,255,150,0.25);
}

/* Error */
.msg-error {
    background: rgba(255, 70, 70, 0.15);
    color: #ff6b6b;
    box-shadow: 0 0 10px rgba(255,70,70,0.25);
}

/* Info */
.msg-info {
    background: rgba(255, 200, 0, 0.15);
    color: #ffd966;
}
