/**
 * Estilos para Login - Tema Agropecuario
 * Paleta de colores verde naturaleza
 * @version 2.0.4
 */

:root {
    --primary-green: #2d7a3e;
    --primary-green-light: #4a9d5f;
    --primary-green-dark: #1e5128;
    --accent-lime: #7cb342;
    --accent-lime-light: #9ccc65;
    --bg-cream: #f8f9f5;
    --bg-light: #ffffff;
    --text-dark: #2c3e2f;
    --text-medium: #5a6c5b;
    --text-light: #8a9d8b;
    --border-color: #d4e4d7;
    --error-red: #d32f2f;
    --success-green: #388e3c;
    --shadow-light: rgba(45, 122, 62, 0.1);
    --shadow-medium: rgba(45, 122, 62, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e5128 0%, #2d7a3e 50%, #4a9d5f 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
    max-width: 100vw;
}


@keyframes gradientShift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-50px, -50px); }
}

.login-container {
    background: var(--bg-light);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(45, 122, 62, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    max-width: 440px;
    width: 100%;
    animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-header {
    background: linear-gradient(135deg, #2d7a3e 0%, #4a9d5f 100%);
    color: white;
    padding: 45px 35px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.login-header i {
    font-size: 3.5rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.login-header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.login-header p {
    opacity: 0.95;
    font-size: 1rem;
    font-weight: 300;
}

.login-body {
    padding: 45px 35px;
    background: var(--bg-light);
}

.form-group {
    margin-bottom: 28px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group label i {
    margin-right: 6px;
    color: var(--primary-green);
}

.input-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon > i:first-child {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.2rem;
    transition: color 0.3s;
    z-index: 1;
    pointer-events: none;
}

.form-control {
    width: 100%;
    padding: 14px 18px 14px 48px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-dark);
    background: var(--bg-cream);
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green);
    background: var(--bg-light);
    box-shadow: 0 0 0 4px var(--shadow-light);
}

.form-control:focus + .toggle-password {
    color: var(--primary-green);
}

.input-icon:focus-within > i:first-child {
    color: var(--primary-green);
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 8px;
    transition: color 0.3s;
    z-index: 2;
    font-size: 1.1rem;
}

.toggle-password:hover {
    color: var(--primary-green);
}

.toggle-password:focus {
    outline: none;
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #2d7a3e 0%, #3d8b4e 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-medium);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-login:hover::before {
    width: 300px;
    height: 300px;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow-medium);
}

.btn-login:active {
    transform: translateY(-1px);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-login i {
    margin-right: 8px;
}

.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: none;
    font-size: 0.95rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error {
    background: #ffebee;
    color: var(--error-red);
    border: 1px solid #ffcdd2;
}

.alert-error::before {
    content: '\f071';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 8px;
}

.alert-success {
    background: #e8f5e9;
    color: var(--success-green);
    border: 1px solid #c8e6c9;
}

.alert-success::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 8px;
}

.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.login-footer {
    text-align: center;
    padding: 25px 20px;
    background: var(--bg-cream);
    color: var(--text-medium);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    margin: 8px 0;
}

.login-footer i {
    margin-right: 6px;
    color: var(--primary-green);
}

.forgot-password {
    text-align: center;
    margin-top: 20px;
}

.forgot-password a {
    color: var(--primary-green);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-block;
}

.forgot-password a i {
    margin-right: 6px;
}

.forgot-password a:hover {
    color: var(--primary-green-dark);
    transform: translateX(2px);
}

/* Responsive */
@media (max-width: 480px) {
    .login-container {
        max-width: 100%;
        border-radius: 16px;
    }
    
    .login-header {
        padding: 35px 25px;
    }
    
    .login-header i {
        font-size: 3rem;
    }
    
    .login-header h1 {
        font-size: 1.6rem;
    }
    
    .login-body {
        padding: 35px 25px;
    }
    
    .form-group {
        margin-bottom: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.grecaptcha-badge {
    z-index: 999 !important;
    bottom: 70px !important;
}

@media (max-width: 480px) {
    .grecaptcha-badge {
        bottom: 10px !important;
        transform: scale(0.85);
        transform-origin: bottom right;
    }
}