/* General Styles */
:root {
    --whatsapp-green: #128C7E;
    --whatsapp-green-dark: #075E54;
    --whatsapp-green-light: #25D366;
    --whatsapp-blue: #34B7F1;
    --whatsapp-background: #f0f2f5;
    --whatsapp-chat-background: #e5ddd5;
    --text-dark: #333;
    --text-medium: #666;
    --text-light: #999;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, var(--whatsapp-green), var(--whatsapp-green-dark));
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Login Container */
.login-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Login Header */
.login-header {
    background-color: var(--whatsapp-green);
    color: white;
    padding: 25px 20px;
    text-align: center;
    position: relative;
}

.login-header h2 {
    margin: 0;
    font-weight: 600;
    font-size: 1.8rem;
    letter-spacing: 0.5px;
}

.login-header i {
    position: absolute;
    top: 25px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.login-header i:hover {
    transform: rotate(30deg);
}

/* WhatsApp Logo */
.whatsapp-logo {
    width: 80px;
    height: 80px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -60px auto 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    border: 4px solid white;
    position: relative;
    z-index: 1;
}

.whatsapp-logo i {
    font-size: 3rem;
    color: var(--whatsapp-green);
}

/* Login Body */
.login-body {
    padding: 25px;
}

/* Form Elements */
.form-control {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 20px;
    transition: all 0.3s;
    font-size: 1rem;
    width: 100%;
}

.form-control:focus {
    border-color: var(--whatsapp-green);
    box-shadow: 0 0 0 0.2rem rgba(18, 140, 126, 0.25);
    outline: none;
}

.input-group {
    position: relative;
}

.input-group .btn {
    border-left: none;
    background-color: transparent;
    border-color: #e0e0e0;
}

.input-group .btn:hover {
    background-color: #f8f9fa;
}

/* Labels */
.form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    display: block;
}

/* Buttons */
.btn-login {
    background-color: var(--whatsapp-green);
    color: white;
    border: none;
    padding: 12px;
    font-weight: 600;
    border-radius: 8px;
    width: 100%;
    transition: all 0.3s;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
}

.btn-login:hover {
    background-color: var(--whatsapp-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-login:active {
    transform: translateY(0);
}

/* Remember Me & Forgot Password */
.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
}

.remember-me input {
    margin-right: 8px;
    cursor: pointer;
}

#forgotPassword {
    color: var(--whatsapp-green);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

#forgotPassword:hover {
    color: var(--whatsapp-green-dark);
    text-decoration: underline;
}

/* Alerts */
.alert {
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert i {
    margin-right: 10px;
}

/* Login Footer */
.login-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-medium);
    border-top: 1px solid #eee;
    font-size: 0.9rem;
}

.login-footer a {
    color: var(--whatsapp-green);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.login-footer a:hover {
    color: var(--whatsapp-green-dark);
    text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .login-container {
        max-width: 100%;
        border-radius: 0;
    }
    
    body {
        padding: 0;
        background: white;
    }
    
    .login-header {
        padding: 20px 15px;
    }
    
    .login-body {
        padding: 20px 15px;
    }
    
    .whatsapp-logo {
        width: 70px;
        height: 70px;
        margin-top: -50px;
    }
    
    .whatsapp-logo i {
        font-size: 2.5rem;
    }
}

/* Animation for form elements */
.form-group {
    animation: slideUp 0.5s ease-out;
    animation-fill-mode: backwards;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Delay animations for each form element */
.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.remember-forgot { animation-delay: 0.3s; }
.btn-login { animation-delay: 0.4s; }
.login-footer { animation-delay: 0.5s; }

/* Password Input Group */
.input-group {
    display: flex;
    align-items: stretch; /* This makes children stretch to same height */
    margin-bottom: 20px;
}

.input-group .form-control {
    margin-bottom: 0; /* Remove margin when in input group */
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group #password {
    flex: 1; /* Take up remaining space */
    min-width: 0; /* Fix for flexbox overflow */
}

.input-group #togglePassword {
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-left: none;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    padding: 0 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.input-group #togglePassword:hover {
    background-color: #e9ecef;
}

.input-group #togglePassword i {
    font-size: 1rem;
    color: var(--text-medium);
}

/* Fix the border between input and button */
.input-group .form-control + #togglePassword {
    border-left: 0;
}

/* Make sure both elements have same height */
.input-group .form-control,
.input-group #togglePassword {
    height: 48px; /* Match this with your input height */
}