body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f9f9f9;
}

.login-container {
    display: flex;
    height: 100vh;
}

/* ==== CARRUSEL ==== */
.carousel {
    flex: 2.5;
    position: relative;
    overflow: hidden;
}

.slides {
    height: 100%;
    width: 100%;
    position: relative;
}

.slide {
    display: none;
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0; left: 0;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide.active {
    display: block;
}

.caption {
    position: absolute;
    bottom: 30px;
    left: 30px;
    background: rgba(0, 0, 0, 0.5);
    padding: 15px 20px;
    border-radius: 10px;
    color: #fff;
}

/* ==== FORMULARIO ==== */
.logo {
    width: 200px;       /* Ajusta el tamaño según necesites */
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.login-form {
    flex: 1;
    background: #fff;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Enlace de regreso dentro del formulario de login */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #146c43;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 8px;
}
.back-link i {
    font-size: 20px;
}

.login-form h1 {
    font-size: 24px;
    color: #1e7e34;
    margin-bottom: 5px;
}

.login-form .subtitle {
    font-size: 14px;
    color: #555;
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 14px;
    margin-bottom: 5px;
    color: #333;
}

.input-group input {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    outline: none;
}

.input-group input:focus {
    border-color: #1e7e34;
    box-shadow: 0 0 0.25rem 0.05rem rgba(30, 126, 52, 0.45);
}

/* === Password toggle: igual que en registro === */
.password-wrapper { position: relative; width: 100%; }
.password-wrapper input.form-control,
.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
  width: 100%;
  padding-right: 76px; /* espacio para el botón ojo, igual que registro */
  min-height: 42px;
  box-sizing: border-box;
}
.password-wrapper .toggle-password {
  position: absolute;
  right: 15px;   /* alineado como en registro */
  top: 2px;
  bottom: 2px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #333;
  padding: 0;
  width: 40px;   /* ancho fijo para calcular padding del input */
  height: 40px;  /* igual a la altura del input */
  outline: none;
  z-index: 2;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.password-wrapper .toggle-password i { font-size: 22px; line-height: 1; }
.password-wrapper .toggle-password .bx-show { display: none; }
.password-wrapper .toggle-password.showing .bx-show { display: inline-block; }
.password-wrapper .toggle-password.showing .bx-hide { display: none; }

/* === Floating labels (custom) para login === */
.floating-group { position: relative; }
.floating-group input {
  padding: 14px 12px; /* espacio para label */
}
.floating-group label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #555;
  font-size: 14px;
  pointer-events: none;
  transition: all 0.15s ease-in-out;
  background: transparent;
}
.floating-group input:focus + label,
.floating-group input:not(:placeholder-shown) + label {
  top: 0;
  transform: translateY(-50%) scale(0.85);
  color: #1e7e34;
  background: #ffffffaa;
  padding: 0 4px;
}
.floating-group input:focus {
  border-color: #1e7e34;
  box-shadow: 0 0 0.25rem 0.05rem rgba(30, 126, 52, 0.45);
}
/* Ajustes cuando hay ojito */
.floating-group.password-wrapper input { padding-right: 76px; }
.floating-group.password-wrapper label { right: 56px; }

.forgot {
    font-size: 13px;
    color: #1e7e34;
    text-decoration: none;
    margin-bottom: 20px;
    display: inline-block;
}

.btn {
    width: 100%;
    padding: 12px;
    background: #1e7e34;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 20px;
}

.btn:hover {
    background: #155d27;
}

.register-text {
    font-size: 14px;
    text-align: center;
    color: #333;
}

.register-text a {
    color: #1e7e34;
    text-decoration: none;
    font-weight: bold;
}

.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    color: #dc3545;
    font-size: 12px;
    margin-top: -10px;
    margin-bottom: 10px;
    text-align: left;
}

/* ==== ONLOADER ==== */
#onloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
}

#onloader .spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #1e7e34; /* Verde corporativo */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

#onloader p {
    font-size: 16px;
    color: #333;
    font-weight: bold;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#onloader {
    transition: opacity 0.8s ease;
}

/* Bo
tón modo oscuro */
.modo-oscuro-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #28a745;
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modo-oscuro-btn:hover {
    background: #1e7e34;
    transform: scale(1.1);
}

/* Estilos modo claro (por defecto) */
.input-group label {
    color: #000000;
}

.toggle-password {
    color: #000000;
}

/* Estilos modo oscuro */
body.modo-oscuro {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.modo-oscuro .login-container {
    background-color: #1a1a1a;
}

body.modo-oscuro .login-form {
    background-color: #2d2d2d;
}

body.modo-oscuro h1 {
    color: #e0e0e0;
}

body.modo-oscuro .subtitle {
    color: #b0b0b0;
}

body.modo-oscuro .input-group label {
    color: #ffffff !important;
}

body.modo-oscuro .form-control {
    background-color: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

body.modo-oscuro .form-control:focus {
    background-color: #3a3a3a;
    border-color: #28a745;
    color: #e0e0e0;
}

body.modo-oscuro .toggle-password {
    color: #ffffff !important;
}

body.modo-oscuro .toggle-password i {
    color: #ffffff !important;
}

body.modo-oscuro .forgot {
    color: #4ade80;
}

body.modo-oscuro .forgot:hover {
    color: #22c55e;
}

body.modo-oscuro .register-text {
    color: #b0b0b0;
}

body.modo-oscuro .register-text a {
    color: #4ade80;
}

body.modo-oscuro .register-text a:hover {
    color: #22c55e;
}

body.modo-oscuro .back-link {
    color: #4ade80;
}

body.modo-oscuro .back-link:hover {
    color: #22c55e;
}


/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .login-container {
        flex-direction: column;
    }
    
    .carousel {
        flex: 1;
        height: 40vh;
    }
    
    .login-form {
        flex: 1;
        padding: 40px 30px;
    }
}

@media (max-width: 768px) {
    .carousel {
        height: 30vh;
    }
    
    .login-form {
        padding: 30px 20px;
    }
    
    .login-form h1 {
        font-size: 20px;
    }
    
    .logo {
        width: 150px;
    }
    
    .caption {
        bottom: 15px;
        left: 15px;
        padding: 10px 15px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .carousel {
        height: 25vh;
    }
    
    .login-form {
        padding: 20px 15px;
    }
    
    .login-form h1 {
        font-size: 18px;
    }
    
    .logo {
        width: 120px;
    }
    
    .btn {
        padding: 10px;
        font-size: 14px;
    }
    
    .input-group input {
        padding: 8px;
        font-size: 14px;
    }
    
    .caption {
        display: none;
    }
}
