:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --secondary: #2ecc71;
    --accent: #9b59b6;
    --danger: #e74c3c;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    -webkit-tap-highlight-color: transparent; 
}

body {
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    padding: 15px;
}

.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    overflow: hidden;
}

.gradient-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        rgba(52, 152, 219, 0.7),
        rgba(46, 204, 113, 0.7),
        rgba(155, 89, 182, 0.7),
        rgba(231, 76, 60, 0.7));
    background-size: 400% 400%;
    animation: gradientMove 15s ease infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
    background: white;
    animation: float-up 15s ease-in infinite;
}

@keyframes float-up {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    20% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

.particle:nth-child(1) { width: 10px; height: 10px; left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { width: 15px; height: 15px; left: 20%; animation-delay: 2s; }
.particle:nth-child(3) { width: 8px; height: 8px; left: 30%; animation-delay: 4s; }
.particle:nth-child(4) { width: 12px; height: 12px; left: 40%; animation-delay: 1s; }
.particle:nth-child(5) { width: 9px; height: 9px; left: 50%; animation-delay: 3s; }
.particle:nth-child(6) { width: 14px; height: 14px; left: 60%; animation-delay: 5s; }
.particle:nth-child(7) { width: 11px; height: 11px; left: 70%; animation-delay: 2.5s; }
.particle:nth-child(8) { width: 13px; height: 13px; left: 80%; animation-delay: 1.5s; }
.particle:nth-child(9) { width: 7px; height: 7px; left: 90%; animation-delay: 3.5s; }
.particle:nth-child(10) { width: 16px; height: 16px; left: 15%; animation-delay: 4.5s; }

.login-container {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 900px;
    height: auto;
    min-height: 600px;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
    z-index: 1;
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 0.8s forwards 0.3s ease-out;
}

.login-image {
    flex: 1;
    background: url("https://media.karousell.com/media/photos/products/2024/10/20/1br_acqua_private_residences_f_1729409922_db34df1f") center/cover;
    position: relative;
    overflow: hidden;
}

.login-image::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(44, 62, 80, 0.7), rgba(52, 152, 219, 0.7));
}

.login-image-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: white;
    text-align: center;
}

.login-image-content h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    transform: translateY(30px);
    opacity: 0;
    animation: fadeInUp 0.8s forwards 0.8s;
}

.login-image-content p {
    font-size: 1.1rem;
    max-width: 80%;
    margin-bottom: 30px;
    line-height: 1.6;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    transform: translateY(30px);
    opacity: 0;
    animation: fadeInUp 0.8s forwards 1.1s;
}

.login-form {
    flex: 1;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 15px;
    transform: translateY(30px);
    opacity: 0;
    animation: fadeInUp 0.8s forwards 0.5s;
}

.login-header p {
    color: #7f8c8d;
    font-size: 1rem;
    transform: translateY(30px);
    opacity: 0;
    animation: fadeInUp 0.8s forwards 0.7s;
}

.input-group {
    position: relative;
    margin-bottom: 30px;
    transform: translateY(30px);
    opacity: 0;
    animation: fadeInUp 0.8s forwards 0.9s;
}

.input-group:nth-child(2) {
    animation-delay: 1.1s;
}

.input-group label {
    position: absolute;
    left: 50px;
    font-size: 16px;
    color: #7f8c8d;
    pointer-events: none;
    transition: all 0.3s ease;
    top: 50%;
    transform: translateY(-50%);
}

.input-group input {
    width: 100%;
    padding: 18px 20px 18px 50px;
    font-size: 16px;
    border: 2px solid #eef2f7;
    border-radius: 12px;
    background-color: #f5f7fa;
    color: var(--dark);
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    background-color: white;
}

.input-group input:focus + label,
.input-group input:valid + label {
    top: 0;
    left: 15px;
    transform: translateY(-50%) scale(0.85);
    background-color: white;
    padding: 0 8px;
    color: var(--primary);
    font-weight: 500;
    z-index: 3;
}

.input-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 20px;
    color: #7f8c8d;
    z-index: 2;
    transition: all 0.3s ease;
}

.input-group input:focus ~ .input-icon {
    color: var(--primary);
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    transform: translateY(30px);
    opacity: 0;
    animation: fadeInUp 0.8s forwards 1.3s;
}

.remember-me {
    display: flex;
    align-items: center;
}

.remember-me input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    background-color: #f5f7fa;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    transition: var(--transition);
}

.remember-me input[type="checkbox"]:after {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: '\f00c';
    font-size: 12px;
    color: white;
    display: none;
}

.remember-me input[type="checkbox"]:checked {
    background-color: var(--primary);
}

.remember-me input[type="checkbox"]:checked:after {
    display: block;
}

.remember-me label {
    margin-left: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #7f8c8d;
}

.forgot-password {
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.forgot-password:hover {
    color: var(--primary-dark);
}

.login-buttons {
    transform: translateY(30px);
    opacity: 0;
    animation: fadeInUp 0.8s forwards 1.5s;
}

.btn {
    width: 100%;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: 600;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
}

.btn i {
    margin-right: 10px;
    font-size: 18px;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--dark);
    border: 1px solid #e1e1e1;
}

.btn-secondary:hover {
    background-color: #f5f5f5;
    transform: translateY(-3px);
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn:hover::after {
    left: 100%;
}

.error-message {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--danger);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
    display: none;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

#login-status {
    background-color: rgba(46, 204, 113, 0.1);
    color: var(--secondary);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
    display: none;
}

.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(52, 152, 219, 0.95), rgba(44, 62, 80, 0.97));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    flex-direction: column;
    transition: var(--transition);
}

.loader {
    width: 60px;
    height: 60px;
    position: relative;
}

.loader:before,
.loader:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: white;
    opacity: 0.6;
    animation: pulse 2s ease-in-out infinite;
}

.loader:after {
    animation-delay: -1s;
}

.preloader p {
    color: white;
    font-size: 16px;
    margin-top: 20px;
    letter-spacing: 1px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(0);
        opacity: 0.8;
    }
    50% {
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 992px) {
    .login-container {
        width: 90%;
        max-width: 700px;
        min-height: auto;
        flex-direction: column;
    }

    .login-image {
        display: none;
    }

    .login-form {
        width: 100%;
        padding: 40px 30px;
    }
    
    .login-header h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .login-container {
        width: 95%;
        max-width: 500px;
        padding: 0;
    }
    
    .login-form {
        padding: 30px 25px;
    }
    
    .login-header h1 {
        font-size: 2rem;
    }
    
    .input-group input {
        padding: 16px 20px 16px 50px;
    }
    
    .btn {
        padding: 14px;
    }
}

@media (max-width: 576px) {
    body {
        padding: 10px;
    }
    
    .login-container {
        width: 100%;
        border-radius: 15px;
    }
    
    .login-form {
        padding: 25px 20px;
    }
    
    .login-header {
        margin-bottom: 25px;
    }
    
    .login-header h1 {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
    
    .login-header p {
        font-size: 0.9rem;
    }
    
    .input-group {
        margin-bottom: 25px;
    }
    
    .input-group label {
        font-size: 15px;
    }
    
    .input-group input {
        padding: 15px 15px 15px 45px;
        font-size: 15px;
    }
    
    .remember-forgot {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .btn {
        padding: 12px;
        font-size: 15px;
    }
    
    .btn i {
        font-size: 16px;
    }
}

@media (max-width: 375px) {
    .login-form {
        padding: 20px 15px;
    }
    
    .login-header h1 {
        font-size: 1.6rem;
    }
    
    .input-group input {
        padding: 14px 15px 14px 40px;
        font-size: 14px;
    }
    
    .input-group label {
        font-size: 14px;
        left: 40px;
    }
    
    .input-icon {
        left: 15px;
    }
    
    .remember-me label {
        font-size: 13px;
    }
    
    .forgot-password {
        font-size: 13px;
    }
}

@supports (-webkit-touch-callout: none) {
    .input-group input {
        font-size: 16px;
    }
    
    .remember-me input[type="checkbox"] {
        margin: 0; 
    }
}