
:root {
    /* Colores principales */
    --agri-primary: #2d6a4f;      /* Verde oscuro profundo */
    --agri-secondary: #40916c;     /* Verde medio */
    --agri-accent: #52b788;        /* Verde claro */
    --agri-light: #d8f3dc;         /* Verde muy claro */
    --agri-earth: #5a4a42;         /* Tierra */

    /* Neutrales */
    --agri-text: #1b4332;          /* Texto oscuro */
    --agri-text-light: #555;       /* Texto secundario */
    --agri-border: #d1e7dd;        /* Borde claro */
    --agri-bg: #f8faf7;            /* Fondo muy claro */
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--agri-light) 0%, var(--agri-bg) 100%);
    overflow: hidden;
}

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

/* SECCIÓN IZQUIERDA - IMAGEN HERO */
.login-hero {
    flex: 1;
    background: linear-gradient(135deg, var(--agri-primary) 0%, var(--agri-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.login-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    filter: blur(40px);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 500px;
}

.hero-image {
    width: 100%;
    max-width: 450px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    object-fit: cover;
    margin-bottom: 30px;
    animation: slideInLeft 0.8s ease-out;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.95;
    line-height: 1.6;
}

.hero-features {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.feature-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.feature-badge:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 1.2rem;
}

/* SECCIÓN DERECHA - FORMULARIO */
.login-form-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: white;
}

.login-form-wrapper {
    width: 100%;
    max-width: 420px;
    animation: slideInRight 0.8s ease-out;
}

.login-header {
    margin-bottom: 40px;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--agri-primary);
}

.logo-icon {
    font-size: 2rem;
}

.login-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--agri-text);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 0.95rem;
    color: var(--agri-text-light);
    font-weight: 400;
}

/* ALERTAS */
#errorBox {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    animation: slideDown 0.3s ease-out;
}

#errorBox.d-none {
    display: none;
}

#errorBox::before {
    content: '⚠️';
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* FORMULARIO */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--agri-text);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--agri-border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: var(--agri-bg);
    color: var(--agri-text);
}

.form-control:focus {
    outline: none;
    border-color: var(--agri-secondary);
    box-shadow: 0 0 0 3px rgba(64, 145, 108, 0.1);
    background: white;
}

.form-control::placeholder {
    color: #999;
}

.input-icon-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--agri-text-light);
    pointer-events: none;
    font-size: 1.1rem;
}

/* VALIDACIÓN */
.form-control.is-invalid {
    border-color: #dc3545;
    background-image: none;
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 6px;
    animation: slideDown 0.3s ease-out;
}

/* BOTÓN */
#btnLogin {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--agri-secondary) 0%, var(--agri-primary) 100%);
    border: none;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(64, 145, 108, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#btnLogin:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--agri-primary) 0%, var(--agri-secondary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(64, 145, 108, 0.4);
}

#btnLogin:active:not(:disabled) {
    transform: translateY(0);
}

#btnLogin:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

#btnLogin::before {
    content: '';
    display: none;
}

#btnLogin.loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* FOOTER */
.login-footer {
    margin-top: 20px;
    text-align: center;
    color: var(--agri-text-light);
    font-size: 0.85rem;
}

.login-footer a {
    color: var(--agri-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.login-footer a:hover {
    color: var(--agri-primary);
    text-decoration: underline;
}

/* ANIMACIONES */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RESPONSIVE */
@media (max-width: 968px) {
    .login-container {
        flex-direction: column;
    }

    .login-hero {
        min-height: 250px;
        padding: 30px 20px;
    }

    .hero-image {
        max-width: 350px;
        margin-bottom: 20px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .login-form-section {
        padding: 30px 20px;
    }

    .login-form-wrapper {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .login-hero {
        min-height: 200px;
        padding: 20px;
    }

    .hero-image {
        max-width: 280px;
        margin-bottom: 15px;
        border-radius: 12px;
    }

    .hero-title {
        font-size: 1.4rem;
    }

    .hero-features {
        gap: 10px;
    }

    .feature-badge {
        padding: 10px 16px;
        font-size: 0.8rem;
    }

    .login-form-section {
        padding: 20px;
    }

    .login-header {
        margin-bottom: 30px;
    }

    .login-title {
        font-size: 1.4rem;
    }

    .form-control {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    #btnLogin {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}
