/* RESET */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Segoe UI', sans-serif; 
}

/* BACKGROUND */
body {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #507dbc;
    overflow: hidden;
}

/* Floating Circles */
body::before, body::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    animation: float 10s infinite ease-in-out;
    pointer-events: none;
}
body::before {
    width: 300px; 
    height: 300px;
    top: -100px; 
    left: -100px;
}
body::after {
    width: 400px; 
    height: 400px;
    bottom: -150px; 
    right: -150px;
    animation-delay: 5s;
}
@keyframes float {
    0%,100% { 
        transform: translateY(0) scale(1);
    }
    50% { 
        transform: translateY(-40px) scale(1.05);
    }
}

/* LOGIN CONTAINER */
.login-container {
    position: relative;
    background: rgba(255, 255, 255, 0.97);
    padding: 60px 30px 40px 30px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    text-align: center;
    width: 380px;
    backdrop-filter: blur(10px);
    transform: scale(0.95);
    opacity: 0;
    animation: fadeIn 0.7s forwards ease-in-out;
}
@keyframes fadeIn {
    to { 
        transform: scale(1); 
        opacity: 1; 
    }
}

/* BACK ICON (above logo) */
.back-icon {
    position: absolute;
    top: 25px;
    left: 25px;
    color: #3a6ab7;
    font-size: 22px;
    cursor: pointer;
    transition: transform 0.2s ease, color 0.3s ease;
    z-index: 100;
}
.back-icon:hover {
    transform: translateX(-4px);
    color: #507dbc;
}

/* LOGO */
.login-container img {
    width: 140px; 
    margin-bottom: 15px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* HEADER */
.login-container h2 {
    font-size: 22px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 25px;
}

/* FORM FIELDS */
.form-group { 
    position: relative; 
    margin-bottom: 25px; 
}

/* Password Container */
.password-container {
    position: relative;
    width: 100%;
}

/* Input styles - combined for all input types */
.form-group input[type="email"],
.form-group input[type="password"],
.password-container input[type="password"],
.password-container input[type="text"] {
    width: 100%;
    padding: 14px 12px;
    border-radius: 12px;
    border: 1px solid #ccc;
    outline: none;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.95);
    transition: 0.3s ease;
    box-sizing: border-box;
}

/* Specific padding for password inputs to accommodate eye icon */
.password-container input[type="password"],
.password-container input[type="text"] {
    padding-right: 40px;
}

/* Focus states */
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.password-container input[type="password"]:focus,
.password-container input[type="text"]:focus {
    border-color: #507dbc;
    box-shadow: 0 0 10px rgba(80, 125, 188, 0.6);
    transform: scale(1.02);
}

/* Eye icon styling */
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #507dbc;
    font-size: 18px;
    z-index: 10;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: #3a6ab7;
}

/* LABEL STYLING */
.form-group label,
.password-container label {
    position: absolute;
    left: 12px;
    top: -10px;
    color: #507dbc;
    pointer-events: none;
    font-size: 12px;
    font-weight: 500;
    background: white;
    padding: 0 5px;
    z-index: 1;
}

/* BUTTON */
button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #507dbc, #3a6ab7);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 15px rgba(80, 125, 188, 0.4);
}
button:hover {
    background: linear-gradient(135deg, #3a6ab7, #507dbc);
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(80, 125, 188, 0.5);
}

/* ERROR MESSAGE */
.error {
    color: #e74c3c; 
    margin-top: 15px; 
    font-size: 14px;
    font-weight: 500;
    animation: shake 0.3s ease-in-out;
}
@keyframes shake {
    0%,100% { 
        transform: translateX(0); 
    }
    25% { 
        transform: translateX(-5px); 
    }
    75% { 
        transform: translateX(5px); 
    }
}

/* SIGN UP TEXT */
.signup-text {
    margin-top: 20px;
    font-size: 15px;
    color: #2c3e50;
    text-align: center;
}
.signup-text span {
    color: #507dbc;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
.signup-text span:hover {
    color: #3a6ab7;
    text-decoration: underline;
    transform: scale(1.05);
}

/* RESPONSIVE */
@media screen and (max-width:480px){
    .login-container { 
        width: 90%; 
        padding: 60px 25px 35px 25px; 
    }
    .login-container img { 
        width: 120px; 
    }
    .login-container h2 { 
        font-size: 20px; 
    }
    .back-icon { 
        top: 20px; 
        left: 20px; 
        font-size: 20px; 
    }
    
    /* Responsive adjustments for password container */
    .password-container input[type="password"],
    .password-container input[type="text"] {
        padding: 12px 10px;
        padding-right: 35px;
        font-size: 14px;
    }
    
    .toggle-password {
        right: 10px;
        font-size: 16px;
    }
}