/* Password Toggle Button Styles */
.password-toggle-group {
    position: relative;
}

.password-toggle-btn {
    border: 1px solid #ced4da;
    border-left: none;
    background-color: #f8f9fa;
    color: #6c757d;
    transition: all 0.2s ease-in-out;
    min-width: 44px; /* Ensure touch-friendly size */
}

.password-toggle-btn:hover {
    background-color: #e9ecef;
    color: #495057;
}

.password-toggle-btn:focus {
    box-shadow: none;
    border-color: #ced4da;
    background-color: #e9ecef;
}

.input-group .form-control:focus {
    border-right: none;
    box-shadow: none;
}

.input-group .form-control:focus + .password-toggle-btn {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Eye icon animation */
.password-toggle-btn i {
    transition: all 0.2s ease-in-out;
    font-size: 16px; /* Ensure icon is visible */
}

.password-toggle-btn:hover i {
    transform: scale(1.1);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .input-group {
        flex-direction: row; /* Keep horizontal layout */
        align-items: stretch;
    }
    
    .input-group .form-control {
        border-radius: 10px 0 0 10px;
        border-right: none;
        flex: 1;
        min-height: 44px; /* Touch-friendly height */
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .password-toggle-btn {
        border-radius: 0 10px 10px 0;
        border-left: none;
        border-right: 1px solid #ced4da;
        border-top: 1px solid #ced4da;
        border-bottom: 1px solid #ced4da;
        background-color: #f8f9fa;
        color: #6c757d;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    
    .password-toggle-btn:hover {
        background-color: #e9ecef;
        color: #495057;
    }
    
    .password-toggle-btn i {
        font-size: 18px; /* Larger icon for mobile */
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    .input-group .form-control {
        padding: 12px 15px;
        font-size: 16px;
    }
    
    .password-toggle-btn {
        padding: 12px 15px;
        min-width: 50px;
        min-height: 48px;
    }
    
    .password-toggle-btn i {
        font-size: 20px; /* Even larger icon for small screens */
    }
}

/* Ensure proper focus states on mobile */
@media (max-width: 768px) {
    .input-group .form-control:focus {
        border-color: #667eea;
        box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
        border-right: none;
    }
    
    .input-group .form-control:focus + .password-toggle-btn {
        border-color: #667eea;
        box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
        border-left: none;
    }
}
