:root {
    --primary-color: #00A651;
    --primary-dark: #008542;
    --primary-light: #4DC980;
    --secondary-color: #00D07A;
    --secondary-dark: #00A861;
    --secondary-light: #66E0A3;
    --accent-color: #FFCC00;
    --dark-color: #0B3714;
    --light-color: #F5FFF7;
    --error-color: #DC2626;
    --warning-color: #F59E0B;
    --success-color: #10B981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    background-color: #000;
    position: relative;
}

#particles-bg {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
}

.login-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    background: linear-gradient(135deg, rgba(0,166,81,0.9) 0%, rgba(11,55,20,0.9) 100%);
}

.login-left {
    flex: 1;
    background: url('../../images/curico-bg.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
    display: none;
}

@media (min-width: 1024px) {
    .login-left {
        display: block;
    }
}

.login-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,166,81,0.8) 0%, rgba(151, 182, 157, 0.95) 100%);
}

.login-left-content {
    position: relative;
    color: white;
    padding: 3rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-left-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    line-height: 1.2;
}

.login-left-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.feature-list {
    margin-bottom: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.feature-icon {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: var(--accent-color);
}

.city-logo {
    position: absolute;
    bottom: 2rem;
    left: 3rem;
    height: 60px;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.login-right-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, rgba(0,166,81,0.1) 0%, rgba(11,55,20,0.2) 100%);
    z-index: -1;
}

.login-box {
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    position: relative;
    z-index: 5;
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    background: linear-gradient(45deg, 
        transparent 20%, 
        rgba(255, 255, 255, 0.1), 
        transparent 80%);
    z-index: -1;
    transition: all 1s;
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.login-logo {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.login-logo img {
    height: 60px;
    margin-right: 1rem;
}

.login-logo h2 {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
}

.login-form-title {
    margin-bottom: 2rem;
    text-align: center;
}

.login-form-title h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-form-title p {
    opacity: 0.8;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group .password-toggle {
    position: absolute;
    right: 1rem;
    top: 2.5rem;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.form-group .password-toggle:hover {
    color: white;
}

.rut-validator {
    position: absolute;
    right: 1rem;
    top: 2.5rem;
    font-size: 0.8rem;
}

.rut-valid {
    color: var(--success-color);
}

.rut-invalid {
    color: var(--error-color);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 0.85rem;
}

.remember-me {
    display: flex;
    align-items: center;
}

.remember-me input {
    margin-right: 0.5rem;
    accent-color: var(--primary-light);
}

.forgot-password {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
}

.forgot-password:hover {
    color: white;
    text-decoration: underline;
}

.login-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    transform: rotate(45deg);
    transition: all 0.5s;
    opacity: 0;
}

.login-btn:hover:not(:disabled) {
    background: linear-gradient(45deg, var(--primary-dark), var(--secondary-dark));
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.login-btn:hover:not(:disabled)::before {
    animation: shine 1.5s;
}

@keyframes shine {
    0% {
        left: -100%;
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

.login-btn i {
    margin-right: 0.5rem;
}

.security-info {
    background: rgba(0, 166, 81, 0.2);
    border: 1px solid rgba(0, 166, 81, 0.3);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
    opacity: 0.9;
}

.security-info i {
    margin-right: 0.5rem;
    color: var(--success-color);
}

.login-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.7;
}

.alert-error {
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    animation: shake 0.5s;
}

.alert-error i {
    margin-right: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.1rem;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.alert-warning {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
}

.alert-warning i {
    margin-right: 0.5rem;
    color: var(--warning-color);
    margin-top: 0.1rem;
}

/* Decorative elements */
.circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    filter: blur(60px);
    opacity: 0.5;
    z-index: 0;
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -100px;
}

.circle-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -50px;
}

.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 1;
}

.shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    animation: float 10s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.2;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0.2;
    }
}

.typing-cursor::after {
    content: '|';
    animation: blink 1s infinite step-end;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@media (max-width: 768px) {
    .login-box {
        padding: 2rem;
        max-width: 400px;
    }
    
    .login-form-title h2 {
        font-size: 1.5rem;
    }
    
    .form-options {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Glassmorphism for modern browsers */
@supports (backdrop-filter: blur(20px)) {
    .login-box {
        background: rgba(255, 255, 255, 0.05);
    }
}

/* Loading state */
.loading {
    pointer-events: none;
}

.loading .login-btn {
    background: linear-gradient(45deg, #666, #888);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}