/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
}

/* Login Container */
.login-container {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    animation: fadeIn 0.5s ease-in;
}

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

/* Logo */
.logo {
    width: 100px;
    height: 100px;
    display: block;
    margin: 0 auto 20px;
    border-radius: 50%;
    object-fit: cover;
}

/* Heading */
.login-container h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 24px;
}

/* Error and Success Messages */
.error-message {
    color: #e74c3c;
    background-color: #fadbd8;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
    border-left: 4px solid #e74c3c;
    animation: shake 0.3s ease-in-out;
}

.success-message {
    color: #27ae60;
    background-color: #d5f4e6;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
    border-left: 4px solid #27ae60;
    animation: slideIn 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

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

/* Form Styles */
form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    font-size: 18px;
    color: #999;
    pointer-events: none;
}

/* Input Fields */
input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 14px 45px 14px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Input Error State */
.input-error {
    border-color: #e74c3c !important;
    background: #fff5f5 !important;
}

.input-error:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

/* Toggle Eye Icon */
.toggle-eye {
    position: absolute;
    right: 15px;
    cursor: pointer;
    font-size: 18px;
    user-select: none;
    transition: transform 0.2s ease;
}

.toggle-eye:hover {
    transform: scale(1.2);
}

/* Submit Button */
button[type="submit"] {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

button[type="submit"]:active {
    transform: translateY(0);
}

button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

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

/* Links */
.login-container a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    display: block;
    text-align: center;
    margin-top: 15px;
    transition: color 0.3s ease;
}

.login-container a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.error-message {
    color: #e74c3c;
    background-color: #fadbd8;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 14px;
    display: none;
    border-left: 4px solid #e74c3c;
}

.success-message {
    color: #27ae60;
    background-color: #d5f4e6;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 14px;
    display: none;
    border-left: 4px solid #27ae60;
}

.input-error {
    border: 2px solid #e74c3c !important;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        padding: 40px;
        width: 90%;
        max-width: 420px;
    }

    .login-container h2 {
        font-size: 18px;
    }

    .logo {
        width: 80px;
        height: 80px;
        margin: 0 auto 20px;
    }

    input[type="text"],
    input[type="password"] {
        padding: 12px 40px 12px 40px;
        font-size: 14px;
    }

    button[type="submit"] {
        padding: 12px;
        font-size: 15px;
    }
}
