:root {
    --bg-gradient-start: #0f172a;
    --bg-gradient-end: #1e1b4b;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --input-bg: rgba(0, 0, 0, 0.2);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-focus: rgba(59, 130, 246, 0.5);
}

body {
    margin: 0;
    padding: 0;
    height: 100vh;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Decorations */
.login-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.circle-1 {
    width: 400px;
    height: 400px;
    background: #3b82f6;
    top: -100px;
    left: -100px;
}

.circle-2 {
    width: 500px;
    height: 500px;
    background: #8b5cf6;
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 50px); }
}

/* Form Styles */
.form-login {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.card-header {
    text-align: center;
    margin-bottom: 30px;
    background: transparent;
    border: none;
    padding: 0;
}

.logo-container {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.title {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.subtitle {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Inputs */
.input-group {
    margin-bottom: 25px;
    flex-direction: column;
}

.input-label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
}

/* Left Icon (Email, Lock) */
.input-wrapper > i:first-child {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 18px;
    transition: color 0.3s;
    pointer-events: none; /* Let clicks pass through to input */
}

/* Right Icon (Toggle Password) */
#togglePassword {
    position: absolute;
    right: 15px;
    left: auto; /* Reset left property */
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 18px;
    transition: color 0.3s;
    cursor: pointer;
    z-index: 5;
}

#togglePassword:hover {
    color: var(--accent-color);
}

.form-control {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 12px 45px 12px 45px; /* Left and Right padding for icons */
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s;
    height: auto;
}

.form-control:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    color: white;
}

.form-control:focus + i,
.input-wrapper:focus-within i {
    color: var(--accent-color);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Button */
.card-footer {
    background: transparent;
    border: none;
    padding: 0;
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.btn-login {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.forgot-password {
    color: var(--text-secondary);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-password:hover {
    color: var(--accent-color);
}

.footer-text {
    text-align: center;
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.2);
    font-size: 12px;
}

/* Alert Styling for Login */
.alert {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    padding: 15px 25px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.9); /* Default red for error */
    color: white;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.5s ease-out forwards;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 400px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.9); /* Green */
}

.alert-danger {
    background: rgba(239, 68, 68, 0.9); /* Red */
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Validation Styles override Bootstrap */
.invalid-feedback {
    display: block;
    font-size: 12px;
    margin-top: 5px;
    color: #ef4444; /* Red 500 */
}

.form-control.is-invalid {
    border-color: #ef4444;
    background-image: none; /* Remove bootstrap validation icon */
}

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }
}